How do I write user-defined candle color into my code?

Pelonsax

Pelonsax

Active member
VIP
I have created an indicator that paints candles (based on The STRAT by Rob Smith). I like the colors I chose but I would prefer the user to be able to pick them. Any suggestions?
 
BenTen

BenTen

Administrative
Staff
VIP
I'm not sure if that is even possible for painted candles.
 
P

Pensar

Active member
VIP
@Pelonsax Perhaps try using global colors? So something like this -
Code:
#coded in forum, likely has errors
DefineGlobalColor("Up", color.green);
DefineGlobalColor("Down", color.red);
plot sma = average(close,20);
sma.assignvaluecolor(if close > sma then GlobalColor("Up") else GlobalColor("Down"));
 
S

silver8ack

New member
@Pelonsax Not to sound like a moocher, but do you plan on sharing the study? I started to work on a study/strategy for Robert Smith’s “The Strat” and noticed your posts on here looked similar to what I was looking for. I’d love to help as well.
 

Similar threads

Top