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

Re: Coding a paintbar



PureBytes Links

Trading Reference Links

At 10:32 PM 6/7/2004, Paul wrote:

>I want to paint only 3 bars on the chart
>
>a) the current bar
>b) the bar 26 periods before the current bar
>c) the bar 52 periods before the current bar


You don't say whether or not this is on real-time data (such that you want 
the bars to repaint as a new bar).

If you just want to paint it once then try this: 

-------------

if LastBarOnChart then begin
   Plot1[0](High[0], "1");     {Paint last bar on chart}
   Plot2[0](Low[0], "2");
   Plot1[26](High[26], "1");   {Paint 26 bars back on chart}
   Plot2[26](Low[26], "2");
   Plot1[52](High[52], "1");   {Paint 52 bars back on chart}
   Plot2[52](Low[52], "2");
end;

-------------

If you want to repaint in real-time as each new bar is added, it is more 
complicated since you then have to un-paint bars also.

Bob Fulks