NexusFi: Find Your Edge


Home Menu

 





CAM indicator to be corrected


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,002 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?
I Have a Thing Called Iran -- Trump Stays in DC as Airsp …
Prediction Markets & Event Contracts
One Wallet Made $200K in Hours: AP Probes Polymarket Cea …
Prediction Markets & Event Contracts
Powell in 48 Hours: Word Markets Give 78% on Inflation, …
Prediction Markets & Event Contracts
Kalshi Sets $4.13B All-Time Weekly Record as Polymarket …
Prediction Markets & Event Contracts
Al Arabiya: US-Iran Draft Deal Within Hours Contains Hor …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
BERN ALGOS algo trading journal
8 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,737 since Jul 2012
Thanks Given: 1,917
Thanks Received: 7,476


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:	148
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