Watchlist background color


Category:
0
1

Hello Pete

Have attempted to color code the background watchlist color for macd, i get close but no weo.  Anyway, you wrote me one for stochastics a while back did great.  What i need is to color the back ground in a watch to green if the macd fastlength is > than the slow length.   Pretty simple…..i guess.  If you would do that would be glad to make another contribution.  Thanks for you help!

 

Doug

Marked as spam
Posted by (Questions: 10, Answers: 11)
Asked on June 4, 2017 11:29 am
240 views
0
Private answer

Here you go. Screenshot shows the output.

input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input averageType = AverageType.EXPONENTIAL;
plot Value = MovingAverage(averageType, close, fastLength) - MovingAverage(averageType, close, slowLength);
def Avg = MovingAverage(averageType, Value, MACDLength);
def Diff = Value - Avg;
AssignBackGroundColor(if Value >= Avg then Color.GREEN else Color.RED);

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on June 4, 2017 5:54 pm
0
Only one question per post. Please add these two questions as new posts in the forum.
( at July 22, 2019 10:03 am)