Trading Articles
Article Categories
Article Tools
CAM indicator to be corrected
Updated May 15, 2023
trending_up
223 views
thumb_up
2 thanks given
group
3 followers
forum
3 posts
attach_file
1 attachments
Welcome to futures io: the largest futures trading community on the planet, with well over 150,000 members
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free and simple.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
CAM indicator to be corrected
(login for full post details)
#1 (permalink )
Turin + Italy
Posts: 188 since Feb 2020
Thanks: 24 given,
117
received
Hi,
here is the CAM indicator formula (for Tradestation and other software):
https://traders.com/Documentation/FEEDbk_docs/2018/01/TradersTips.html
but checking the formula, Tradestation 8 reports this error: "Arithmetic (numeric) expression expected here" in the word: not (see in the image, the red arrow in the word: not):
https://postimg.cc/Fd7wZh0K
if someone can correct the code, I thank you in advance; the formula is this:
---------------------------------------------------------------------------------------------
// The CAM Indicator
// Barbara Star, PhD. - TASC JAN 2018
inputs:
ADXLength( 10 ),
MACDFastLength( 12 ),
MACDSlowLength( 26 ),
CAMUPColor( Green ),
CAMDNColor( Red ),
CAMPBColor( Yellow ),
CAMCTColor( Blue ) ;
variables:
MACDValue( 0 ),
ADXValue( 0 ),
PlotColor( 0 ),
MACDRising( false ),
ADXRising( false ),
intrabarpersist InAChart( false ),
PatternLabel( "" ) ;
once
begin
InAChart = GetAppInfo( aiApplicationType ) = cChart ;
end ;
MACDValue = MACD( Close, MACDFastLength,
MACDSlowLength ) ;
ADXValue = ADX( ADXLength ) ;
MACDRising = MACDValue > MACDValue[1] ;
ADXRising = ADXValue > ADXValue[1] ;
if ADXRising and MACDRising then
begin
PlotColor = CAMUPColor ;
PatternLabel = "CAM UP" ;
end
else if not ADXRising and not MACDRising then
begin
PlotColor = CAMPBColor ;
PatternLabel = "CAM PB" ;
end
else if ADXRising and not MACDRising then
begin
PlotColor = CAMDNColor ;
PatternLabel = "CAM DN" ;
end
else if not ADXRising and MACDRising then
begin
PlotColor = CAMCTColor ;
PatternLabel = "CAM CT" ;
End ;
// Format plot style as follows:
// Plot1 Bar High
// Plot2 Bar Low
// Plot3 Left Tic
// Plot4 Right Tic
Plot1( High, "CAMH", PlotColor ) ;
Plot2( Low, "CAML", PlotColor ) ;
Plot3( Open, "CAMO", PlotColor ) ;
Plot4( Close, "CAMC", PlotColor ) ;
// Show current state in RadarScreen
If not InAChart then
Plot5( PatternLabel, "CAM", PlotColor )
-------------------------------------------------------------------------
Can you help answer these questions from other members on futures io?
Best Threads (Most Thanked) in the last 7 days on futures io
(login for full post details)
#2 (permalink )
Seattle,Washington,USA
Posts: 5 since Nov 2011
Thanks: 0 given,
3
received
At the very bottom - last 2 lines of code - try this: I added a Semicolon and a Double forward slash - and it Compiles
Plot5( PatternLabel, "CAM", PlotColor );
//-------------------------------------------------------------------------
By the way - I haven't used Tradestation for many years now - I modified your code in Multicharts .
I haven't done much on FuturesIO for a long time now - was going to add at picture - but it didn't work for me - much different from Elitetrader.
(login for full post details)
#3 (permalink )
Posts: 3,540 since Jul 2012
Thanks: 1,846 given,
7,108
received
TS 8 doesn't like "If Not" - that capability was added in TS 9 or 10, I think.
so take the logic and rearrange the expression to eliminate the "if Not" statements and it will work.
The following user says Thank You to kevinkdog for this post:
(login for full post details)
#4 (permalink )
Turin + Italy
Posts: 188 since Feb 2020
Thanks: 24 given,
117
received
Doob
At the very bottom - last 2 lines of code - try this: I added a Semicolon and a Double forward slash - and it Compiles
Plot5( PatternLabel, "CAM", PlotColor );
//-------------------------------------------------------------------------
By the way - I haven't used Tradestation for many years now - I modified your code in
Multicharts .
I haven't done much on FuturesIO for a long time now - was going to add at picture - but it didn't work for me - much different from Elitetrader.
To insert attachments and images, there are 2 methods:
or easier: after clicking on the button: Post Reply, click on the words on the left: "Paste images" (blue background), see image:
The following user says Thank You to Shaban for this post:
Last Updated on May 15, 2023