Please how to find the day of month
-
I've read all the posts on this and it's not clear. I want to filter out certain days of the month like day 19 by not including them in trading. Here is what I tried but didn't succeed, I don't know why?

Then I saw fxdreema's post (https://fxdreema.com/shared/iB1YvWgSb) but it goes over my head. So here I want to write a condition to exclude this day 19 - Am I on the right track? It doesn't work yet
https://fxdreema.com/shared/pfDjrmQY
Any help would be much appreciated. Also if the day of month could be put into an input variable too that would be awesome
-
You can get it like this: https://fxdreema.com/shared/9qnCuF8Pd condition block variable == 19 will give you the what you want
-
I'm not quite following you. I got the custom code, that makes sense. But how will I write that condition to exclude that day?
How would it be written below to do buy trades each day except day 19?
https://fxdreema.com/shared/d3Pkl8x1e -
Download and test that, in the comment on backtest you will see it displays the current day of the month number
-
Thanks I’ll take a look, maybe I can learn more from your book I just ordered. But still not clear how an example code could look to exclude days
-
@Julianrob
Add a condition: day_of_month!=19 -
Thanks @sktsec
But I really don't understand the mql4 language at all. How can I do this? I've got this:
https://fxdreema.com/shared/LDYu92WIb but the EA won't load. I really don't understand custom code -
@jstap Wouldn't the option selected on the first post do exactly what your custom code does?
-
@l-andorrà Maybe I sometimes prefer to use custom because it gives me a direct reference to what is happening. I also didn't test that to see what happened.
-
@Julianrob I do Somthing Like This https://fxdreema.com/shared/T0HAriLpd
-
Here is my version. It does the exact same as Vahab's solution. It's a step longer for your case but could be useful for different needs.
https://fxdreema.com/shared/5qSsLDfnd -
@Vahab-K Thankyou, you are genius, it works perfectly!

@JayPhillbrooks Yes, I believe this would work well too. Filtering out certain days of the month is very helpful for enhancing performance -
@jstap Ok. Thanks.