Line Plot Color Offset  [SOLVED]

Questions about MultiCharts and user contributed studies.
mark
Posts: 6
Joined: 05 Jan 2014

Line Plot Color Offset

Postby mark » 17 Mar 2016

When plotting a line with different colors, the color begins on the bar in which a condition is met and follows through to the next bar in which the condition may not be met. This gives a misleading visual appearance. The code and attachment illustrate this.

How can this be overcome?

Code: Select all

Var: CloseColor(white);
If close < close[1] then CloseColor = red else CloseColor = green;
plot1(close,"close",CloseColor);
Attachments
MultiCharts Line Plot Color Offset.png
(40.01 KiB) Downloaded 292 times

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Line Plot Color Offset

Postby TJ » 17 Mar 2016

When plotting a line with different colors, the color begins on the bar in which a condition is met and follows through to the next bar in which the condition may not be met. This gives a misleading visual appearance. The code and attachment illustrate this.

How can this be overcome?

Code: Select all

Var: CloseColor(white);
If close < close[1] then CloseColor = red else CloseColor = green;
plot1(close,"close",CloseColor);
Easy fix. You have to add this line:

Code: Select all


SetPlotColor[1](1, CloseColor);

mark
Posts: 6
Joined: 05 Jan 2014

Re: Line Plot Color Offset  [SOLVED]

Postby mark » 17 Mar 2016

Thank you for the quick accurate reply.


Return to “MultiCharts”