[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

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;