The Time Filter Block does not work correctly
-
Hello @fxDreema! You all right?
It is not respecting the block in the day parameter. See below:https://fxdreema.com/shared/pxNolBuhc
In this project example, I need it to open only on days 1, 2 and 3, as described in the parameter, but it has been open several days beyond projected.
-
I recommend to create a separate tree of blocks for those defining the active time period. I mean all three time filters and the conditions below them. Then you create a boolean variable that is active only when any of the time filters is true and then changed to false afterwards. That way you can condition your launching tree with that same variable on top.
-
@l-andorrà said in The Time Filter Block does not work correctly:
I recommend to create a separate tree of blocks for those defining the active time period. I mean all three time filters and the conditions below them. Then you create a boolean variable that is active only when any of the time filters is true and then changed to false afterwards. That way you can condition your launching tree with that same variable on top.
You might also work with flags.
-
@l-andorrà Yes. I already do it this way, but if the Time Filter block is not working correctly, it is better to fix it.
-
@trader-philipps I still don't know how to use a flag. Any post for instructions?
-
@tcanuto Check my Tutorial EA. I use some boolean flags as well as switch ON/OFF blocks in there.
One example is the CoF feature. On the init tab I read the values from the constants and set bool flags accordingly

The on the on Tick tab I check the flag.

Of course this example is for generally switch on/off parts of the code by EA parameters. But it may give you an idea.
I like the bool flags. However, you might use the numeric (if more than 1 option) or string (never used) type as well.