Hello, Code inside custom backtester is executed with ~~~EQUITY as current ticker And Equity at the point of preprocess is flat (= initial equity).
You would need to use SetForeign if you want to use different ticker http://www.amibroker.org/userkb/2008/03/16/amibroker-custom-backtester-interface-2/ Best regards, Tomasz Janeczko amibroker.com On 2010-03-28 20:08, jacek_lempart wrote: > Hi All, > > Could anyone tell me why ALWAYS anything returned by ATR() is 0.0 within the > for loop in the Custom Backtester? I will be extremely grateful for your > hints here. > > regards > > /* CODE */ > SetCustomBacktestProc(""); > if( Status("action") == actionPortfolio ){ > bo = GetBacktesterObject(); > bo.InitialEquity = 100000; > bo.PreProcess(); > Vlt = ATR(5); > for( i = 10; i< BarCount; i++ ) { > for( sig = bo.GetFirstSignal( i ); sig; sig = bo.GetNextSignal( i ) ) > { > sig.PointValue = 10; > currentRisk = bo.Equity * risk; > sig.MarginDeposit = 1; > a = Vlt[i]; // a==0 ALWAYS HERE - WHY?? > sig.PosSize = a+1; > } > bo.ProcessTradeSignals( i ); > } > bo.PostProcess(); > } > > > > ------------------------------------ > > **** IMPORTANT PLEASE READ **** > This group is for the discussion between users only. > This is *NOT* technical support channel. > > TO GET TECHNICAL SUPPORT send an e-mail directly to > SUPPORT {at} amibroker.com > > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at > http://www.amibroker.com/feedback/ > (submissions sent via other channels won't be considered) > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > http://www.amibroker.com/devlog/ > > Yahoo! Groups Links > > > > >
