Candles bar body coloring, How to ?

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

Candles bar body coloring, How to ?

Postby arjfca » 14 Apr 2011

Hello

Using PowerLanguage code, can i modify the body color.

Actually, i use
If close < close [1] Then PlotPaintBar(Open,Close,"",red,default,Width);
If close = close [1] Then PlotPaintBar(Open,Close,"",Blue,default,Width);
It paint a line over the body. I would like to have the complete body colored, not just a line above it

Any help appreciated

Martin

User avatar
Stan Bokov
Posts: 963
Joined: 18 Dec 2009
Has thanked: 367 times
Been thanked: 302 times

Re: Candles bar body coloring, How to ?

Postby Stan Bokov » 14 Apr 2011

Here is the code for the standard built in "Custom Gradient" indicator. It allows you to specify a whole gradient of colors to paint your bars. The key word here is PlotPB aka PlotPaintBar.

inputs:
Formula( FastK( 14 ) ),
LowerBound( 0 ),
UpperBound( 100 ),
UpColor( Cyan ),
DnColor( Magenta ) ;

variables:
var0( 0 ) ;

var0 = GradientColor( Formula, LowerBound, UpperBound, DnColor, UpColor ) ;

PlotPB( High, Low, Open, Close, "CustGrad-Bnd", var0 ) ;

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

Re: Candles bar body coloring, How to ?

Postby arjfca » 14 Apr 2011

Thank you Stan

I will work with it

Martin

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

Re: Candles bar body coloring, How to ?

Postby arjfca » 14 Apr 2011

Stan,

As per the EasyLanguage Functions and Reserved Words Reference
PlotPaintBar and PlotPB are the same command.

Copy from the manual
PlotPB (Reserved Word)
Disclaimer
This reserved word is an ABBREVIATED version of PlotPaintBar and enables you to paint the entire bar a specified
color or paint the bar between two specified values.
PlotPB( BarHigh, BarLow [, BarOpen [, BarClose [, "<PlotName>"[, ForeColor[, Default[,
Width]]]]]] );
BarHigh, BarLow, BarOpen and BarClose are numeric expressions representing the high, low, open and closing
prices for the bar to be drawn by the PaintBar study, and <PlotName> is the name of the plot. ForeColor is an Easy
Language color used for the plot (also referred to as PlotColor), Default (reserved for future use), and Width is a
numeric value representing the width of the plot.
It gave the same result
I will keep my actual code, but i will paint the entire bar instead of just the body.

Have a good day

Martin

User avatar
Stan Bokov
Posts: 963
Joined: 18 Dec 2009
Has thanked: 367 times
Been thanked: 302 times

Re: Candles bar body coloring, How to ?

Postby Stan Bokov » 14 Apr 2011

PlotPaintBar and PlotPB are the same command.
That's what I referred to when I said "aka". My apologies if that wasn't clear.

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

Re: Candles bar body coloring, How to ?

Postby arjfca » 14 Apr 2011

No problem at all Stan

I just learn a new English expression : AKA :)

MT

User avatar
Stan Bokov
Posts: 963
Joined: 18 Dec 2009
Has thanked: 367 times
Been thanked: 302 times

Re: Candles bar body coloring, How to ?

Postby Stan Bokov » 14 Apr 2011

Right :) I should keep in mind not everyone is familiar with acronyms such as "also-known-as" etc.

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

Re: Candles bar body coloring, How to ?

Postby sptrader » 14 Apr 2011

No problem at all Stan

I just learn a new English expression : AKA :)

MT
***************************
"AKA" = also known as.


Return to “MultiCharts”