Learning about Order processing - Indicator displays total profit/loss for past 24 hours.
MisterDog: Here is the code -- comments please...
"All History" in your terminal window! There may be a way to do this programmatically
#include <WinUser32.mqh> #import "user32.dll" int GetAncestor(int, int); #import void EnableAllHistory(){ #define GA_ROOT 2 // https://forum.mql4.com/ru/14463/page5#401551 #define MT4_WMCMD_ALL_HISTORY 33058 int main = GetAncestor(WindowHandle(Symbol(), Period()), GA_ROOT); PostMessageA(main, WM_COMMAND, MT4_WMCMD_ALL_HISTORY, 0); }
WHRoeder:
Thanks, I never would have come up with this on my own.
Hi All, I wanted to learn more about order selection and processing so I wrote this indicator. It displays the profit or loss of the past 24 hours (or whatever time period you like). Two areas for improvement are: it should run each time an order closes rather than when each bar closes. It should programmatically select "All History" in the Terminal. Note: OrderSelect will only look for the range of orders filtered in the Terminal window.
Here is the code -- comments please...