Filter for SPECIFIC days of the month?
-
I know you can use the weekday filter for specific days of the week but is there an option to chose specific days of the month, so I can customise it for the month and leave it, for example only trade on the 11th, 16th, 23rd and 25th.
-
@GTOAT777 well TimeCurrent() will get you something like 2015.01.01 00:00 - then you can transform it into a string with TimeToString() and then you can take a StringSubstr() to get only the date.
Maybe there is a simplier option too, but this should work.
-
@roar Thanks for you advice but I’m not sure what the () means
-
It signifies a function. Sometimes you need to put stuff inside the parenthesis, sometimes not, depending on function. But functions always need them to identify as functions instead of variables.
I will write a more detailed example in a custom mql code block, but you will have to troubleshoot it from there (using the Print() function for example)
datetime time = TimeCurrent(); string timestring = TimeToString(time); int day = (int) StringSubstr(timestring, 8, 10); Print(day); Print("Today is " + day + "th day of the month");