NexusFi: Find Your Edge


Home Menu

 





CAM indicator to be corrected


Discussion in EasyLanguage Programming

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




 
Search this Thread

CAM indicator to be corrected

  #1 (permalink)
Shaban
Turin + Italy
 
Posts: 194 since Feb 2020
Thanks Given: 24
Thanks Received: 129

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?
Cheap historycal L1 data for stocks
Stocks and ETFs
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
REcommedations for programming help
Sierra Chart
About a successful futures trader who didnt know anythin …
Psychology and Money Management
ZombieSqueeze
Platforms and Indicators
 
  #2 (permalink)
Doob
Seattle,Washington,USA
 
Posts: 14 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,666 since Jul 2012
Thanks Given: 1,892
Thanks Received: 7,360


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 Twitter Reply With Quote
Thanked by:
  #4 (permalink)
Shaban
Turin + Italy
 
Posts: 194 since Feb 2020
Thanks Given: 24
Thanks Received: 129


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:	43
Size:	87.4 KB
ID:	331740  
Reply With Quote
Thanked by:




Last Updated on May 15, 2023


© 2024 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 - Privacy Policy - Downloads - Top
no new posts