| / | Forum |
|
Vendetta
2010.08.24 10:02
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 |
|
Secrets of MetaTrader 4 Client Terminal 21 way to ease the life: Latent features in MetaTrader 4 Client Terminal. Full screen; hot keys; Fast Navigation bar; minimizing windows; favorites; traffic reduction; disabling of news; symbol sets; Market Watch; templates for testing and independent charts; profiles; crosshair; electronic ruler; barwise chart paging; account history in the chart; types of pending orders; modifying of StopLoss and TakeProfit; undo deletion; chart print. |
|
phy
2010.08.24 10:42
Use OrderSend() ten times. |
|
Vendetta
2010.08.24 10:58
sry to ask such stupidity but you meat 10x the same function ? or just OrderSend(10),... ? thx a lot ...V
|
|
phy
2010.08.24 11:04
Execute the command OrderSend() with appropriate parameters one time for each position you want to create. |
|
Vendetta
2010.08.24 11:26
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
|
|
hansH
2010.08.24 17:43
Vendetta:
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. |
|
chrisbenjy
2010.08.24 18:59
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 |
|
Vendetta
2010.08.24 23:21
Thx all of you guys,... i have learned again sth new new. Thx a lot ... V
|
|
Vendetta
2010.08.24 23:55
Another rebus for me,... (not for you ) is how to code these beast to open positions after 5 ticks,... thx a lot for help ...V
|