| The TimeFrameGetPrice - retrieves OHLCV fields from other time frames. This works immediatelly without need to call TimeFrameSet at all.
First parameter - pricefield - is one of the following: "O", "H", "L", "C", "V", "I" (open interest).
Interval is bar interval in seconds. You can use pre-defined interval constants: in1Minute, in5Minute, in15Minute, inHourly, inDaily, inWeekly, inMonthly. Or integer multiples like (3*in1Minute) for 3 minute bars
shift allows to reference past (negative values) and future (positive values) data in higher time frame. For example -1 gives previous bar's data (like in Ref function but this works in higher time frame).
mode - one of available modes:
- expandLast - the compressed value is expanded starting from last bar within given period (so for example weekly close/high/low is available on Friday's bar)
- expandFirst - the compressed value is expanded starting from first bar within given period (so for example weekly open is available from Monday's bar)
- expandPoint - the resulting array gets not empty values only for the last bar within given period (all remaining bars are Null (empty)).
Note these functions work like these 3 nested functions:
TimeFrameExpand( Ref( TimeFrameCompress( array, interval, compress(depending on field used) ), shift ), interval, expandFirst )
therefore, if shift = 0 compressed data may look into the future ( weekly high can be known on monday ). If you want to write a trading system using this function please make sure to reference PAST data by using negative shift value.
The only difference is that TimeFrameGetPrice is 2x faster than nested Expand/Compress.
For more information check Tutorial: Multiple time frame support |