Moving avg colors


Category:
0
0

HI Pete . I was wondering if you have code to show different colors for moving avg moving up or down.  ie Green for up and red for down.

Thanks,

John

Marked as spam
Posted by (Questions: 3, Answers: 9)
Asked on May 28, 2017 9:24 am
124 views
0
Private answer

You should find what you need in this post: https://www.hahn-tech.com/ans/horizontal-line-moving-average/

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on May 28, 2017 4:11 pm
0
Private answer

Thank You! That is similar to what I am looking for I need just the 50 simple mavg to change from green when up to red when down. Im not sure how to manipulate your code to achieve this.

Thanks

Marked as spam
Posted by (Questions: 3, Answers: 9)
Answered on May 29, 2017 11:27 am
0
Private answer

plot ma1 = Average(close, 50);
ma1.AssignValueColor(if ma1 >= ma1[1] then Color.GREEN else Color.RED);

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on May 29, 2017 2:13 pm
0
Private answer

Thank You!

Marked as spam
Posted by (Questions: 3, Answers: 9)
Answered on May 29, 2017 4:45 pm