OrderSelect(MODE_HISTORY is limited to what is listed in Account history tab???

To add comments, please log in or register
Iggy
474
Iggy  

Discovered a funny quirk in OrderSelect function with MODE_HISTORY.

It only selects whatever is listed currently in 'Account History' tab. So if you limit your account history tab to say 'TODAY', that's all you going to get in OrderSelect function. It seems all the other history is inaccessible unless you change 'Account History' tab back to 'All History'.

Can somebody verify that I am not dreaming.

Thank you.

cloudbreaker
1574
cloudbreaker  

That is not the case. I have managed to select orders which are previous to what is currently displayed in the tab.


CB

gordon
2325
gordon  
cloudbreaker:

That is not the case. I have managed to select orders which are previous to what is currently displayed in the tab.


CB

Are you sure? OrdersHistoryTotal() returns the number of history items in the current history tab (which depends on the user settings). That doesn't make sense?


I had some related questions in the past that did not get answered, so I'll ask them again if you don't mind (form this thread: https://www.mql5.com/en/forum/122847):

gordon 2009.12.27 17:06

Besides the 6 basic trade operations as detailed here https://docs.mql4.com/constants/trading, I've noticed that when selecting from the history pool, there are also: type 6 which is a 'balance' line and type 7 which is a 'credit' line.


Questions:

1. Where is this documented? I simply can't find it anywhere.

2. Are there any other types or are the possible types only 0-7?

3. I have noticed that selecting from the history pool depends on user settings of how long a history to show... Is there some way to override this and read all history regardless of the user setting?

JC
1643
JC  
gordon:

Are you sure?

I'll second that. As far as I'm aware, filtering the account history affects what code sees as well as what's displayed on screen.

cloudbreaker
1574
cloudbreaker  

Apologies. Perhaps this has changed with some release since I had the issue.

My issue was:

- Quite some time ago my code I was reading through the order-history trying to match items with the current day's DayOfYear().

- I got a false positive with a match against an order for the same DayOfYear() but from the previous Year(), a criterion which I had not checked for (silly me).

- This previous order was not visible in the history tab until I unfiltered it.


CB

Iggy
474
Iggy  

So I understand cloudbreaker and jjc agree with me.

As far as Gordon's question: I believe there are certain UNDOCUMENTED codes that can be used.

Can stringo or someone address this issue. It might have UNDESIRABLE effect on some scripts/experts.

gordon
2325
gordon  
Well, I really hate the fact that it depends on the filter settings. I wish there was some way of deciding the filter settings via code. Don't know why they made it that way. It sucks.
JC
1643
JC  
gordon:
Don't know why they made it that way. It sucks.

Seconded, again. I've described this in the past as "a horrible design decision by Metaquotes" (https://www.mql5.com/en/forum/117038) and I stand by that.

cloudbreaker
1574
cloudbreaker  
jjc:

Seconded, again. I've described this in the past as "a horrible design decision by Metaquotes" (https://www.mql5.com/en/forum/117038) and I stand by that.

Totally agree. Takes Model-View-Controller architecture and throws it out the window. Can't believe anyone has actively architected this.


CB

Iggy
474
Iggy  
ditto, ditto, ditto
cloudbreaker
1574
cloudbreaker  

But I still maintain that it did once work properly for me in some particular build version. I'm positive that I was able to retrieve a historic record 1 year old, which was currently filtered out of the history tab.


CB

To add comments, please log in or register