I have used the Print command to check the value of "PvtHigh" and "PvtLow" and it is indeed what it should be on each bar of the chart.
I have the following lines in my code:
if (Position.MarketPosition == MarketPosition.Short)
{
SetStopLoss("MomoSE1", CalculationMode.Price, PvtHigh, false);
SetStopLoss("MomoSE2", CalculationMode.Price, PvtHigh, false);
}
But as long as this line remains in the strategy my positions are exited on the same bar as they are entered on, and at the same price. This happens even though the high or low of that bar never touches the value held by the variable "PvtHigh" or "PvtLow".
If I comment out the line with the SetStopLoss command the position remains open until it exits via a technical stop.
Am I doing something wrong?
Thanks,
rsi77

Comment