I have gone through some forum & manual pages but the closest I landed is here
ie. status function.
In the AFL code, is there a way to find what periodicity is set when the Exploration is run ?
Analysis > Settings > Periodicity (drop-down with different Time frames)
Basically what I have realized is that if you use TimeFrameGetPrice() and this Timeframe is lesser than periodicity than you don't get the desired result.
Anyone noticed this?
Sample Test Code:
pBar = 0;
H1 = TimeFrameGetPrice("H", inHourly, pBar);
H2 = TimeFrameGetPrice("H", inDaily, pBar);
H3 = TimeFrameGetPrice("H", inWeekly, pBar);
Filter = 1;
if periodicity is Daily, then H1 is same as H2 although the most recent bar (H1) high is different in chart.
if periodicity is Hourly, then all 3 values are correct but a lesser Timeframe will also be Hourly High.
I read that part also before posting but not to create any confusion and to show my testing I put my sample code.
My question still stands:
Q1. is there a way to programmatically return / get/ retrieve the "periodicity" set currently?
Q2. if yes, can it be changed programmatically through AFL?
Look for interval() function in help
When you use TimeFrame functions you can only go up never down.
If your interval is minute, you can get 10min high, hour high etc.
If your interval is daily, you can not access hour high for example
Thanks, i have understood how timeframes works.
The TimeFrameGetPrice - retrieves OHLCV fields from other time frames. This works immediatelly without need to call TimeFrameSet at all. (copied from manual)
I will read those parts once again but the definition of TimeFrameGetPrice specifically made me wonder.
I thought this new function can supersede the other problems encountered with Timeframe conversions.
It really shows that you did not read carefully enough. This is not novel where you can skip four sentences without losing idea. In AmiBroker docs every sentence is extremely important. Don't skip a word or letter. If you did read carefully you would notice this
Excerpt from: http://www.amibroker.com/guide/h_timeframe.html
TimeFrameGetPrice [...] Note these functions work like these 3 nested functions
TimeFrameExpand( Ref( TimeFrameCompress( array, interval, compress(depending on field used) ), shift ), interval, expandFirst )
If you did not skip that, you would know what TimeFrameGetPrice is doing and you would know it is subject to very SAME rules as all other TimeFrame functions.
AmiBroker is super-logical software. It is not similar to bloatware created by corporations. In AmiBroker if function belongs to one group it behaves the same as others in that group.