TRIX Crossover Watchlist


Category:
0
0

Hello Pete, I’m interested in a watchlist column that references the TRIX crossing above and below the signal line

I wanted to know if it was possible to do this on the watchlist?

The cell would display the letter (A) in GREEN for TRIX crossing (above) the signal line.

The cell would display the letter (B) in RED for TRIX crossing (below) the signal line.

Thanks for any help,

Ellis

Marked as spam
Posted by (Questions: 3, Answers: 5)
Asked on January 31, 2021 8:42 am
177 views
0
To be clear, you want the letter A or B to only appear on the one bar in which the crossover event has occurred? Or did you intended for the A to appear for every bar where TRIX is above the signal line and the B to appear for every bar where TRIX is below the signal line? Lot's of folks confuse crossover events (which only occur on one bar and then vanish) from a test for relative position (checking each and every bar to see if one value being above or below the other).
( at January 31, 2021 10:18 am)
0
Hello Pete Thank you for getting back to me so quickly. Having the (A) appear for every bar where TRIX is above the signal line and the (B) to appear for every bar where TRIX is below the signal line would be perfect. I would be able to see the crossover switch at a glance. Ellis
( at January 31, 2021 4:29 pm)
0
Private answer

In the comments section we have clarified the request. The title of the question mentions a crossover event however the clarification reveals the request is for trix above the signal line for green "A" and trix below signal line for red "B".

Here is the code for that custom watchlist column:

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: 37, Answers: 4118)
Answered on January 31, 2021 5:03 pm
0
Hello Pete Thank you Soooo Much Ellis
( at January 31, 2021 5:09 pm)