Hello
I would like to create an indicator that will color only the body of a candel bar, depending on some rules
A): Green if the close is higher than the preceiding close
B): Blue if the close is lower than the precieiding
C): Purple if the close equal the preceiding close
What I'm looking is the command to color a bar. I did look in EasyLanguage Functions and Reserved Words Reference, but did not found it.
Martin
How can i do that: Coloring the body of a bar
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: How can i do that: Coloring the body of a bar
try this:Hello
I would like to create an indicator that will color only the body of a candel bar, depending on some rules
A): Green if the close is higher than the preceiding close
B): Blue if the close is lower than the precieiding
C): Purple if the close equal the preceiding close
What I'm looking is the command to color a bar. I did look in EasyLanguage Functions and Reserved Words Reference, but did not found it.
Martin
Code: Select all
var:
color(0);
if c > c[1] then color = green
else
if ....
plot10( high, "high" , color);
plot20( low, "low" , color);
set plot10 to bar high
set plot20 to bar low
set the weight to the thickest line.
Re: How can i do that: Coloring the body of a bar
Hello TJ
I was to reply that I have solved my interogation. Here is my solution
The last number " 10" is the LineWidth. I have selected so it filled the body
Martin
I was to reply that I have solved my interogation. Here is my solution
The last number " 10" is the LineWidth. I have selected so it filled the body
Code: Select all
If close > close [1] Then PlotPaintBar(Open,Close,"",Green,default,10);
If close < close [1] Then PlotPaintBar(Open,Close,"",red,default,10);
If close = close [1] Then PlotPaintBar(Open,Close,"",Blue,default,10);
- Attachments
-
- ColorBar.jpg
- (79.5 KiB) Downloaded 269 times
- TJ
- Posts: 7744
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: How can i do that: Coloring the body of a bar
Looking good !Hello TJ
I was to reply that I have solved my interogation. Here is my solution
The last number " 10" is the LineWidth. I have selected so it filled the body
Martin
One small suggestion -- if you put the "else" in the code, it will run slightly faster.
Also, you do not need the last "If close = close [1] Then..." because it is implied.
Code: Select all
If close > close [1] Then PlotPaintBar(Open,Close,"",Green,default,10)
else
If close < close [1] Then PlotPaintBar(Open,Close,"",red,default,10)
else
PlotPaintBar(Open,Close,"",Blue,default,10);