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

Re: changing the color of a indicator line



PureBytes Links

Trading Reference Links

At 6:51 PM -0500 6/26/00, John Hayden wrote:

>Does anyone know how do the following:
>
>I have a custom indicator that is plotted as a blue line. What I would like
>to do is change the color to yellow for the past 21 bars. So if I am
>looking at a 10 minute bar chart the line color would be yellow for the
>last 210 minutes and anything older would be blue.
>
>Any idea's would be greatly appreciated.

Probably the easiest way is to plot the indicator twice in the
different colors:

   Value1 = Average(Close, 30);
   Plot1(Value1, "1");
   Plot2[21](Value1[21], "2");

Value1 is the indicator you want to plot. (I used Average as an example.)

The Plot1 statement will plot it on the current bar. It would be yellow.

The Plot2 statement plots the same indicator value 21 bars ago but
plots it delayed by 21 bars. This should be blue.

Plot2 write over Plot1 so the blue line will cover up the yellow line
previously plotted.

Bob Fulks