NexusFi: Find Your Edge


Home Menu

 





CAM indicator to be corrected


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,170 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 3 posts
    2. attach_file 1 attachments




 
Search this Thread
  #1 (permalink)
Shaban
Turin + Italy
 
Posts: 201 since Feb 2020
Thanks Given: 26
Thanks Received: 138

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 )

-------------------------------------------------------------------------


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
EA
Platforms and Indicators
Datafeed for Atas
Platforms and Indicators
Trump Media to sell instant access to market-moving soci …
Traders Hideout
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
No book, only a stair: journaling fills where price move …
Cryptocurrency
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Mes vs MNQ
6 thanks
NexusFi site changelog and issues/problem reporting
5 thanks
BERN ALGOS algo trading journal
3 thanks
Johnnys Journal
2 thanks
TopStep Trader disappointment
2 thanks
  #2 (permalink)
Doob
Seattle,Washington,USA
 
Posts: 15 since Nov 2011
Thanks Given: 0
Thanks Received: 13

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.


Reply With Quote
  #3 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,740 since Jul 2012
Thanks Given: 1,918
Thanks Received: 7,489


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.


Follow me on X Reply With Quote
Thanked by:
  #4 (permalink)
Shaban
Turin + Italy
 
Posts: 201 since Feb 2020
Thanks Given: 26
Thanks Received: 138


Doob View Post
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:


Attached Thumbnails
Click image for larger version

Name:	Future.io to insert images.jpg
Views:	172
Size:	87.4 KB
ID:	331740  
Reply With Quote
Thanked by:




Last Updated on May 15, 2023


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts