Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Ehlers Instantaneous Trendline

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

    Ehlers Instantaneous Trendline

    Hi,

    Has anyone coded the 'Instantaneous Trendline' indicator developed by John Ehlers for NT? If so, could you please share.

    Here is a post about the Instantaneous Trendline:


    Thanks!

    Erin

    #2
    what i find weird about the original TS code for this in ehlers book is that the Smooth variable is not used anywhere in the code after it is defined

    see :

    ///// EHLERS INSTANTANEOUS TREND INDICATOR /////
    Inputs: Price ((H+L)/2), alpha(.07);
    Vars: Smooth(0), // Smooth defined here but never used afterwards
    iTrend(0),
    Trigger(0);
    iTrend = (alpha- alpha*alpha/4)*price
    + .5* alpha * alpha * Price[1] -
    (alpha - .75 * alpha*alpha) * Price[2] + 2
    *(1 - alpha) * iTrend[1] -(1 - alpha)
    *(1-alpha)*iTrend[2];
    If currentBar < 7 then iTrend = Price + 2*price[1]
    + Price[2]/4;


    Trigger = 2*iTrend - iTrend[2];
    // trigger different than in NT indicator code


    plot1 (iTrend,"iTrend",blue);
    plot2 (Trigger, "Trig",green);
    Last edited by qewcool; 02-15-2010, 06:14 PM.

    Comment


      #3
      the code in the NT indicator archive for this seems to be different and it defines the Smooth variable.

      Also the Trigger variable is different than the original TS code.

      If anyone understand why this had been done like this, I would like to hear the explanation.

      See NT code:

      protected override void OnBarUpdate()
      {


      if (CurrentBar==0)
      {
      smooth.Set(0);
      trigger.Set(0);
      trend.Set(0);
      TrendPlot.Set(0);
      TriggerPlot.Set(0);

      return;
      }

      int Per1=PeriodsP;
      int Per2=PeriodsP;


      if(CurrentBar <= 7)
      return;

      double SmoothTemp = (Median[0] + 2* Median[1] + 2* Median[2] + Median[3])/6; // here Smooth is defined

      smooth.Set(SmoothTemp);


      double ItrendTemp = (alpha - alpha*alpha/4)* smooth[0]+0.5*alpha*alpha*smooth[1]-(alpha-0.75*alpha*alpha)*smooth[2]+2*(1-alpha)*trend[1]-(1-alpha)*(1-alpha)*trend[2]; // smooth is used here

      trend.Set(ItrendTemp);

      trigger.Set(trend[1]); // trigger is defined here ...

      TrendPlot.Set(trend[0]);
      TriggerPlot.Set(trigger[0]);

      }

      Comment


        #4
        qewcool,

        It would probably be more useful for users to know exactly which indicator you are using and where to get it. That way they can play with it too to help you understand what is being used. Thanks.

        Also, you may want to try contacting the original author directly as they would probably be the best source to question why they coded it a certain way.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          the indicator is in NT indicator archive at



          its called Instantaneous trendline indicator (itrend) ( second from the top of the search results).

          For the TS code, Its in Ehlers book "cybernetic analysis for stock and futures" at p.24 but you can find it on the web too just search "ehlers and itrend"

          Comment


            #6
            qewcool,

            This code is a 3rd party customer provided code authored by Elliott Wave. Your best bet may be to try and contact him directly.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Skifree, Today, 11:21 AM
            2 responses
            7 views
            0 likes
            Last Post Skifree
            by Skifree
             
            Started by manueldecastro, Today, 01:16 PM
            3 responses
            11 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by tradingnasdaqprueba, Today, 03:42 AM
            9 responses
            35 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by llanqui, Yesterday, 03:51 PM
            6 responses
            27 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by AlgoDreamer, Today, 12:39 PM
            2 responses
            9 views
            0 likes
            Last Post AlgoDreamer  
            Working...
            X