The current symbol during custom backtesting is ~~~Equity. If you want to make function calls using the symbol of the trade, then you must either save the result as a static array before entering the custom backtesting code, else use Foreign or SetForeign/RestorePriceArrays within the custom backtester code.
Read the following thread, including Tomasz's descriptions of static arrays, for examples: http://finance.groups.yahoo.com/group/amibroker/message/146164 Mike --- In amibroker@yahoogroups.com, "chuck_win" <ch...@...> wrote: > > I try to check MA inside Custom back test proc, and get 0 always. It seems > like only those stats are accessible and any others are not. > > Thanks very much for any help in advance. > > Charles > > // iterate through all closed trades. > for (trade = bo.getFirstTrade(); trade; trade = bo.GetNextTrade()) { > numTrades++; > > gapsup = MA(Close, MAlen) > Ref(MA(Close, MALen), -1); > > _TRACE( "MA: " + MA(Close, 6)); > > if (gapsup = True) { > upCount++; > } > } >