Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Programmatic modification of tester "From:" and "To:" fields using user32.dll - MetaTrader 4 script

author EAcpu | 4 reads | 0 comments |

In order for this script to run correctly, you must open the Strategy Tester window.

My purpose in doing this is to create a distributed automated optimization package.
I am not satisfied with the available automatic optimization code because it requires modification of the Expert Advisor code.

This was created and tested on Windows 7 64-bit. You may need to change the #define statement to point to the correct ID for your operating system.

I cannot send a string directly to the date field because its control SysDateTimePick32 is difficult to interface with MQL4.

Instead, I used a slightly roundabout method of parsing the control's text and sending up, down, left, and right keystrokes to adjust the date.

I'm posting this script because I find it very time consuming to find the information needed to accomplish this (especially for a Windows API newbie like me). Hope this helps others.


Attachment download

📎 SetDate.mq4 (6.47 KB)

📎WinUser32.mqh (62.68 KB)

Source: MQL5 #10146

Verification code Refresh