Painting a bar ? Nothing is changed

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

Painting a bar ? Nothing is changed

Postby arjfca » 03 May 2012

Hello

I use the command PlotPaintBar to change the color of a bar under certain conditions. No color is changed. Why?

Code: Select all

Var: Body (0);
Body = Body = absvalue (Open - close);

If body > Body[1]and body > Body[2] and Body> body[3] and Close < Open then plotpaintbar(h,l,o,c,"",darkmagenta);
If body > Body[1]and body > Body[2] and Body> body[3] and Close > Open then plotpaintbar(h,l,o,c,"",darkgreen);
Martin

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

Re: Painting a bar ? Nothing is changed

Postby TJ » 03 May 2012

Hello

I use the command PlotPaintBar to change the color of a bar under certain conditions. No color is changed. Why?

Code: Select all

Var: Body (0);
Body = Body = absvalue (Open - close);

If body > Body[1]and body > Body[2] and Body> body[3] and Close < Open then plotpaintbar(h,l,o,c,"",darkmagenta);
If body > Body[1]and body > Body[2] and Body> body[3] and Close > Open then plotpaintbar(h,l,o,c,"",darkgreen);
Martin
did you layer this indicator as the top level?

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

Re: Painting a bar ? Nothing is changed

Postby TJ » 03 May 2012

ps.
you could streamline the code...

Code: Select all

Var: Body (0);
Body = absvalue (Open - close);

If body > Body[1]and body > Body[2] and Body> body[3] then
begin
if Close < Open then
plotpaintbar(h,l,o,c,"",darkmagenta)
else
plotpaintbar(h,l,o,c,"",darkgreen);
end;

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Painting a bar ? Nothing is changed

Postby arjfca » 03 May 2012


did you layer this indicator as the top level?
Sorry, I don't follow you on that!

Martin

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

Re: Painting a bar ? Nothing is changed

Postby TJ » 03 May 2012


did you layer this indicator as the top level?
Sorry, I don't follow you on that!

Martin
right click on chart,

select "Visual Order",

highlight the indicator name, click the button for "Bring to Front"

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Painting a bar ? Nothing is changed

Postby arjfca » 03 May 2012


did you layer this indicator as the top level?
Sorry, I don't follow you on that!

Martin
right click on chart,

select "Visual Order",

highlight the indicator name, click the button for "Bring to Front"
OK, done but no change on the result

Martin :)

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

Re: Painting a bar ? Nothing is changed

Postby TJ » 03 May 2012

...
OK, done but no change on the result

Martin :)
on your h,l,o,c,

do you have the plot type as

Bar High
Bar Low
Left Tick
Right Tick

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

Re: Painting a bar ? Nothing is changed

Postby TJ » 03 May 2012

...
OK, done but no change on the result

Martin :)
do you have the scale set to "Same as Instrument"?

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

Re: Painting a bar ? Nothing is changed

Postby TJ » 03 May 2012

Hello

I use the command PlotPaintBar to change the color of a bar under certain conditions. No color is changed. Why?

Code: Select all

Var: Body (0);
Body = Body = absvalue (Open - close);

If body > Body[1]and body > Body[2] and Body> body[3] and Close < Open then plotpaintbar(h,l,o,c,"",darkmagenta);
If body > Body[1]and body > Body[2] and Body> body[3] and Close > Open then plotpaintbar(h,l,o,c,"",darkgreen);
Martin
is the above an indicator?

or is it a "cut and paste" of part of a longer code?

if it is the latter, you might have something else in the code that have overwritten the color changes.

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

Re: Painting a bar ? Nothing is changed

Postby sptrader » 03 May 2012

See photo of the paintbar on my screen...looks OK.
Attachments
Paintbar.png
(47.1 KiB) Downloaded 381 times

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Painting a bar ? Nothing is changed

Postby arjfca » 03 May 2012

Hello

I use the command PlotPaintBar to change the color of a bar under certain conditions. No color is changed. Why?

Code: Select all

Var: Body (0);
Body = Body = absvalue (Open - close);

If body > Body[1]and body > Body[2] and Body> body[3] and Close < Open then plotpaintbar(h,l,o,c,"",darkmagenta);
If body > Body[1]and body > Body[2] and Body> body[3] and Close > Open then plotpaintbar(h,l,o,c,"",darkgreen);
Martin
is the above an indicator?

or is it a "cut and paste" of part of a longer code?

if it is the latter, you might have something else in the code that have overwritten the color changes.
Hello TJ

yes, this is cut and paste and a part of an indicator that show many differents aspect of bars informations. I will lookk across the code to see if there is something that prevent the bars to be display as I wish

Have a good evening
Martin

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

Re: Painting a bar ? Nothing is changed

Postby TJ » 03 May 2012

bear in mind that plotpaintbar is equivalent to the following combination:

Plot1
plot2
plot3
plot4


In MultiCharts, the lowest plot numbers are painted first.
If you have subsequent plot numbers that also plots HLOC,
your plotpaintbar will be overshadowed by the latter plots.


The easiest way to find out if you have sequent plots that cover these specific bars is to
set the plotpaintbar to a very thick weight. Or to check the Format Study list and see if you have any bars that are set to Bar High, Bar Low, etc.


Return to “MultiCharts”