While using the Strategy Analyzer I noticed that my StopLoss and Profit Target are not being enforeced. I used a custom method to set them, see below
Using print statements I can see that they are being calculated correctly and the stop is being adjusted to the breakeven level correctly later in the program.
However I am not stopped out when they are hit.
Any ideas what to look for?
private void GoLong()
{
SetProfitTarget("One Target Up", CalculationMode.Price, Close[0]+targ*TickSize);
SetStopLoss("One Target", CalculationMode.Price, Close[0]-(stopset*TickSize) , false);
stoploss=Close[0]-stopset;
EnterLong(Num,"Long Entry");
DrawTriangleUp("My triangle up" + CurrentBar, false, 0, High[0] + 4 * TickSize, Color.Lime);
Print(" Stoploss is " + stoploss.ToString());
}
Mike

Comment