Based on what was written above, I ended up using the absolute value between SL price and close price in order to get any possible slipage.
bool closebysl=false;
for(int i=OrdersHistoryTotal()-1; i>=0; i--) //Cycles through the orders starting from the most recent one
{
OrderSelect(i, SELECT_BY_POS, MODE_HISTORY);
if(OrderMagicNumber() == magicNB) //Determines if this order was on this MagicNb
{
i=-1; //Kills the for loopif(MathAbs(OrderClosePrice()-OrderStopLoss())<0.00004) closebysl=true; //Here I take 4 points but this could easily be 1 pip (0.00010)break;
}
}
Brokers can change comments, including complete replacement. They can also not do anything with them so the above is bogus.
orBased on what was written above, I ended up using the absolute value between SL price and close price in order to get any possible slipage.