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 )
-------------------------------------------------------------------------
|