TimeFrameExpand
|
Time Frame functions |
SYNTAX | TimeFrameExpand( array, interval, mode = expandLast ) |
RETURNS | ARRAY |
FUNCTION | The TimeFrameExpand function expands time-compressed array from interval time frame to base time frame (interval parameter must match the value used in TimeFrameCompress or TimeFrameSet)
The TimeFrameExpand is used to decompress array variables that were created in different time frame. Decompressing is required to properly display the array created in different time frame. For example if you want to display weekly moving average it must be 'expanded' so the data of one weekly bar covers five daily bars (Monday-Friday) of corresponding week. Available modes:
Caveat: expandFirst used on price different than open may look into the future. For example if you create weekly HIGH series, expanding it to daily interval using expandFirst will enable you to know on MONDAY what was the high for entire week. For more information check Tutorial: Multiple time frame support |
EXAMPLE | wc = TimeFrameCompress( Close, inWeekly ); |
SEE ALSO | TimeFrameSet() function , TimeFrameRestore() function |
The TimeFrameExpand function is used in the following formulas in AFL on-line library:
See updated/extended version on-line.