CHANGING A CONDITION'S TIMEFRAME
-
https://fxdreema.com/shared/sJEUrTwCb
In the above example ,how can I change the timeframe from 15M to 30M when the variable output is false and loop back to 15M if the 30M variable output is false. -
Just an idea as I never define variable for TF before
- Set variable "TF" as string with initial value = M15
- Use "TF" in your Time Frame box instead
- set condition blocks after (connected with) BUY==False block with
1st block: "if TF = M15 then TF ==30"
2nd block: "if TF = M30 then TF ==15"
-
@Xeta50 Can you kindly share an example
-
Blocks under the required bool condition using the relevant TF, you just won't change the visual chart.
-
@jstap Just curious. What custom code would be required to change the chart timeframe the EA is working on?
-
@OD Please use this as a concept as the real blocks/usage will depend on your logic.
https://fxdreema.com/shared/sJEUrTwCb
However, if what you mean is to change the visual chart as @jstap mentioned then it is a completely different story and I will wait him to kindly explain as well.
-
This was easier than I thought it would be, add this to a chart with a TF different to 1hour, and the chart will change to 1hour: https://fxdreema.com/shared/I0euSX0Bd
-
Thanks for the suggestion but I want to change this time frame in the condition blocks -
@Xeta50 The example you have here is same as mine kindly elaborate your idea using that example I gave
-
@OD I don't know the algorithm and reason why I adjusted your shared project but it won't change on your side may be you need to clear your cache . Please refer to the below picture for the idea then.

-
@jstap wow, it's really cool to have this in a pocket.
Thank you for sharing !!!
-
@OD How do you want this to change this, Constant or another way?
-
@jstap Very interesting. Thank you,