[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Plotting & Backtesting w/time functions



PureBytes Links

Trading Reference Links

At 2:12 PM -0400 10/13/98, GraceSys wrote:

>When I plot the function CurrentTime I get a flat line with the now
>current time not the time of each bar that has passed which means when
>backtesting using a rule such as; If CurrentTime > 1100 then buy at the
>market the back test will use the time the test was run not the time of
>the bar at that time.

>Could someone please help me (using 5 min bars) to find the either the
>number of bars or minutes since the open of session one that will work in
>backtesting and be plottable. Here I am trying to compare the first hour's
>trading volume with the first hour's trading volume for days passed using
>the same 5 min bars.

>As you would expect a plot of CurrentBar (returns bar number) is a one for
>one slope, increases one each bar. Is there a TimeofCurrentBar or other
>such function?


The reserved word "Time" is what you need. It is the time of the bar just
as "Date" is the date of the bar. CurrentTime is the time of day, as with
your watch.

You can get a count of the bars in a day with the foillowing code:

-------

Vars: Count(0);

Count = iff(Date <> Date[1], 1, Count + 1);

------

Bob Fulks