Coloring body of a bar: What I.m I doing wrong?

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Coloring body of a bar: What I.m I doing wrong?

Postby arjfca » 21 Feb 2012

Hello

I want to color bars that as create a gap over or lower the preceding body

Code: Select all

If Open > maxlist(close[1],Open[1]) or open < minlist(close[1],Open[1]) then begin
PlotPaintBar(,,Open,Close,"gapbar",Red,12);
end;
Work fine, but only a tin line is colored in red instead of the entire body of the bar

as mentionned in the help,
LineWidth - an optional parameter; specifies the plot line width, ranging from 1 to 14
Plot line width can be specified as a numerical expression or by the word Default to specify the line width chosen by the user. In order for LineWidth to be used, PlotName, PlotColor, and Default parameters must also be used.
How could I code so the width of the colored bar be the same as the candle displayed on the screen

Martin

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

Re: Coloring body of a bar: What I.m I doing wrong?

Postby TJ » 21 Feb 2012

Hello

I want to color bars that as create a gap over or lower the preceding body

Code: Select all

If Open > maxlist(close[1],Open[1]) or open < minlist(close[1],Open[1]) then begin
PlotPaintBar(,,Open,Close,"gapbar",Red,12);
end;
Work fine, but only a tin line is colored in red instead of the entire body of the bar

as mentionned in the help,
LineWidth - an optional parameter; specifies the plot line width, ranging from 1 to 14
Plot line width can be specified as a numerical expression or by the word Default to specify the line width chosen by the user. In order for LineWidth to be used, PlotName, PlotColor, and Default parameters must also be used.
How could I code so the width of the colored bar be the same as the candle displayed on the screen

Martin
don't use PlotPaintBar

Code: Select all

If Open > maxlist(close[1],Open[1]) or open < minlist(close[1],Open[1]) then begin
Plot1(Open, "gapbar", Red, 12); // style = bar high
Plot2(Close, "gapbar", Red, 12); // style = bar low
end;

sptrader
Posts: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

Re: Coloring body of a bar: What I.m I doing wrong?

Postby sptrader » 21 Feb 2012

To Thicken the bar color- click on the study, then "format", "style", and increase the "weight" to the desired thickness.


Return to “MultiCharts”