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

RE: How to calculate from 1st bar of the day?



PureBytes Links

Trading Reference Links

var:counter(0);

While BarNumOfSession[counter] <> 1 Begin
	counter = counter +1;
End;  

FirstBarOpen = O[counter];


{function code}

{
	Chris Donnan 
	chris@xxxxxxxxxxxxxxxxxxx
}
var:
    cntr(0);

if IsSess1FirstBar then begin
   cntr = 1;
end
else begin
   cntr = cntr + 1;
end;

BarNumOfSession = cntr;

{end function code}

-----Original Message-----
From: unicorn@xxxxxxxxx [mailto:unicorn@xxxxxxxxx] On Behalf Of Alex
Matulich
Sent: Friday, December 12, 2003 5:54 PM
To: omega-list@xxxxxxxxxx
Subject: Re: How to calculate from 1st bar of the day?

Joe,

>    What I want it to do is plot from that point forward, but for only that
>day. Then reset from the opening of the next day. A day to day function,
>reset each day from the open.

So you want a function to return a constant value throughout an
intraday chart, changing only at the open of each day.  It's not
trivial.

{Function: myfunction}
Inputs: price(NumericSeries), b(NumericSimple);
Vars: x(0), y(0), result(0);
if time = FirstBarStartTime then begin
   {calculate your function based on the open}
   {make sure you do it so that your variables change ONLY within
   this section.  Do not call any other series function, only simple
   functions.  If you use canned functions like RSI or CCI or
   XAverage, then you must replicate that code here, and save your
   own values of previous prices for use next time this part of
   the code is executed}
   result = {whatever}
end;
myfunction = result;


Attachment:
OMEGA.ELD

Attachment: Description: "Description: Binary data"