If you are putting this into the custom backtest code, and your bar period setting is daily, then you can just use barcount
-- Cheers Graham Kav AFL Writing Service http://www.aflwriting.com 2009/10/9 jamesfarrow2003 <jamesfarrow2...@yahoo.com>: > > Thanks a lot, that worked like a charm:) > > --- In amibroker@yahoogroups.com, "Mike" <sfclimb...@...> wrote: >> >> >> >> indices = BarIndex(); >> firstIndex = LastValue(ValueWhen(Status("firstbarinrange"), >> indices)); >> lastIndex = LastValue(ValueWhen(Status("lastbarinrange"), indices)); >> barsInRange = lastIndex - firstIndex + 1; >> >> >> Mike >> >> >> --- In amibroker@yahoogroups.com, "jamesfarrow2003" >> <jamesfarrow2003@> wrote: >> > >> > Hello, >> > >> > I have what I think should be a pretty basic question, but I cannot >> seem to figure it out. >> > >> > I am adding a custom back test metric to my system. I want to add a >> penalty function (as described by Howard Bandy in QTS) based on trade >> frequency. >> > >> > I hove found where to get the number of trades in the backtest >> ("AllQty" ), but I cannot figure out where to find the number of days >> covered in the backtest. >> > >> > I thought I would be able to use intial equity, ending equity, and CAR >> to calculate it, when I do, it does not come up with the right number. >> Does AmiBroker use something other than the standard CAR calculation? >> > >> > Any help would be appreciated, >> > >> > James >> > >> > > > > > ------------------------------------ > > **** 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 > > > >