Your calculation of the TRIX looks suspicious. You have:
EMA tripleEma = EMA(EMA(EMA(Inputs[0], period), period), period);
double trix = 100 * ((tripleEma[0] - tripleEma[1]) / tripleEma[0]);
Default.Set(trix);
Whereas I think it should be:
EMA tripleEma = EMA(EMA(EMA(Inputs[0], period), period), period);
double trix = 100 * ((tripleEma[0] - tripleEma[1]) / tripleEma[1]);
Default.Set(trix);
In other words, you are normalising by the current value of the triple exponential, rather than the previous.
Here are three references for you to check
These are just the first ones that google gave me. I don't know if there is an 'official' reference. I was just looking at the code and it didnt make sense. I didn't see any websites calculating it the way you do.
cheers
Comment