algorithmic trading - How to setup a period of time in an MQL4 source code? -
i using mql4.
currently, using [expert advisor]-s in mt4.strategytester, , set period-of-time build-in pull-down calendar gui-elements.
what want setup period-of-time straight in mql4-source code.
if realized, example, can compare result
'from 2011/01-to 2011/12'
to
'from 2012/01-to 2012/12'
and on.
there easy solution requirement, added value automated, large-scale hyper-parameter optimisations inside said mt4.strategytester tool, using proposed pair of parameters ( astartfromdate
, aruntilldate
) as iterable tuple, harnessed tradingstrategy robustness cross-validations of release-candidates on sweeping/sliding calendar window-of-time.
extern datetime astartfromdate = d'2010.01.01 00:00'; extern datetime aruntilldate = d'2345.01.01 00:00'; void ontick(){ if ( time < astartfromdate || time > aruntilldate ){ ignoreticksoutsidethegivenperiodoftime(); return; } // sure inside given ( mt4.strategy/tester iterable ) period of time ... .. . } void ignoreticksoutsidethegivenperiodoftime(){ // ignore, still may execute utility service during void run }
be careful on different scopes of syntax support:
one might cautious on use-cases, include strategytester restrictions of powerful new-syntax-constructors:
a printformat()
being 1 of such un-supported pieces inside strategytester during hyper-parameter optimisations.
printformat()
function not work during optimization in strategy tester.
Comments
Post a Comment