Help Please With Dynamic color Settings

MindPortal

New member
Would appreciate help coding a line to change 3 colors.

When Value is (>) STDev make line Green
When Value is (<) STDevRev make line Red
When Value is (Neither > or <) STDev make line Gray

I had to stack two indicators to create a workaround but would appreciate being able to combine the two

Value1.AssignValueColor(if Value < StDev
then CreateColor(102, 0, 102)
else CreateColor(50,50,50));

Value1.AssignValueColor(if Value > StDev
then CreateColor(0, 153, 102)
else CreateColor(100,100,100));

Thank you
 

BenTen

Administrative
Staff
VIP
Here is an example:

Code:
Value1.AssignValueColor(if Value < StDev then color.green else if Value > StDev then color.red else color.yellow);

I hope that helps.
 

Similar threads

Top