| 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. |
| 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 );
|