samirgham:
i have an indicator [...]
i thought why not send order to close position??
Trading functions of OrderSend(), OrderClose, OrderCloseBy, OrderDelete, and OrderModify cannot be called from custom indicators.
See here -> https://docs.mql4.com/trading.
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 have an indicator that shows entry and exit points ( not accurate, but not bad), i want to open order manually, and let the indicator close the position.
if (madiff > 0.0 && rsi0>50 ) UP = 1;
else
if (madiff < 0.0 && rsi0<50 ) UP = 2;
Because after the signal can send email
i thought why not send order to close position??
i tried to enter after the signal ( if OrderType()==OP_SELL) OrderClose(OrderTicket(),0,Ask,3); OR if(OrderType()==OP_SELL) OrderClose(0,0,Ask,3); OR.....
they didn't work.
how can do that ?!!
Regards,
SG