Errors, bugs, questions - page 2067

 
Kirill Belousov:

Then we get error 4108 beginning with iteration 2. And the OrderCloseTime!=0 condition fails to exit

By analogy

Forum on trading, automated trading systems and strategy testing

CPositionInfo - is the information up to date or at the time of entering the cycle?

fxsaber, 2017.11.06 07:47

PositionGet always returns information at the time of the last call to one of the four functions
PositionSelectByTicket
PositionGetSymbol
PositionSelect
PositionGetTicket

That means the position may not have existed for a long time and PositionGet will keep the old info.


There is a read-only internal Position-structure, whose fields are read via the regular PositionGet functions. It would probably be convenient to have _Position, similar to _Symbol, _LastError, etc.

 
fxsaber:

Thank you! Thought there was a ready-made solution, where the clock skins can be changed once/twice.

I understand myself that it's not technically difficult to implement. It's just that Market was unpleasantly surprised once again.

On moderation at the QB.

 
fxsaber:

By analogy.

Thank you. The need to update the information on the selected ticket is clear.

There is still a question with error 3.

The ticket has just been selected, an attempt to close it on iteration 1 failed with error 3 and yet the order closed.

How can this behaviour be explained?

 
Kirill Belousov:

How can this behaviour be explained?

Without playback data, it is difficult to answer.

 
Kirill Belousov:

There is still a question with error 3.

The ticket has just been selected, an attempted close on iteration 1 occurred with error 3 and yet the order closed.

How can this behaviour be explained?

There was no SL/TP on the position?

I don't remember a position being closed after error #3.

 
Andrey Khatimlianskii:

Did the position have a SL/TP?

I don't remember a position being closed after error #3.

Positions were without SL/TP
 

I was making an EA and after the next compilation it says

can't open "C:\Users\vipma\AppData\Roaming\MetaQuotes\Terminal\908CDDF6DDEF089609CFD48700109B47\MQL5\include\Trade\Trade.mqh"

opened the include folder and it was empty... I don't know where and why it disappeared (!)

i think i will install a second MT5 and copy the folder from it
I downloaded and started to install and it asks for a login and password from a proxy server
I don't use proxy servers.

How do I install the terminal?)

MT5x64b1653 __ W10x64 __ Avast Free Antivirus


 
 
 
Kirill Belousov:
Positions were without SL/TP

Put out the logs, it will make more sense. Both the EA and the terminal.