Use OrderSend() ten times.
Execute the command OrderSend() with appropriate parameters one time for each position you want to create.
Im writing an expert advisor and i need it for correct functioning,... the code is not complete yet but i hope i will finish it with other functions,... pls will you be so kind and show me how to do that ? Im just a beginner and im coding 2 weeks,... Thank you very much for your help,... V
in your EA are some standard errors, which I have marked / / *****
---------------
best regards.
if you disregard the ticket number of each order and all the parameters are the same then just use a for loop with an order send function inside. I am sure if you are coding in MQL that you will know what a for loop is, but for other peoples reference I will show an example:
for(int i=0; i<10; i++) { int ticket = 0; ticket = OrderSend(Your parameters); //Change these to your parameters if(ticket<0) { Print("OrderSend failed with error #",GetLastError()); } }
Obviously, the above is very basic. If you plan to take your EA live then you need sufficient error handling.
If you work using ticket numbers like I do after following the advice that Derk Wheler gave in the comments of his LibOrderReliable library file, then it will be easier to just use order send 10 times and store the ticket number of each as a variable.
Chris
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Maybe it is too much primitive but can somebody help me to code,.. how to open 10 positions in expert advisor in one direction with just one signal ?
thx a lot ......V