I set the original Stop in the OnExecution portion of my code, then manually trail it down (Short Trade) but the order rejects and the log says I am placing a stop bellow the code.
The issue is the close is bellow my stop by about 1.8 ATR. Why would this error through. Here is the code snip:
if(Position.MarketPosition == MarketPosition.Short)
{
if(exitShortStop == null) Print("Danger");
RiskS[0] = sMIN(ATRHigh,myBarsSinceEntry)[1];
DrawLine(CurrentBar.ToString()+"SStop",false,0,RiskS[0],1,RiskS[0],Color.Red,DashStyle.Solid,1);
if( exitShortStop != null && RiskS[1] > RiskS[0] && Close[0]+(5*TickSize) < RiskS[0])
{
// CancelOrder(exitShortStop);
exitShortStop = ExitShortStop(0,true,SStopQty, RiskS[0], "ATRStopS", "S20");
}
else RiskS[0] = ATRHigh[1];
}
Sody

Comment