TimeFrameSet and Expand - Rolling values

Hi,

Needed some help, i have been working on the TimeFrameSet and Expand features. Is there a way to get the rolling data?

For instance,
If i am on a 5min chart, and looking at 15min timeframe data. Simple sample code below:

TimeFrameSet(in15Minute);
H_15 = H;
L_15 = L;
TimeFrameRestore();

H_5 = TimeFrameExpand(H_15,in15Minute);
L_5 = TimeFrameExpand(L_15,in15Minute);

At 10.15 - the data shown is the High and Low between 10 and 10.15
At 10.20 - the data still shows the high and low between 10 and 10.15 ( This changes only at 10.30)

What I want to achieve:

At 10.15 : show high and low between 10 and 10.15
At 10.20 : show high and low between 10.05 and 10.20 and so on.

Essentially a rolling method.

I am aware that just H and L can be achieved by using functions like HHV and LLV, but my end goal is to get rolling ATR on a 15 min timeframe from a Foreign symbol. I am currently using the following code to achieve the same, but it doesnt do it on a rolling basis:

SetForeign(symbol + expiry_final + StrFormat("%.0f",(StaticVarGet(strategy_name + "pe_strike"))) + PE);
pe_price = C;
TimeFrameSet(in15Minute);
nATR_pe_15 = Wilders(ATR(1),lenATR);
pAvg_pe_15 = Ref((H+L) / 2,0);
RestorePriceArrays();

nATR_pe = TimeFrameExpand(nATR_pe_15,in15Minute);
pAvg_pe = TimeFrameExpand(pAvg_pe_15,in15Minute);

Any help will be appreciated, please let me know if there is any other information that I need to add.

Thanks
Siddhant Kankani

No, using TimeFrame functions you either expand first or expand last (begin or end point of interval).

If you want to perform your own compression using own rules you have to define data points you want to use in your code and then use SparseCompress and SparseExpand functions
https://www.amibroker.com/f?sparsecompress
https://www.amibroker.com/f?sparsexpand

Note that you can also use HHV to get rolling High and LLV to get rolling Low without actually compressing anything.

Perfect, exactly what I was looking at.
Thanks much @Tomasz