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

Re: Natural hour bars



PureBytes Links

Trading Reference Links

Bob,

I like artificial bars. I use artificial bars for yesterdays HLC acquired
from one minute bars. (Sam Tennis's vrt.Daily.HiLoCl) I didn't think of
applying that to creating an offset for hourly bars. One would have to
create a function for every size bar that you wanted to create eg 30, 60
minute, etc.

Good idea.

This thread is getting pretty long. Too bad this email list can't use some
type of newsgroup threading....


eric langley

----- Original Message -----
From: Bob Fulks <bfulks@xxxxxxxxxxxx>
To: omega-list@xxxxxxxxxx <Omega-list@xxxxxxxxxx>
Sent: Saturday, March 11, 2000 1:04 PM
Subject: Re: Natural hour bars


> At 2:45 PM +0100 3/11/00, pierre.orphelin wrote:
>
> >>>How was the hour shifted?<<
> >>
> >>This experiment was performed on a very sophisticated platform, not
> >>TS. I do not know how it was coded up.
> >>
> >>- Mark Jurik
> >
> >
> >Hour shifting optimization is perfectly feasible with TS2000.
> >
> >For that, store the price bars into arrays elements, and run the
> >indicators that are used in the system over the the considered array
> >element.
> >
> >The index "j" of the array being the shifting index , you may then
> >optimize by running the optimizer and setting its range variation for
> >index j.
> >
> >This method needs also to rewrite the indicator that now has to use
> >array values as inputs instead of raw price data.
> >
> >This is feasible, but not immediate to EL beginners.
>
>
>
>
> You can also create artificial hour bars from one minute bars (Not
> thoroughly tested but probably close to correct):
>
> --------------------------------
>
> Input: Offset(0);     {Number of minutes offset from natural hour}
>
> Vars: hHigh(High),    {Hourly High}
>       hLow(Low),      {Hourly Low}
>       hOpen(Open),    {Hourly Open}
>       hClose(Close),  {Hourly Close}
>       BarCount(0),    {Count of bars since 1000}
>       Init1(FALSE),   {Flag to wait until 1000}
>       Init2(FALSE);   {Flag to wait until first hourly bar finished}
>
> hHigh = iff(High > hHigh, High, hHigh);
> hLow  = iff(Low  < hLow,  Low,  hLow);
> hClose = Close;
> BarCount = BarCount + 1;
>
> if Date > Date[1] then Init1 = FALSE;
>
> if Time = 1000 then begin
>    BarCount = 0;
>    Init1 = TRUE;
>    Print(Date:7:0, Time:5:0, BarCount:5:0, " Init1");
> end;
>
> if Init1 and MOD(BarCount, 60) = Offset then begin
>
>    if Init2 then begin
>
>       {Put your system code here using hHigh, hLow, hOpen, hClose}
>
>       Print(Date:7:0, Time:5:0, BarCount:5:0, " System");
>    end;
>
>    hHigh = High;
>    hLow = Low;
>    hOpen = Open;
>    hClose = Close;
>    Init2 = TRUE;
>    Print(Date:7:0, Time:5:0, BarCount:5:0, " Init2");
> end;
>
> --------------------------------
>
> You need to make sure that any functions you use work when using only
> one bar out of every 60. Functions of the "Series" type will not work
> as they are evaluated on every bar. Most functions of the "Simple"
> type can be made to work but you need to test them to be sure.
>
> Bob Fulks
>