Change color of the instrument (and not color of the study)

Questions about MultiCharts and user contributed studies.
Nicolas23
Posts: 50
Joined: 13 Oct 2011
Has thanked: 22 times
Been thanked: 35 times

Change color of the instrument (and not color of the study)

Postby Nicolas23 » 18 Oct 2011

Hi,

Is it possible, when some criteria are met, to change the display color of the instrument (typically: ES as candlesticks) instead of changing the color of the study?

For instance, let's display an instrument (ES as candlestick) and, below, a RSI.

I would like that, when RSI is overbought, the color of ES candlesticks change. Of course, it is possible to change the color of the study, for instance with something as:

Code: Select all

If MyRSI > OverBought then SetPlotColor(1, Green);
but is it possible to change the color of the instrument bars?

After having looked into the help files, I have the feeling that it is not possible. Or has anybody a solution?

Thanks in advance for your help,
Yours sincerely,

Nicolas

User avatar
furytrader
Posts: 354
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 155 times
Been thanked: 217 times

Re: Change color of the instrument (and not color of the stu

Postby furytrader » 18 Oct 2011

I think what you want to do is to look at the PlotPaintBars command - this allows you to change the color and width of price bars. You can change the color of price bars based on whatever criteria you want. How it works on candlesticks, I'm not 100% sure.

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

Re: Change color of the instrument (and not color of the stu

Postby TJ » 18 Oct 2011

Hi,

Is it possible, when some criteria are met, to change the display color of the instrument (typically: ES as candlesticks) instead of changing the color of the study?

For instance, let's display an instrument (ES as candlestick) and, below, a RSI.

I would like that, when RSI is overbought, the color of ES candlesticks change. Of course, it is possible to change the color of the study, for instance with something as:

Code: Select all

If MyRSI > OverBought then SetPlotColor(1, Green);
but is it possible to change the color of the instrument bars?

After having looked into the help files, I have the feeling that it is not possible. Or has anybody a solution?

Thanks in advance for your help,
Yours sincerely,

Nicolas
try this:
add RSI to the indicator
apply the indicator to the main chart,
then map the plot1 ~ plot4 to high, low, open close.

Code: Select all

If MyRSI > OverBought then
begin
SetPlotColor(1, Green); // for high
SetPlotColor(2, Green); // for low
SetPlotColor(3, Green); // for open
SetPlotColor(4, Green); // for close
end;

Nicolas23
Posts: 50
Joined: 13 Oct 2011
Has thanked: 22 times
Been thanked: 35 times

Re: Change color of the instrument (and not color of the stu

Postby Nicolas23 » 24 Oct 2011

Sorry for this late feedback.

Following your suggestions, the problem has been solved in the following way:

Code: Select all

If MyRSI > 50 then PlotPaintBar(High, Low, Open, Close, "", Green);
This code paints instrument chart (candlesticks in my case) in green when RSI > 50.

The study shall be added within the instrument chart, and not in a separate chart below.

So Plot1(MyRSI, "RSI"); shall not be included in the study definition.

Thanks for your help! :-)

Nicolas

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

Re: Change color of the instrument (and not color of the stu

Postby TJ » 24 Oct 2011

Sorry for this late feedback.

Following your suggestions, the problem has been solved in the following way:

Code: Select all

If MyRSI > 50 then PlotPaintBar(High, Low, Open, Close, "", Green);
This code paints instrument chart (candlesticks in my case) in green when RSI > 50.

The study shall be added within the instrument chart, and not in a separate chart below.

So Plot1(MyRSI, "RSI"); shall not be included in the study definition.

Thanks for your help! :-)

Nicolas
Please start with your manual.

Please download this ebook
The essential EasyLanguage programming guide
It allows you to quickly look up usage and syntax concepts and examples for the most commonly used features of EasyLanguage.

You can get the ebook here:
https://www.multicharts.com/multicharts ... mentation/

Nicolas23
Posts: 50
Joined: 13 Oct 2011
Has thanked: 22 times
Been thanked: 35 times

Re: Change color of the instrument (and not color of the stu

Postby Nicolas23 » 24 Oct 2011

Thanks! :)


Return to “MultiCharts”