Conditional color in Market Scanner?  [SOLVED]

Questions about MultiCharts and user contributed studies.
Xyzzy
Posts: 162
Joined: 19 Mar 2011
Has thanked: 43 times
Been thanked: 79 times

Conditional color in Market Scanner?

Postby Xyzzy » 29 Dec 2015

I've created a market scanner that includes a column for the built-in ADX indicator. The text for the indicator is set to a default color of grey. I'm looking for a way to have the text change to a different color (e.g., to green) if the ADX is in a certain range (e.g., above 20).

Is there any way to do this using the built-in indicator, or would I need to "roll my own" indicator to support the color-changing functionality? Thanks.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Conditional color in Market Scanner?  [SOLVED]

Postby JoshM » 29 Dec 2015

I don't know if there's a built-in indicator that does such a thing already, but this can be be quickly coded with the SetPlotBGColor keyword.

An untested example of that would be:

Code: Select all

Variables:
adxValue(0);

adxValue = ADX(10);

Plot1(adxValue, "ADX");

if (adxValue > 20) then
SetPlotBGColor(1, green)
else
SetPlotBGColor(1, grey);

Xyzzy
Posts: 162
Joined: 19 Mar 2011
Has thanked: 43 times
Been thanked: 79 times

Re: Conditional color in Market Scanner?

Postby Xyzzy » 29 Dec 2015

Thanks very much, Josh! It would be nice, though, to have this feature available using built-in indicators. I'll submit a feature request to that effect in the project management section.


Return to “MultiCharts”