Year filter
-
I would like to be able to change a timeframe variable when a certain year and month is reached during back testing and live trading.
Lets say I start my backtesting on 2010 to 2023 on the 1H time frame.
At 2016-03-01, I want to change the time frame to 4H.I'm using a variable in my condition for my time frame (ENUM_TIMEFRAMES)
Thanks

-
@Hellzer I don't see the logic behind that. What's the point of changing the TF in the middle of the backtest?
-
So when you do walkforward you can create a chart with only the walkforward result. Normally when you create an EA you should do WF analyzes when backtesting it. This increases the chance to not over fit your strategy and to have better and real result for future/real market.

-
Yes, I know the concept, but I don't get yet why you need the TF to be changed in the middle of the backtest process.
-
So when I backtest I can see the graph of every out of sample data all together instead of pulling out the info and making a graph in excel for example
-
Then that goes beyond my abilities, sorry. I cannot be of any help when doing those external data references, sorry. Maybe roar can help.
-
Ok, with playing a lot with it I have found a way to do it


Then you must attach those 3 blocks to the top of your project and change every time constant (ENUM_TIMEFRAMES) to current and it will work
-
Impressive! Does it work as expected?
-
Yes after a certain date in the backtest, I can see the number of trades increased because for example I set the time frame of the indicator lower or change the period to a lower number.
-
Interesting. Good for you.