- restore price arrays to original symbol

Referencing other symbol data
(AmiBroker 4.50)

SYNTAX RestorePriceArrays( tradeprices = False )
FUNCTION The RestorePriceArrays restores original price and volume arrays after the call to SetForeign.

tradeprices parameter has to match the one used in SetForeign() function.

When tradeprices argument is set to TRUE, then not only OHLC, V, OI, Avg arrays are restored, but BuyPrice, SellPrice, ShortPrice, CoverPrice, PointValue, TickSize, RoundLotSize, MarginDeposit variables too.

new in 5.90 - it can be also used to restore OHLC arrays that were directly overwritten by the user (without calling TimeFrameSet or Foreign).

EXAMPLE // Example 1: Plot the indicator using foreign security data
Plot( Ultimate(), "Ultimate from MSFT", colorRed );

// Example 2: Use SetForeign with Equity function
SetForeign("MSFT", True, True );
Buy = Cross( MACD(), Signal());
Sell = Cross( Signal(), MACD());
e =
Equity(); // backtest on MSFT
RestorePriceArrays( True ); // <- should match parameter used in SetForeign

SEE ALSO SetForeign() function , TimeFrameSet() function


Tomasz Janeczko
tj --at--
2004-07-10 07:03:50
TimeFrameRestore and RestorePriceArrays
is essentially the same function. So please note that calling RestorePriceArrays also resets the time interval set by eventual previous call to TimeFrameSet


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

More information:

See updated/extended version on-line.