TRIX Zero Line Watchlist


Category:
0
0

Hello Pete

 

You created a Trix Crossover Watchlist for me a little while back. (code below)

Would it be possible to edit the same code to show Trix above or below Zero Line?

Thanks for any help with this.

Ellis

 

input length = 9;
input colorNormLength = 14;
input price = close;
input signalLength = 3;
def tr = ExpAverage(ExpAverage(ExpAverage(Log(price), length), length), length);
def trix = (tr – tr[1]) * 10000;
def signal = ExpAverage(trix, signalLength);
AddLabel(yes, if trix > signal then “A” else “B”, if trix > signal then Color.GREEN else Color.RED);

Marked as spam
Posted by (Questions: 3, Answers: 5)
Asked on April 1, 2022 3:18 pm
99 views
0
Private answer

I think you are going to be shocked by how simple this is. You only need to change two elements in one line of code. And its the very last line of code. I'll post the original first, then the correction:

AddLabel(yes, if trix > signal then “A” else “B”, if trix > signal then Color.GREEN else Color.RED);

And here is the corrected version:

AddLabel(yes, if trix > 0 then “A” else “B”, if trix > 0 then Color.GREEN else Color.RED);

And you might also be shocked to discover you can build something like this without knowing the first thing about how to write any code at all. Using the Condition Wizard:

https://www.hahn-tech.com/thinkorswim-condition-wizard-watchlist/

 

Marked as spam
Posted by (Questions: 37, Answers: 4086)
Answered on April 1, 2022 7:26 pm