Incorrect usage of TimeFrameSet/TimeFrameRestore()


I have an issue regarding using TimeFrameSet( inDaily ) while using Monthly as the original timeframe in the Backtester Settings dialog box. It's a fairly basic problem (I think) and I have searched the forums for something on this but it seems everything I find is related to using intraday and daily timeframes.

I execute the following steps:

  1. Run Exploration using the following code to generate daily ATRs normalised by the Close - ATR(50) / MA(C, 50) - for a handful of ETFs:

ATR Code

and run it in a workspace which uses Daily timeframe per Backtester Settings dialog box as per following screenshot:

Daily results obtained per following screenshot:

Daily ATR Values

  1. Run the exact same code as an Exploration in a workspace which uses Monthly timeframe per Backtester Settings dialog box as per following screenshot:

Results obtained per following screenshot:

Monthly ATR Values

Since I am using the exact same code for both Explorations, the only difference being the 'Daily' or 'Monthly' setting in the Backtester dialog box and the ATR calculation is surrounded by "TimeFrameSet( inDaily );" and "TimeFrameRestore();" I would have expected the output of both Explorations to be the same.

I'm sure it's a simple fix but if anyone knows what I'm doing wrong any help would be much appreciated!


You are getting different results because TimeFrame functions dont operate from higher TF like monthly on lower TF ie. Daily.
You cant fetch Daily/weekly etc data when periodicity is Monthly.

You are supposed to u work on an appropriate lower TF and then operate on Higher TF.

kindly read this in detail
Multiple Time Frame support (


This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.