Afl Basic.........Use for all

#1
Here i present some basic afl code those usefull for all other member if you have any other code like these so please share.....

If your afl show buy sell signal but when back test no result found so simple copy and paste belove code in your afl and enjoy backtest rezult.

Cover = Buy ;
Short = Sell;

If your afl have buy sell condition but not show arrow so simple copy and paste belove code in your afl and enjoy buy sell arrow...

PlotShapes(IIf( Sell, shapeDownArrow , shapeNone), colorWhite,0, Offset=Null) ;
PlotShapes(IIf( Buy , shapeUpArrow , shapeNone), colorWhite,0, Offset=Null) ;


If your afl show continuous buy sell signal and you want only one signal if buy and one signal when sell so simple copy and paste belove code in your afl and enjoy.....


Buy = ExRem( Buy, Sell );
Sell = ExRem( Sell, Buy );

If you backtest any afl code many time backtest result show cumulative profit but its not single lot profit so simple copy and paste belove code in your afl and you find single lot profit ...........

Setpositionsize(1,spsshares);


Other member if you have any other some code like these so please share ..........


Thakns Traderji....
 

ocil

Well-Known Member
#3
If Anyone wants to exit trade intraday use below code.

Exit = 151500;
Sell= TimeNum() >= Exit ;
Cover= TimeNum() >= Exit;

If you want to see last candle closing price use below code

PlotText(" "+LastValue(C),BarCount,LastValue(C),1);
 

Similar threads