• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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
    http://support2.dundas.com/OnlineDoc...2005/TRIX.html
    http://www.incrediblecharts.com/indi..._indicator.php
    http://daytrading.about.com/od/indicators/a/Trix.htm

    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.

    http://fmlabs.com/reference/default.htm

    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.
    BrettNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bdelorm, Today, 11:10 AM
    0 responses
    1 view
    0 likes
    Last Post bdelorm
    by bdelorm
     
    Started by habibalex, 06-13-2019, 11:09 PM
    4 responses
    21 views
    0 likes
    Last Post brucerobinson  
    Started by stoxos, Today, 10:36 AM
    0 responses
    1 view
    0 likes
    Last Post stoxos
    by stoxos
     
    Started by NinjaTrader_ChelseaB, Today, 08:47 AM
    0 responses
    6 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Deterministic J, Today, 08:00 AM
    4 responses
    80 views
    0 likes
    Last Post Deterministic J  
    Working...
    X