Hi all,
Below is code for a system that I'm using, however, I want to
introduce a Fixed Stop Loss. To be fixed on the Entry Signal day.
Problem is, I do not have the faintest idea how to do it.
As written, the value works like a trailing stop loss. I suspect it
may need a loop. But my AFL skills still need a lot of improving I'm
afraid. It would be great if someone could point me in the right
direction.
Cheers
Ian
/*Liquidity..........*/
MinTo=2000000;
LastDay=2000000;
MinPrice=.40;
TurnOv=MA(C,21)*MA(V,21)>MinTo AND V*C>Lastday AND
C>Minprice;
//Entry Signal
TrendMA=MA(C,20);//Trend moving average
EnSig=C>TrendMA;//Entry signal - Buy triggered on confirmation
//Fixed Stop Loss
//FXLbak=2;
//FXStop=L<Ref(LLV(L,FXLbak),-1);// Fixed Stop Loss - Fixed from
Entry
Signal day
// Sell Signal
LBak=20;// Lookback periods
ExSig=L<Ref(LLV(L,LBak),-1);// Exit signal - Sell on confirmation
Buy=TurnOv AND EnSig;
Sell=ExSig;
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);