Looks to me like you have a four (4) second trade timeout (no reply from the server). That is quite small, Connection timeout is ≈30. You might try:
- Pinging or Trace route to the server to see if you have network problems.
- An initial delay on the first tick (there is a lot of chart update traffic before).
- Talking with your broker. Should the timeout be enlarged, do they have overloading?
Looks to me like you have a four (4) second trade timeout (no reply from the server). That is quite small, Connection timeout is ≈30. You might try:
- Pinging or Trace route to the server to see if you have network problems.
- An initial delay on the first tick (there is a lot of chart update traffic before).
- Talking with your broker. Should the timeout be enlarged, do they have overloading?
Thanks for the response William.
0 15:14:43.704 '986188': pending order buy limit 0.01 USDCAD.p at 1.28000 sl: 1.27350 tp: 1.29700 0 15:14:43.838 '986188': order was opened : #25055088 buy limit 0.01 USDCAD.p at 1.28000 sl: 1.27350 tp: 1.29700 0 15:14:47.703 '986188': pending order buy limit 0.01 USDCAD.p at 1.28000 sl: 1.27350 tp: 1.29700 0 15:14:51.701 '986188': pending order buy limit 0.01 USDCAD.p at 1.28000 sl: 1.27350 tp: 1.29700 0 15:14:55.235 '986188': pending order buy limit 0.01 USDCAD.p at 1.28000 sl: 1.27350 tp: 1.29700
The last 3 entries here is me trying to initiate the trade via the EA (which is done by a button click). The first entry is the successful order creation. If I wait longer, nothing is output in the Journal (and the "result is unknown" message appears pretty much instantly in my logs). Is this why it seems like there is a 4 second trade timeout?
- I'll investigate the connection problems a bit more, but it shouldn't be the case as the connection status indicator in the bottom right corner of MT is not showing any signs of problems and I'm also constantly getting the price data correctly.
- Can you please clarify how I could implement the delay on the first tick? What usually happens in the EA is that a button is clicked at any time (could be immediately after the EA start, but could be after a minute or more), at which point I start executing OrderSend.
- This happens with several brokers and both on Demo and Live accounts.
-
If you have a net problem, the automatic resend will hide the “showing any signs.”
-
When in doubt, think:
bool isFirstTick; void OnInit(){ isFirstTick=true; … } void OnTick(){ if(isFirstTick){ isFirstTick=false; sleep(10); } ⋮ }
-
Several different brokers sounds like your network/your hardware.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi everyone,
I'm experiencing a pretty strange problem when trying to execute an OrderSend function using my EA (which is a web app running inside a browser component in MT4).
Most of the time the EA is used to set Pending Orders, but Market/Exchange Execution orders are also supported.
To get the problem I have to follow the procedure below:
This is the code responsible for executing OrderSend:
Here are the strange things about this problem:
Here is some output from my logs that shows that I'm trying to create orders with exactly the same parameters, and sometimes they work, and sometimes not, without any obvious reasons.
Here's also the output from MT4 Journal log that corresponds to the above. During the unsuccessful runs, I am trying to submit the order with the same parameters, but there is no response received in the Journal.
Any help is greatly appreciated.
If I can provide any more information - let me know.