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

Re: Coding help for color?



PureBytes Links

Trading Reference Links

Dear Randy,

I have found this feature in TS2Ki to be beneficial --- the feature that allows
plotting the same Plot number in a variety of colors and thicknesses depending on
condition.  For example:

Var:    MA(0);

Plot1(MA,"MA"); {Default: Plots MA as you set up on your Indicator screen --- for
example, a thin black line}
IF MA > 1 THEN Plot1(MA,"MA",6,6,3); {Overrides black line with thicker red line if
MA > 1}
IF MA < -1 THEN Plot1(MA,"MA",4,4,3); {Overrides black line with thicker green line
if MA < -1}

The first two numbers are the ELA color number; the third number is the ELA line
thickness.
Note that you can use the same Plot number for all.
Another feature not shown above is not plotting at all; for example if for some
reason you wanted not to plot if MA in a band between +0.5 and -0.5, then:
    IF AbsValue(MA) <= 0.5 THEN NoPlot(1);

Sincerely,

Richard


Traktor Topaz wrote:

> Randy Wrote:
> >I have been trying to plot a moving average where if it is going up it is
> one color and if it is going down >it's a different color. I've done it a
> couple of different ways but not receiving the desired effect.  One of >the
> ways is listed below but it lags one bar in color.  Can someone please help
> with the correct method.
>
> Dear Randy,
>
>         What I've done in a similar situation is to use two plots, that is
>                 If Direction = +1 then plot1( upvalue, "goingup" );
>                 If Direction = -1 then plot2( downvalue, "goingdown" );
>         Then, simply set the properties of plot1 and plot2 style setting to plot
> in points with a medium-heavy 'linesize'. Presto a line of big dots, one
> color going up, and another color going down.
>         I've been using TS4 until today. Assume it will work in TS6.
>
> -- Arthur Cronos
>
> _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>          MOBIUS MEGATAR TAPPING BASSES
> 'Making Music Easier'   http://www.megatar.com
> _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/