Hi,
I think there is a bug with orders buy_limit and sell_limit, causing an ordersend error 130.
Please replace :
if(Bid>NormalizeDouble(l_price_0,5))
{ticket4 = OrderSend(Symbol(), OP_SELL, CheckLotSize(l_lots_40), NormalizeDouble(Bid,5), 3, NormalizeDouble(l_price_8,5), NormalizeDouble(l_price_24,5), "Magic" + magic, magic, 0, Red);}
else{ticket4 = OrderSend(Symbol(), OP_SELLLIMIT, CheckLotSize(l_lots_40), NormalizeDouble(l_price_0,5), 3, NormalizeDouble(l_price_8,5), NormalizeDouble(l_price_24,5), "Magic" + magic, magic, 0, Red);}
and
if(Ask<NormalizeDouble(l_price_0,5)){ticket3 = OrderSend(Symbol(), OP_BUY, CheckLotSize(l_lots_40), NormalizeDouble(Ask,5), 3, NormalizeDouble(l_price_16,5), NormalizeDouble(l_price_32,5), "Magic" + magic, magic, 0, Blue);}
else{ticket3 = OrderSend(Symbol(), OP_BUYLIMIT, CheckLotSize(l_lots_40), NormalizeDouble(l_price_0,5), 3, NormalizeDouble(l_price_16,5), NormalizeDouble(l_price_32,5), "Magic" + magic, magic, 0, Blue);}
Best regards.