TimeFrameRestore
- restores price arrays to original time frame

Time Frame functions
(AmiBroker 4.50)


SYNTAX TimeFrameRestore( tradeprices = False )
RETURNS NOTHING
FUNCTION The TimeFrameRestore function restores price arrays replaced by TimeFrameSet.

Note that only OHLC, V, OI and Avg built-in variables are restored to original time frame when you call TimeFrameRestore().

All other variables created when being in different time frame remain compressed.

To de-compress them to original interval you have to use TimeFrameExpand.

Tradeprice argument should be set to false.

EXAMPLE TimeFrameSet( in5Minute ); // switch to 5 minute frame

/* MA now operates on 5 minute data, ma5_13 holds time-compressed 13 bar MA of 5min bars */

ma5_13 =
MA( C, 13 );

TimeFrameRestore(); // restore time frame to original

TimeFrameSet( inHourly ); // switch now to hourly

mah_9 =
EMA( C, 9 ); // 9 bar moving average from hourly data

TimeFrameRestore(); // restore time frame to original

Plot( Close, "Price", colorWhite, styleCandle );

// plot expanded average

Plot( TimeFrameExpand( ma5_13, in5Minute), "13 bar moving average from 5 min bars", colorRed );
Plot( TimeFrameExpand( mah_9, inHourly), "9 bar moving average from hourly bars", colorRed );

SEE ALSO TimeFrameSet() function

Comments:

Tomasz Janeczko
tj --at-- amibroker.com
2004-07-10 06:19:47
TimeFrameRestore and RestorePriceArrays
is essentially the same function. So please note that calling TimeFrameRestore also resets the ticker set by eventual previous call to SetForeign()

References:

The TimeFrameRestore function is used in the following formulas in AFL on-line library:

More information:

See updated/extended version on-line.