Hull and Force index watch list


Category:
0
0

Hi Pete.  I currently use two columns in my watch list. My first column is a Hull moving average column which you provided in a previous post: https://www.hahn-tech.com/ans/wl-for-hull-in-tos/. The second column provides the force index.  I was wondering if you can help me with two things:

  1. How do I make the color of the Force Index column green when the value is positive and red when negative?
  2. Is it possible to automatically highlight a row or the symbol if the HULL column is negative AND the force column is positive at the same time?  I would also like to highlight a row if the HULL column is positive and the force column is negative.

Thank you!

Marked as spam
Posted by (Questions: 19, Answers: 18)
Asked on March 23, 2020 10:21 pm
137 views
0
Private answer

Here is code to build your ForceIndex custom watchlist column. Notice I have used the name of the study exactly as it is used in Thinkorswim.

input length = 13;
plot forceIndex = ExpAverage(data = (close - close[1]) * volume, length);
AssignBackgroundColor(if forceIndex > 0 then Color.GREEN else if forceIndex < 0 then Color.RED else Color.CURRENT);

It is not possible to have two separate columns of a watchlist "talk to one another". Each one is sandboxed and you cannot have them react to values or conditions present in the other. It is also not possible to highlight a row in a watchlist using any code whatsoever.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on March 24, 2020 8:25 am