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
Put a delay - yes, I accept, how many lines of code would it take to do that? And if it's a multi-currency, it needs to account for the delay on each one, doesn't it?
I wrote the code that solves this. Only I don't like it, just as, sorry, I don't like yours. And it's not about bias, the point is that there are no other options, simple and elegant.
I've got two lines on the multicurrency in the block for the trade request. That's it... If you need to open an order, check whether the current time is not more than the cut-off time. There is nothing more elegant, and both are absolutely reliable...
Put a delay - yes, I accept, how many lines of code would it take to do that? And if it's a multi-currency, it needs to account for the delay on each one, doesn't it?
I wrote the code that solves this. Only I don't like it, just as, sorry, I don't like yours. It's not a matter of bias, the point is that there are no other simple and elegant solutions.
Delay is not our method))
1. We should memorize the number of positions(or orders) into a variable (static or global) before we make a trade operation.
2. In case of non-execution, the variable=-1;
In the case of successful execution, we wait, do nothing, and check on every tick until the number of positions (or orders) is equal to the variable.
3. When it is not equal - variable=-1;
Delay is not our method))
1. Before a trade operation, store in a variable (static or global) the number of positions(or orders)
Delay is not our method))
1. Before a trade operation, we save the number of positions(or orders) into a variable (static or global)
2. In the case of non-execution - variable=-1;
In the case of successful execution, we wait, do nothing, and check on every tick until the number of positions (or orders) is equal to the variable.
3. As soon as it is no longer equal, variable=-1;
Not a method - only for pips, but for medium-term trading it's OK. Otherwise, we risk running into
10024
TRADE_RETCODE_TOO_MANY_REQUESTS
Too frequent requests
with possible prohibition to trade the Expert Advisor.
Is it open? The position is the same for each instrument.... You cannot fill or partially close it... the amount will be the same. And it is not acceptable to re-calculate the number of orders in the history... you don't know where they may come from...
Yeah, I know) we should write in a variable what should be changed as a result of OrderSend().
If you close completely/(or open a new one) it will change the total number of poses (although, yes, it is enough, and it seems more reliable, and is/is not a pose by symbol to remember). It may also remember the volume, and it will work when adding/removing positions.
When setting/removing a pending order - the number of orders (can be calculated using the symbol).
In general: a little imagination and adding just one variable, per type of trade operation, will make your code more reliable, simple and elegant :)
Not a method - only for pips, but for medium-term trading - a normal method. Otherwise we risk to run into
10024
TRADE_RETCODE_TOO_MANY_REQUESTS
Too frequent requests
Otherwise we risk to be banned from trading the Expert Advisor.
that's a little different, it was like this in 4:
ERR_TOO_MANY_REQUESTS 141 Too many requests. You need to reduce the frequency of requests and change the program logic.
You have to try very hard to get this error, or you may have an account in a smart brokerage company :)
Slip is a normal method for some errors, in other cases it looks a little bit crooked.
it's a bit different, it was like that in 4:
you have to try really hard to make that mistake, or have a dodgy DC account :)
Slip is a normal method for some errors, in other cases it looks a bit crooked.
I don't know.
Here, it even says in the terminal manual:
I don't know...
Here, it even says in the terminal manual:
That's not what I mean :)
Vladix:
Generally speaking, the problem is this:
a tick comes, the indicator shows that it needs to close, I close
the next tick comes, the indicator shows that it should close and I do not know what to do - the position is already overwritten and what happens to it at the moment, of course, can be found out, but via the fifth point.In this case, you just need to determine that the position information was updated, without using the fifth point, preferably)
Developers.
In MQL help, there is no ENUM_CHART_VOLUME_MODE in Index tab. Add it...
In general: a little imagination and the addition of just one variable, per trade operation type, will make your code more robust, simple and elegant :)
So, fantasize exactly what code the man needs that would be 10 lines long and reliable, like mine, and that he would like it :)
And speaking of elegance you suggest to make a pile with unclear logic from two lines that are absolutely and logically fulfilling the task you're asking...
Delay is not our method))
In the case of execution we wait... ...3. yak not equal...
And wait for how long? Doesn't that count as a delay? And if it never becomes "not equal"? And we're waiting by the weather... A trade request can easily return a troue and not actually be fulfilled...