ParabolicSAR on a 14 minute time frame. (BarsArray[0])
Another PSAR on a Daily time frame. (BarsArray[1])
On the 15M time frame, on each bar update I move my stop loss and an enter a reverse equal to the daily PSAR as follows:
if (Position.MarketPosition == MarketPosition.Long)
{
SetStopLoss(CalculationMode.Price, ParabolicSAR(BarsArray[1],0.02,0.02,0.2)[0]);
EnterShortStop(DefaultQuantity, ParabolicSAR(BarsArray[1],0.02,0.02,0.2)[0]);
}
The problem I encounter is when the PSAR switches between long/short and the PSAR value ends up opposite than my logic intends - resulting in a the placement of a stoploss and then shortstop above my current price. (or visversa for shorts).
Can you suggest how I can move the stoploss and short/longstop based on the daily PSAR while running in 15M?
Comment