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

Re: Painting Previous bars



PureBytes Links

Trading Reference Links

> I ve got this code:
> 
> If DayofWeek(Date)=5 then begin
> PlotPaintBar(High,Low,"MyDate");
> end;
> 
> I wonder how to paint not only the single day (Friday in this case),
> but all the bars of the week (since Monday to the same Friday). 

Which week?  DayOfWeek(Date) = 5 is true on EVERY Friday.  If you 
painted all the Mon-Fri for every week it's true, you'd paint 
every single day on the chart.

Are you trying to paint the week before a specific Friday?  If 
so, you might try something like this:  (not tested)

MyFriday = (whatever);
MyFriJD = DateToJulian(MyFriday);
DateJD = DateToJulian(Date);
if DateJD <= MyFriJD and DateJD+4 >= MyFriJD then
  PlotPaintBar(High,Low,"MyWeek");

Gary