Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TRIX indicator calculation looks wrong

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    TRIX indicator calculation looks wrong

    Hi NT,

    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

    TRIX uses a triple-smoothed moving average to eliminate cycles shorter than the indicator period.



    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

    #2
    Hello,

    Thanks for posting.



    We use this reference for most of our indicators. There isn't any one accepted value here as what is correct. In these cases we always default to FMLabs or stocks and commodities magazine where FMLabs got their forumula for the version to use inside of NinjaTrader.

    Let me know if I can be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by BarzTrading, Today, 07:25 AM
    2 responses
    17 views
    1 like
    Last Post BarzTrading  
    Started by devatechnologies, 04-14-2024, 02:58 PM
    3 responses
    20 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by tkaboris, Today, 08:01 AM
    0 responses
    4 views
    0 likes
    Last Post tkaboris  
    Started by EB Worx, 04-04-2023, 02:34 AM
    7 responses
    163 views
    0 likes
    Last Post VFI26
    by VFI26
     
    Started by Mizzouman1, Today, 07:35 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X