I WANT TO WRITE AN EA that will place 5 buy pending orders above the present price
at 5 pips interval and 5 sell orders at same interval below the present price.
Anyone can help with the code please.
- Managing Pending Orders - Trade - MetaTrader 5 for iPhone
- Managing Pending Orders - Trade - MetaTrader 5 for Android
- Request Execution - Opening and Closing Positions - Trade - MetaTrader 5 for iPhone
double price, sl, tp; price = Ask + 5*Point; sl = ... tp = ... OrderSend(Symbol(), OP_BUYSTOP, ... price = Ask + 10*Point; sl = ... tp = ... OrderSend(Symbol(), OP_BUYSTOP, ... ...
I guess, the regular EA template should do this...when you say 5 orders, would they
have different S/L and profit targets? 'Cause if not, then you can just change
the number of lots instead..
But, if you want to have multiple orders...then in the EA, change the line that checks for openorders...
But, if you want to have multiple orders...then in the EA, change the line that checks for openorders...
Change 1 to 10 or whatever number of orders you wish to open...total=OrdersTotal(); if(total<1)
RICKD and MarathaThanks you very much for your answers, i have implemented this
and it is working. Now, if one of the orders is opened it has to cancel others
in the opposite directions. For example if the first buy order is open , then all
sell orders must be cancelled. Please tell me how to do that please.
![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