You need to make sure that you've initialized the VarSet ALSO within the CBT-section, which often means, for example, that: 1) you first create a loop through some watchlist at the beginning of the CBT-section; 2) assign via VarSet some variable per symbol; 3) recall via VarGet later within the CBT-section these variables.
Should work. PS --- In amibroker@yahoogroups.com, "justinwonono" <[EMAIL PROTECTED]> wrote: > > > > --- In amibroker@yahoogroups.com, "vlanschot" <vlanschot@> wrote: > > > .... > > > > Personally, and FWIW, as I do not always want to clutter my Db with > > numerous ATC's, I often prefer to use VarSet. > > > > PS > > > > I eventually tried using VarSet > > eg. VarSet( Name() + "_trisk" , TradeRisk ); > > to use variables in the custom BT, but it has "Empty' values, maybe > the array gets cleared or I'm not referencing it correctly. > > I initialise > > TRisk2 = VarGet( Name() + "_trisk" ); > > at the start of the BT - "if( Status("action") == actionPortfolio )" loop > > Any ideas ( much apreciated) anyone ? > > > Regards >