Graham, Sorry, I misunderstood your comment of "During the backtest" to mean during custom backtest. You have access to the current symbol name (i.e. the ticker name) during a normal backtest, exploration, etc. simply by calling the Name() function.
http://www.amibroker.com/guide/afl/afl_view.php?id=103 Mike --- In [email protected], "Graham Johnson" <[EMAIL PROTECTED]> wrote: > > Hi Mike > > I'll try and digest that in the morning - time for bed now. > > What I had hoped to do was to get the symbol before the CBT is > invoked, but if it has to be done in the CBT then so be it. > > Thanks > > Graham > > --- In [email protected], "Mike" <sfclimbers@> wrote: > > > > Hi, > > > > When writing custom backtester code, you don't deal with a "current > > symbol". Instead, you deal with signals and/or open positions > and/or > > completed trades. > > > > Typically, you would iterate through the bars, then at each bar you > > would iterate through one or more of the above collections to do > > whatever you want to do (e.g. alter position size, calculate > > statistics, etc.). > > > > For both the Signal object and the Trade object (open and > completed), > > a property named "Symbol" is available. This would be the closest > to > > what you are asking for. > > > > Note that if the "current symbol" that you are seeking is not in > the > > signal collection, open trade collection, or closed trades > collection > > for a given bar, then you would have to use something along the > lines > > of the Foreign function, static variables or composites to get at > the > > information. > > > > See http://www.amibroker.com/guide/a_custombacktest.html for more > > information on custom backtester code. > > > > Mike > > > > --- In [email protected], "Graham Johnson" <grahamj@> wrote: > > > > > > I thought this was going to be simple. > > > > > > During the backtest, if there is a particular condition, I want > to > > > write the Symbol to a variable. > > > > > > I've searched the User Doc and this forum, but no joy on how to > get > > the > > > current symbol. > > > > > > Graham > > > > > >
