AFL Syntax Error - PLz Help

#1
Dear Friends,

I have got this AFL for TD- Sequential from Interent which I wanted to backtest. However, I am getting sysntax error for the last line "_Section_End();". I have corrected other syntax errors but could not correct this one. A showcase of my programming skills. :)

Can anybody please help me out?

Thanks & Regards,
--Ashish
 
#2
Ashish,

The close brace for 'if' condition is missing in Line No. 130. Highlighted in red colour for you.

The AFL Formula Editor doesn't have in-built indentation. It would have helped to code AFL a much easier, had it been present.

Praveen.

if(ShowTDPoints)
{
PlotShapes(TD_Supply()*shapeSmallCircle, colorRed, 0, H, H*.001);
PlotShapes(TD_Demand()*shapeSmallCircle, colorGreen, 0, L, -L*.001);
///////////////////////////////////////////////////////////////////////////
y0 = StrToNum(NumToStr(ValueWhen(TD_Demand(), L)));
x = LineArray(0, y0, (BarCount-1), y0);
Plot(x, "", colorGold, styleDashed);
y0 = StrToNum(NumToStr(ValueWhen(TD_Supply(), H)));
x = LineArray(0, y0, (BarCount-1), y0);
Plot(x, "", colorGold, styleDashed);
}
 

Ajax

Well-Known Member
#3
Dear Aca

Try the AFL attached

I have removed every thing below the sell signal.
This should be good for backtesting... (Though not for charting)

I backtested it on NSE stocks from 1.1.07 till date ..
result 27% loss
regards
Ajax
 
Last edited:
#4
Dear Aca

Try the AFL attached

I have removed every thing below the sell signal.
This should be good for backtesting... (Though not for charting)

I backtested it on NSE stocks from 1.1.07 till date ..
result 27% loss
regards
Ajax
Hi Ajax!

Thanks for the backtest.
However, I am not looking forward to using this system. I was just looking for some filters to a system I am testing and came across the Demark Book on Options Trading. Hence, thought to apply it as an additional input.

Regards,
--Ashish
 
#5
Ashish,

The close brace for 'if' condition is missing in Line No. 130. Highlighted in red colour for you.

The AFL Formula Editor doesn't have in-built indentation. It would have helped to code AFL a much easier, had it been present.

Praveen.
Thanks Praveen!

Best Regards,
--Ashish
 

Similar threads