- Laszlo Hermanovski: volatility is high there is a delay of 20 seconds between order open timesIt can take seconds to open an order. During news, it can takes minutes. Connection problems, more minutes.
- You have network delays (usually MS range,) but if you loose connection just before the send, it will take 30+ seconds for the timeout, reconnect, resend.
- Then you sit in the server queue, while it processes all older requests. Then it must check your account and free margin and if that passes, the current market value is the price you get. Normally only a fraction of a second, during news releases, this can take minutes and the market can move continuously.
SO_EURUSD=OrderSend("EURUSD",OP_SELL,…….,Bid,….,NULL,NULL,NULL,160001,clrRed); BO_GBPUSD=OrderSend("GBPUSD",OP_BUY,……,Ask,….,NULL,NULL,NULL,160001,clrNONE); BO_EURGBP=OrderSend("EURGBP",OP_BUY,….,Ask,….,NULL,NULL,NULL,160001,clrBlue);
When you post code please use the CODE button (Alt-S)! (For large amounts of code, attach it.) Please edit your (original) post.
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor-
Why did you post your MT4 question in the
Root /
MT5 EA section
instead of the
MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. - Bid and Ask are predefined variables for the current chart. You are asking to open a order using bad prices.
-
Check your return codes for errors, report them
and you would know why.
Don't just silence the compiler, it is trying to help you.
What are Function return values ? How do I use them ? - MQL4 and MetaTrader 4 - MQL4 programming forum
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
Only those functions that return a value (e.g. iClose, MarketInfo, etc.) must you call ResetLastError before in order to check after.
whroeder1:
Thank you for your detailed answer.
- It can take seconds to open an order. During news, it can takes
minutes. Connection problems, more minutes.
- You have network delays (usually MS range,) but if you loose connection just before the send, it will take 30+ seconds for the timeout, reconnect, resend.
- Then you sit in the server queue, while it processes all older requests. Then it must check your account and free margin and if that passes, the current market value is the price you get. Normally only a fraction of a second, during news releases, this can take minutes and the market can move continuously.
- When you post code please use the CODE button (Alt-S)!
(For large amounts of code, attach it.) Please edit your (original) post.
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor -
Why did you post your MT4 question in the
Root /
MT5 EA section
instead of the
MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. - Bid and Ask are predefined variables for the current chart. You are asking to open a order using bad prices.
-
Check your return codes for errors, report them
and you would know why.
Don't just silence the compiler, it is trying to help you.
What are Function return values ? How do I use them ? - MQL4 and MetaTrader 4 - MQL4 programming forum
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
Only those functions that return a value (e.g. iClose, MarketInfo, etc.) must you call ResetLastError before in order to check after.
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
I wrote an EA for MT4 that should open at the same time 3 trades for 3 different pairs. On demo account, when volatility is high there is a delay of 20 seconds between order open times, same happens for order close (orders should close at the same time)
There are no condutions that should introduce a delay.
Below the result:
131493512
2018.07.06 15:30:30
sell
0.01
eurusd
1.17375
0.00000
0.00000
2018.07.06 15:31:46
1.17354
0.00
0.00
0.00
0.83
131493697
2018.07.06 15:30:50
buy
0.01
gbpusd
1.32444
0.00000
0.00000
2018.07.06 15:31:59
1.32453
0.00
0.00
0.00
0.36
131493814
2018.07.06 15:31:09
buy
0.01
eurgbp
0.88594
0.00000
0.00000
2018.07.06 15:32:15
0.88598
0.00
0.00
0.00
0.21
20 seconds difference, and I can figure why. It happens all the time (of course sometimes are only 1 or 2 seconds difference, but still too much).
Has anybody any idea why?
Thank you in advance for your help.