
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, it's not normal.
There is a position. We will throw the Expert Advisor to the chart. There is no deal history for the selected position. What is normal here?))
A position has been open for a few seconds and the number of trades is still zero?
Exactly.
Then it's very bad for anyone trading in MT5. How to reproduce?
The bug is not always and not immediately apparent. I tried it on a fibo demo account, build 1490
{
const int Total = PositionsTotal();
for (int i = 0; i < Total; i++)
{
const ulong Ticket = PositionGetTicket(i);
if (PositionSelectByTicket(Ticket) && HistorySelectByPosition(PositionGetInteger(POSITION_IDENTIFIER)) && (HistoryDealsTotal() == 0))
Alert(Ticket);
}
}
Can't reproduce.
{
const int Total = PositionsTotal();
for (int i = 0; i < Total; i++)
{
const ulong Ticket = PositionGetTicket(i);
if (PositionSelectByTicket(Ticket) && HistorySelectByPosition(PositionGetInteger(POSITION_IDENTIFIER)) && (HistoryDealsTotal() == 0))
Alert(Ticket);
}
}
Your position is selected differently. Try my code.
{
EventSetMillisecondTimer(1);
}
void OnTimer()
{
const int Total = PositionsTotal();
for (int i = 0; i < Total; i++)
if ((PositionGetSymbol(i) == _Symbol) && HistorySelectByPosition(PositionGetInteger(POSITION_IDENTIFIER)) && (HistoryDealsTotal() == 0))
Alert(PositionGetInteger(POSITION_TICKET));
}
And it's not playing.
{
EventSetMillisecondTimer(1);
}
void OnTimer()
{
const int Total = PositionsTotal();
for (int i = 0; i < Total; i++)
if ((PositionGetSymbol(i) == _Symbol) && HistorySelectByPosition(PositionGetInteger(POSITION_IDENTIFIER)) && (HistoryDealsTotal() == 0))
Alert(PositionGetInteger(POSITION_TICKET));
}
Have you tried my code?
To reproduce it in the same way and get the same logs.
Have you tried my code?
To reproduce it in the same way and get the same logs.
I tried - the problem is not reproduced.
Strange.... What could be the problem then?
Here. Doing this. Started the Expert Advisor on a chart. I opened a position manually. I have added a position twice and cut it once. It shows 4 trades correctly in lags. After that I reversed the position and got a problem: I have a position but no deals.
Here is the log after the last two operations.
2016.12.05 14:25:44.157 Get current commission of pos (GBPUSD,M5) 1
2016.12.05 14:25:44.157 Get current commission of pos (GBPUSD,M5) GBPUSD
2016.12.05 14:25:44.157 Get current commission of pos (GBPUSD,M5) Position found
2016.12.05 14:25:44.157 Get current commission of pos (GBPUSD,M5) Total trades in position: 4
2016.12.05 14:25:44.670 Get current commission of pos (GBPUSD,M5) 1
2016.12.05 14:25:44.670 Get current commission of pos (GBPUSD,M5) GBPUSD
2016.12.05 14:25:44.670 Get current commission of pos (GBPUSD,M5) Position found
2016.12.05 14:25:44.670 Get current commission of pos (GBPUSD,M5) Total trades in position: 0
It can be seen that no trades are seen in the position. EA is still hanging on the chart and there is 0 in the comment.
I removed the EA and reset it to the chart, it does not see trades of a position, the comment is 0.