This strategy should work fine in next API release. The release is scheduled this week.
If you don't want to wait, then you can modify your strategy a little by applying function NormalizeDouble to your stoploss values in Modify_SL_BY_Open() and it should fix the problem as well. Here is how Modify_SL_BY_Open() should look in this case:
void Modify_SL_BY_Open()
{
for(int i=0;i<OrdersTotal();i++)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
double StopLoss=OrderStopLoss();int ticket=OrderTicket();
double sar1= iSAR(0,0,0.02,0.2,0);
if(OrderSymbol()==Symbol()&&OrderMagicNumber()==MagicNumber)
{
if(OrderType()==OP_BUY)
{
if(StopLoss!=sar1&&Bid>sar1)
{
OrderModify(ticket,OrderOpenPrice(),NormalizeDouble(sar1, Digits),OrderTakeProfit(),0);
}
}
if(OrderType()==OP_SELL)
{
if(StopLoss!=sar1&&Ask<sar1)
{
double stoploss = sar1+MarketInfo(Symbol(),MODE_SPREAD)*Point;
OrderModify(ticket,OrderOpenPrice(), NormalizeDouble(stoploss, Digits),OrderTakeProfit(),0);
}
}
}
}
}