Discussion of article "Custom presentation of trading history and creation of report diagrams" - page 3

 
Andrey Azatskiy:

Try replacing the DealHistoryGetter.mqh file with the one attached to this post.

Only this error remains

2018.09.01 19:11:36.150 Get_TradingHistory (GAZR Splice,H1)     zero divide in 'DealHistoryGetter.mqh' (457,51)
 
Breakpoint at 451 and 461 and look through inputParam.deals[i].volume and the contracts array.

You have the contract volume set to zero for some reason. If I am right, there should be 2 iterations before this error. But if I'm right, I can't imagine why the contract volume could be equal to zero, it doesn't happen....
 
On line 460, at the first iteration, the very first contract is entered into the contracts array. On line 457, the last active contract is calculated from the contracts array using the method described in the article. With my stories that I ran, there were no such errors.
 
Andrey Azatskiy:
Breakpoint at 451 and 461 and look through inputParam.deals[i].volume and the contracts array.

You have the contract volume set to zero for some reason. If I am right, there should be 2 iterations before this error. But if I'm right, I can't imagine why the contract volume could be equal to zero, it doesn't happen....

I don't know how to use the debugger, I put points, ran it, but there are no errors there.

Maybe the point is that there are such operations in the history?


 

Also on line 407 it would be good to put a breakpoint. and look at the lotArr array.

I will not reproduce your problem because it is related to your trading history. My histories (the ones I ran through this class) did not produce such errors....

 
Andrey Azatskiy:

It would also be good to put a breakpoint on line 407. and look at the lotArr array.

I will not reproduce your problem because it is related to your trading history. My histories (the ones I ran through this class) did not produce such errors....

Did you test on a real account or on a demo account?

 
Perhaps there is a flaw in my class, but I can't reproduce it.... It's related to your history and, consequently, to your terminal and your trading account. Maybe there are some nuances in the analysis of the Me5 history that I missed when writing this class, but only you can reproduce it. I will have to figure out the debugger.
 
Aleksey Vyazmikin:

Did you test on a real account or on a demo account?

It's not about the account, it's about your history. The terminal generates history in the same way for both real and demo accounts.

 
Andrey Azatskiy:
Perhaps there is a flaw in my class, but I can't reproduce it.... It's related to your history and, consequently, to your terminal and your trading account. Maybe there are some nuances in the analysis of the Me5 history that I missed when writing this class, but only you can reproduce it. I will have to deal with the debugger.

If you write more specifically what and where to look and write, I will help you to find the error.

 
Andrey Azatskiy:

It's not about the account, it's about your history. The terminal generates history in the same way for both real and demo.

There are no corrections on the demo, the screenshot of which I have given above.

Every day starts with them.