Hi, I tried converting a strategy to AFL, but not sure if my assumptions are correct.
The result is that when the condition is met, the bot most only take LONG POSITIONS, and ignore any short signals.
Original code
lrs = 1000*FUNCTIONS.LRS(close,0,LRSP)/(FUNCTIONS.SMA(close,LRSP))
if lrs > LRSL
.......Longonly (basically, ignores any SHORT signal as long as **lrs>LRSL**)
AFL version
[... buying/selling conditions....]
LRSP optimize(""""")
LRSL optimize(""""")
lrs = 1000 * LinRegSlope(Close, LRSP)/MA(Close, LRSP);
bullmode = tc1 AND bc1 AND bc2 AND bc3;
bearmode = tc1 AND sc1 AND sc2 AND sc3;
IIf (lrs > LRSL, bullmode, bearmode);
Cover = bullmode;
Short = bearmode;
Buy = Cover;
Sell = Short;
are my assumptions correct?