
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
Above taken from code: /*.....*/ are mixture of docs and forum notes...
Given above blurb:
Let's say max open+pending orders "...has reached the limit set by the broker." ref: ERR_TRADE_TOO_MANY_ORDERS (148)
So ok, error code is detected and flag set to inhibit further OrderSend()s until it is seen that less than broker limit, at this time another order could be considered.
However during the time that EA at this limit, the code continues to do other open trade maintenance duties each time start() called eg, monitoring/moving TPs and SLs etc.
You know... in cruise mode just dreaming about massive income while the orders do their thing and we just tweak around the edges via orderModify ;)
And that would seem where can come unstuck because OrderModify() closes original order and reopens new order with requested mods and issues new ticket#
(which has to be discovered by EA using magic#... nice one MT)
1)
If at this broker max value and then decide time to move SL on market order, modify issued.
Will the broker refuse this modify order or will broker allow?
Would seem all based on how modify implemented on server: is possible that will now go max+1 and that's not allowed according to docs.
2)
.Of course if 148 never likely to happen - can forget all of above (I think ;)
it goes without saying that am inferring that a well behaved EA would qualify for the "never likely to happen" wording simply due to never issuing massive number of open,pending orders.
But that is not a solution - just a fingers crossed kludge...
3)
how does one learn what is this maximum limit set by broker?
IF there is such a datum THEN is easy to build code around this knowledge and have happy error handler function and start() too, yes?
ELSE seems back into the usual guessing game again regards error handling.
All comments valued
:o)
Regards