RestorePriceArrays
- restore price arrays to original symbol

Referencing other symbol data
(AFL 2.5)


SYNTAX RestorePriceArrays( tradeprices = False )
RETURNS NOTHING
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
SetForeign("MSFT");
Plot( Ultimate(), "Ultimate from MSFT", colorRed );
RestorePriceArrays();

// 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

Comments:

Tomasz Janeczko
tj --at-- amibroker.com
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

References:

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

More information:

Updated on-line reference