Add fill color to RSI above and below zero line


Category:
0
0

Please see attached file. I can’t figure out how to have the same RSI as the attached screenshot. Remove level 70 and 30 and just have it colors when crosses line 50. Please advise. Thank you.

Editor’s note: The title and URL of this post has been changed to better reflect the context of the question.

Attachments:
RESOLVED
Marked as spam
Posted by (Questions: 23, Answers: 57)
Asked on July 22, 2017 2:24 pm
2118 views
0
Private answer

Here we go. Just leveraging the code that is included with the built in RSI study. I’ve only added a centerline variable and an AddCloud() statement.

You can read more about the AddCloud() function here: http://toslc.thinkorswim.com/center/reference/thinkScript/Functions/Look—Feel/AddCloud.html

Here is the code, and screenshot show the output.

declare lower;
input length = 14;
input price = close;
input averageType = AverageType.WILDERS;
plot rsi = RSI(length, 70, 30, price, averageType).RSI;
plot centerLine = 50;
AddCloud(rsi, centerLine, Color.GREEN, Color.RED);

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on July 22, 2017 3:18 pm
0
Private answer

That’s nice. Thank you, Pete!

Marked as spam
Posted by (Questions: 23, Answers: 57)
Answered on July 22, 2017 5:25 pm