hi everone i hope you have nice day i write code in mql4 that modify take profit with + 3pip for every 5 pip up for bay or down for sell the problem is that modify order work once and give me 130 error -------""2018.04.24 23:57:30.751 2018.03.13 00:00:00 test v1.5 EURUSD,H1: OrderModify error 130"-------------- i need someone to help write this code
void modify()
{
int num;
SymbolInfoTick(Symbol(),last_tick);
while(order == 0)
{
if (sl == 0)
{
OrderSelect(0,SELECT_BY_POS,MODE_TRADES);
sl = OrderOpenPrice();
type = OrderType();
if(type == OP_BUY)
OrderModify(OrderTicket(),OrderOpenPrice(),sl+0.0003,0,0,clrNONE);
elseOrderModify(OrderTicket(),OrderOpenPrice(),sl-0.0003,0,0,clrNONE);
}
bid = last_tick.bid;
ask = last_tick.ask;
if(sl != 0)
{
if(type == OP_BUY && sl + 0.0005 <= bid )
{
bool res;
sl= ask + 0.0003;
OrderSelect(0,SELECT_BY_POS,MODE_TRADES);
//if(sl + 0.0005 <= bid)
res =OrderModify(OrderTicket(),OrderOpenPrice(),sl,0,0,clrNONE);
if(!res)
{
Alert(GetLastError());
}
num ++;
Comment("whe are in :",type," num : ",num );
}
elseif (type == OP_SELL && sl - 0.0005 <= bid )
{
bool res;
sl=bid-0.0003;
OrderSelect(0,SELECT_BY_POS,MODE_TRADES);
res =OrderModify(OrderTicket(),OrderOpenPrice(),sl,0,0,clrNONE);
if(!res)
{
Alert(GetLastError());
}
num ++;
Comment("whe are in :",type," num : ",num );
}
order = OrdersTotal();
}
}
sl=0;
x=0;
}
hi everone i hope you have nice day i write code in mql4 that
modify take profit with + 3pip for every 5 pip up for bay or down for sell
the problem is that modify order work once and give me 130 error
-------""2018.04.24 23:57:30.751 2018.03.13 00:00:00 test v1.5 EURUSD,H1: OrderModify error 130"--------------
i need someone to help write this code