Periodicity vs timeframeset


I have an explore code that i used to run in different periodicity settings and add results to excel to find tickers that match certain criteria in different periods.

Now i wanted to automate this process through afl.

I understand that timeframeset is not a replacement for periodicity (as stated by the documentation) and that i cannot control periodicity using afl, but is there anything else that i can use through my afl code that can allow me test for different periods on my code ?

I tried running the code using timeframeset on multiple frames i got wrong and different results than changing the periodicity manually and checking results.


Your claim is incorrect! TimeFrameSet works perfectly fine with different time frames.
And it does return same results as if changing periodicity's setting.

This TimeFrameSet... exploration code

tmfrm = inDaily;

if ( tmfrm % Max(1,Interval()) != 0 && Status( "actionex" ) != actionExEditVerifyFormula )
	Error( "Incorrect periodicity! 'tmfrm' has to be a multiple of periodicity." );

TimeFrameSet( tmfrm );
    myvar = RSI(15);
    LTF = Interval(2);

expandmode = expandFirst;
myvar = TimeFrameExpand( myvar, tmfrm, expandmode );

AddSummaryRows( 1, 1.5, 5 );

Filter = DateNum() != Ref(DateNum(), -1) and ! IsNull(myvar);
AddTextColumn( Interval(2), "Periodicity", 1 );
AddTextColumn( LTF, "TimeFrameSet Interval", 1 );
AddColumn( myvar, "RSI", 1.5 );

returns the very same results as using periodicity with this code:

AddSummaryRows( 1, 1.5, 4 );

myvar = RSI(15);

Filter = ! IsNull(myvar);
AddTextColumn( Interval(2), "Periodicity", 1 );
AddColumn( myvar, "RSI", 1.5 );

I am sorry but I do not think you know what you are talking about.
Pictures below prove it.

Using TimeFrameSet with several proper periodicity setting.





And now without using any TimeFrame* code:



Thank you for your quick response, may be i did something wrong. I will try again using your code.

What periodicity are you using in the backtester settings when you use timeframe set, is it correct to say that i should use the base interval of the database ? I see results don't change in your trial with changing periodicity.

C'mon, please look at the pictures carefully! There is periodicity column there already. So what do you think I have used? Obiously the ones that are shown in that column, right?

Sure they don't change because as I said TimeFrameSet...etc. just works.

1 Like

Thank you :slight_smile: