Thinkorswim ADX DMI Watchlist can we add 3rd background color?


Category:
0
0

 

Peter can you help me add a line of code that would allow me to view 3 background colors

input threshold = 20

input threshold = 40

Black color for anything below input threshold = 20

White anything above input threshold = 20 but below input threshold = 40

Grey for anything above input threshold = 40

 

I tried multiple times however no success.

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on March 7, 2017 12:47 pm
458 views
1
Private answer

Ok, so the solution to this one requires a “nested if statement”. They can be quite difficult to wrap your brain around. But with practice it becomes easier. In plain english it looks like this:

if adx is less then 20 then BLACK, otherwise if adx is greater than 40 then GRAY otherwise WHITE.

(The original code is provided in the video description here: https://www.hahn-tech.com/thinkorswim-adx-dmi-watchlist/ )

Here is what that looks like in code

So get that source code, delete the last line and replace it with this:

AssignBackgroundColor(if adx < 20 then Color.BLACK else if adx > 40 then Color.GRAY else Color.WHITE);

Screenshot shows what that looks like. Don’t for get to up-vote any answers that best solve your question!

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on March 7, 2017 1:07 pm
0

Amazing Thank you!

( at March 7, 2017 7:00 pm)