How to change candle bar color?

TLK

New member
Question:
How to AssignPriceColor only if changeColor == yes? If changeColor = no, then follow the color settings in Appearance tab. Thanks in advance.

Example:

input changeColor = yes;

def IsUptrend = IsA + IsB + IsC;
plot Uptrend = IsUptrend;
Uptrend.Hide();

plot Data = close;
Data.DefineColor("Uptrend", CreateColor(100, 200, 100));
Data.DefineColor("Downtrend", Color.LIGHT_RED);
Data.DefineColor("Sideway", CreateColor(225, 175, 225));
AssignPriceColor(if Uptrend == 3 then Data.Color("Uptrend") else if Uptrend == 0 then Data.Color("Downtrend") else Data.Color("Sideway"));
 
Solution
Question:
How to AssignPriceColor only if changeColor == yes? If changeColor = no, then follow the color settings in Appearance tab. Thanks in advance.

Example:

input changeColor = yes;

def IsUptrend = IsA + IsB + IsC;
plot Uptrend = IsUptrend;
Uptrend.Hide();

plot Data = close;
Data.DefineColor("Uptrend", CreateColor(100, 200, 100));
Data.DefineColor("Downtrend", Color.LIGHT_RED);
Data.DefineColor("Sideway", CreateColor(225, 175, 225));
AssignPriceColor(if Uptrend == 3 then Data.Color("Uptrend") else if Uptrend == 0 then Data.Color("Downtrend") else Data.Color("Sideway"));

Try this

Ruby:
input changeColor = yes;

def IsUptrend = 1 + 1 + 1;
plot Uptrend = IsUptrend;
Uptrend.Hide();

plot Data = close...

SleepyZ

Well-known member
Question:
How to AssignPriceColor only if changeColor == yes? If changeColor = no, then follow the color settings in Appearance tab. Thanks in advance.

Example:

input changeColor = yes;

def IsUptrend = IsA + IsB + IsC;
plot Uptrend = IsUptrend;
Uptrend.Hide();

plot Data = close;
Data.DefineColor("Uptrend", CreateColor(100, 200, 100));
Data.DefineColor("Downtrend", Color.LIGHT_RED);
Data.DefineColor("Sideway", CreateColor(225, 175, 225));
AssignPriceColor(if Uptrend == 3 then Data.Color("Uptrend") else if Uptrend == 0 then Data.Color("Downtrend") else Data.Color("Sideway"));

Try this

Ruby:
input changeColor = yes;

def IsUptrend = 1 + 1 + 1;
plot Uptrend = IsUptrend;
Uptrend.Hide();

plot Data = close;
Data.DefineColor("Uptrend", CreateColor(100, 200, 100));
Data.DefineColor("Downtrend", Color.LIGHT_RED);
Data.DefineColor("Sideway", CreateColor(225, 175, 225));
AssignPriceColor(if changecolor then if Uptrend == 3 then Data.Color("Uptrend") else if Uptrend == 0 then Data.Color("Downtrend") else Data.Color("Sideway") else color.current);
 
Solution

Similar threads

Top