Errors, bugs, questions - page 2596

 

Transaction generation error (MqlTradeTransaction structure).

Replay error: Send first market order with the volume of 1 lot to Long, send second market order with the volume of 2 lots to Short.

Error in filling the field in the MqlTradeTransaction->position structure. The field is filled with the ticket of the previous position. When you continue trading using the orders that reverse the position, the given field displays a strange mishmash of the old and new position tickets.

I checked it on the Moscow Exchange with brokers: Otkritie and BKS. In the tester the error is also reproduced.

Screens of transactions illustrating the error on these transactions:

Otkrytie:

Opening

BCS:

BCS

Tester:

Tester

 
Francuz:

Transaction generation error (MqlTradeTransaction structure).

Replay error: Send first market order with the volume of 1 lot to Long, send second market order with the volume of 2 lots to Short.

Error in filling the field in the MqlTradeTransaction->position structure. The field is filled with the ticket of the previous position. When you continue trading using the orders that reverse the position, the given field displays a strange mishmash of the old and new position tickets.

I checked it on the Moscow Exchange with brokers: Otkritie and BKS. The error is reproduced in the tester too.

Screens of transactions illustrating the error on these transactions:

Otkrytie:

BCS:

Tester:


There is only one position in "netting" trade mode. During its lifetime its identifier (position id) does not change. The identifier is equal to the ticket of the very first order with which the position was opened.

 
I am aware of that. But in a "flip", the previous position is closed and a new position (with a new ticket) is opened in the opposite direction. Which is reflected in these transactions with an error.
 
Francuz:
I am aware of that. But when you "flip" a previous position is closed, and a new position (with a new ticker) in the opposite direction is opened. Which in these transactions is reflected with an error.

It doesn't close. You can roll over in the Terminal for months and the Terminal will assume there was only one position. And the trading history will show only one entry for months in the closed positions display mode.

 
Good afternoon. I want to debug my EA on historical data. But the debugger runs MovingAverage.ex5, not my EA. how can I fix it? Debugging on real data will run my EA.
 
Azamat Mullayanov:
Good day. I want to run debugging of my EA on historical data. But it likes to run MovingAverage.ex5, not my EA. I want to debug on real data and it will run my EA.

Describe step by step (with screenshots) exactly what you do and where you click.

 
Azamat Mullayanov:
Afternoon. I want to do debugging of my EA on historical data. But the debugger runs MovingAverage.ex5, not my EA. I want to debug on real data and it's not my EA.

The advisor may not be in the Experts folder. In the Scripts folder, for example.

 
Vladimir Karputov:

Describe step by step (with screenshots) exactly what you do and where you click.

Sorry. I spent half a day poking around, but as soon as I posted it on the forum, it started working right away. I saved it in \MQL5\Experts\My directory and the debugger started working properly. I copied it back to \MQL5\Experts\My - the debugger works.
 
fxsaber:

It doesn't close. You can roll over in the Terminal for months and the Terminal will assume that there was only one position. And the trading history will only show one entry for months in the closed positions display mode.

You are wrong. When you flip a position the ticket of the active position is changed to another one. And the terminal displays it correctly. But in transactions it gives wrong information.

 
Francuz:

You are wrong. When a position is reversed, the ticket of the active position changes to a different one. And the terminal displays this correctly. But it gives wrong information in transactions.

POSITION_TICKET changes, POSITION_ID does not.

Reason: