what error u get
i tested it in strategy tester but it did not work and my tp did not change
what must i do?
what's this function?
OrderModifyReliable
if it's same as this (https://www.mql5.com/en/forum/129425) you should get some error logs
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
hi
i want to change my orders tp when i want but i can't
what is my problem
these my codes
void change_tp()
{
int total=OrdersTotal();
if(total>0)
{
for(int pos=0;pos<total;pos++)
{
//if(OrderSelect(pos,SELECT_BY_POS,MODE_TRADES)==false)
//continue;
//else
{OrderSelect(pos,SELECT_BY_POS,MODE_TRADES);
if(OrderType()==OP_BUY)
if((Ask-OrderOpenPrice())>=30*Point)
OrderModifyReliable(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-120*Point,OrderOpenPrice()+0*Point,0,0);
else if(OrderType()==OP_SELL)
if((OrderOpenPrice()-Bid)>=30*Point)
OrderModifyReliable(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+120*Point,OrderOpenPrice()+2*Point,0,0);
}
}
}
return(0);
}