The great and terrible MT4 forever (or how to strategise a transition) - page 15
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
No, the last record of trading activity is in the second log.
And this is correct in terms of priority:
Here I have reverted to the option without prints and again there is one position left after execution. It turns out that you need to hold some kind of pause after the trades are executed. Man, what a crutch.
Well, who's going to update it? ))
but when there is an open position - the script closes it and does not do anything else
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
also if i try to open a position the script closes it instantly
managed to write IsSynchronized(). The code is a bit heavy. I haven't decided yet in what form to post it.
How does it work? It is sort of found but sort of absent? What is the gist or principle of the solution?
But when there is an open position, the script closes it and does nothing else.
Not all servers will reproduce the opening of two positions. In your case, it is the third side (one side - two positions, the other - one position).
And that's about right in terms of sequencing:
Forum on trading, automated trading systems and trading strategy testing
The Great and Powerful MT4 Forever (or how to choose migration strategy)
Ihor Herasko, 2021.05.05 09:35
And it's all right here in terms of ordering:
The highlighted lines confirm the sequence.
PositionsTotal = 1 - sends an order to close.
The closing takes place after the script execution is completed. Print-cache is a bit distorted.
How so? It's sort of found but sort of not there?
I haven't gotten around to posting it yet. I will post it within 24 hours.
What is the essence or principle of the solution?
It analyzes the correspondence of the trading history to the current trading environment. In this case, there are no slows.
It also checks Result.order.
As a result, the use is as follows: IsSync() returns false - the trading environment in the Terminal is crooked, otherwise we can proceed as usual.
Added prints. Now two positions remain, as expected:
Result:
Add Trade.ResultRetcodeDescription()
Also ResultDeal / ResultOrder / ResultComment and Order.State
Surely there will be an answer there
StateAdd Trade.ResultRetcodeDescription()
And also ResultDeal / ResultOrder / ResultComment and Order.State
Surely there will be an answer there
StateDone:
Result:
Add Trade.ResultRetcodeDescription()
And also ResultDeal / ResultOrder / ResultComment and Order.State
Surely there will be an answer there.
StateThis is definitely not the case as the condition for sending a market order to open a position is PositionsTotal == OrdersTotal == 0.