How to define base time frame in AFL code

Hi

I am new to AFL and this site. I have been trying to code a very simple strategy in multiple time frames. Use hourly EMA and 15 minute RSI. Following is my code. While backtesting, I set Periodicity to 15 min in Settings and that becomes my base time frame. So, when I say TimeFrameRestore(), it resets time frame to 15 min. Is my understanding correct. If this is correct, then my backtesting works fine. My question is how would I control base time frame as 15 min when I am actually doing the trade and not backtesting. Thanks.

TimeFrameSet(inHourly);
SetUp = C  - EMA(C,30);
TimeFrameRestore();
ExpSetUp = TimeFrameExpand(SetUp, inHourly);
Buy = ExpSetUp > 0 AND RSI(12)<30;
Sell = RSI(12) > 70;
ApplyStop(0,1,2,1,False,1,0,-1);

If you are going to trade using chart, set chart periodicity to 15min, if you are going to trade using scan or explorer set Analysis periodocity to 15min

Thanks for your prompt response. really appreciated.

Is it possible to set periodicity via AFL code ?

I have many CBT scripts for different time-frames. It is a bit cumbersome to change the base time-frame by hand all the time.

Please search first!