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
Omg. So sleep doesn't help?
It helped for me. I used snelle_modas tip plus the sleep. That worked out.
But since then I revamped the way trades are opened. Now I don't need neither of these solutions. Here is what I wrote to angevoyageur yesterday. I hope it helps:
Hi,
well last time I solved it, was using sleep function after trade. But with my new bot this is not needed anymore. Maybe that is because opening a trade is now handled differently. This first bot I had this problem with (maybe other EAs also had this way of opening a trade and that's why had the problem too (e.g. metaquant)) used this method:
Now I'm opening orders like I have learned from the documentation and don't have this problem anymore:
Maybe this helps. I see that doshur uses a similar way top open trades like I did when it caused this behaviour.
Kind regardsSo there's a problem with ctrade class?
I can just say that I don't have this problem anymore after removing ctrade class.
You might want to create a second version of the EA that uses the "old fashioned" way of opening a trade and see if it helps.
On the other hand, sleep function did solve the problem for me too.
So there's a problem with ctrade class?
I can just say that I don't have this problem anymore after removing ctrade class.
You might want to create a second version of the EA that uses the "old fashioned" way of opening a trade and see if it helps.
On the other hand, sleep function did solve the problem for me too.
This is an interesting point.
I use the ctrade class for adjusting the stoploss value.
The opening of the position itself is done by using the "old fashioned" way.
Is it possible that the ctrade class is sending in a new double order when I'm adjusting the stoploss order? It seems strange.
I can just say that I don't have this problem anymore after removing ctrade class.
You might want to create a second version of the EA that uses the "old fashioned" way of opening a trade and see if it helps.
On the other hand, sleep function did solve the problem for me too.
That's a good point. Maybe I should only use the change in the BID price.
A BAR on the chart is also based on the BID price?
For the trigger signal of my EA I'm only interested in the change of the price on which the 1 minute BAR is based.
can I ask if PositionSelect() checks client side or sever side?
I have a strong feeling that the problem is caused by the delay where server (broker side) is processing the request and not updated the client side that's why PositionSelect() runs again
I do strongly feel that there is no difference when we use cTrade vs MqlTradeRequest way and Sleep function should help delay everything to get our client side gets "updated" before PositionSelect() runs again causing a double entry. Checking from my journal tab, > 2013.12.20 08:35:00 Trades '800****': exchange buy 0.01 EURUSD at market placed for execution in 313 ms <
putting sleep more than 400 should be safe???
What do you think?
Snelle_moda do you still get double entry using mqltraderequest to send order?
I have had 1 more double entry since 03-10-2013. I use both methods for sending my order. See my previous post.