Timeframe in Exploration

Hi Gurus ,

I am building an exploration where i have to get 15 min previous close bar value on a daily timeframe exploration .

my exploration is set on daily time frame .
I have tried
///code 1
prevbarclose = TimeFrameCompress(Ref(TimeFrameExpand(C,in15Minute,compresslast), -1), in15Minute, expandFirst);

also tried
// code2
TimeFrameSet(in15Minute);
Prevbarc= Ref(C,-1);
TimeFrameRestore();

Prevbarclose = TimeFrameExpand( Prevbarc, in15Minute);

also tried
//code3
Prevbarclose = TimeFrameGetPrice("C",in15Minute,-1);

I know I doing a blunder some where , all i am getting here is previous day close value but not 15 min previous close .

Please help ,
Baru

I got where i am wrong :slight_smile:

We can move from lower timeframe to higher but not the other way .

Thank you

As you eventually read and realized yourself:
If using time frame functions you have do it the other way around.
In your case: Getting Daily timeframe data (and 15 min data) from 15 minute analysis interval.

https://www.amibroker.com/guide/afl/timeframeset.html

Please note that you can only compress data from shorter interval to longer interval. So when working with 1-minute data you can compress to 2, 3, 4, 5, 6, ....N-minute data. But when working with 15 minute data you can not get 1-minute data bars. In a similar way if you have only EOD data you can not access intraday time frames.


If you want to output shorter interval value(s) (e.g. last value) on selected longer interval then store data of shorter interval to static variable when shorter interval is selected one.

https://www.amibroker.com/guide/afl/staticvarset.html
https://www.amibroker.com/guide/afl/staticvarget.html

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