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 super smoothing filter

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

    Ehlers super smoothing filter

    I am looking for Ehler's Super smoothing filter. I found the old code from 2008 and want to convert this to NT8 and have attached it here. Any help will be so much appreciated.
    Attached Files

    #2
    I converted the following code from the EhlersSuperSmoothingFilter to C#. However, I am not sure how to convert this code to a NT indicator -

    var a1 = Math.Exp(-Math.Pi * Math.Sqrt(2) / Period);
    var coeff2 = 2 * a1 * Math.Cos(Sqrt(2) * Math.Pi / Period);
    var coeff3 = - Sqr(a1);
    var coeff1 = 1 - coeff2 - coeff3;
    var filt = if Double.IsNaN(price + price[1]) then filt[1] else coeff1 * (price + price[1]) / 2 + coeff2 * filt[1] + coeff3 * filt[2];​

    The filt line (last line) might not be accurate as I had no idea how to test. I want to plot the filt line.

    Comment


      #3
      Hello Graci117,

      Thanks for your post.

      Unfortunately, due to the code-breaking changes to the structure of NinjaScripts as well as changes to the NinjaScript properties and methods, no scripts created for NinjaTrader 7 will import into NinjaTrader 8.

      My advice is to start by creating as much of the script as possible in NinjaTrader 8 using the Strategy Builder (or Strategy Wizard). This will create the framework of the indicator or strategy which has large changes from NinjaTrader 7 to NinjaTrader 8.

      Then copy all code from the NinjaTrader 7 scripts OnBarUpdate to the OnBarUpdate of the NinjaTrader 8 script. This will introduce errors that will need to be resolved.

      Below I am including a link to a list of the code-breaking changes from NinjaTrader 7 to NinjaTrader 8. This help guide will be the best way to see how things have changed from NinjaTrader 7 to NinjaTrader 8.

      Code-breaking Changes: http://ninjatrader.com/support/helpG...ng_changes.htm

      When first starting to convert scripts, I myself would open the NinjaTrader 7 help guide and the NinjaTrader 8 help guide to the same sections so that I could compare. The majority of code supported by NinjaTrader is included in the help guides.

      Below is a link to a forum post with helpful information about getting started with NinjaScript.
      https://ninjatrader.com/support/foru...040#post786040

      Please let us know if we may assist further.​
      Brandon H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by halgo_boulder, 04-20-2024, 08:44 AM
      2 responses
      21 views
      0 likes
      Last Post halgo_boulder  
      Started by mishhh, 05-25-2010, 08:54 AM
      19 responses
      6,189 views
      0 likes
      Last Post rene69851  
      Started by gwenael, Today, 09:29 AM
      0 responses
      5 views
      0 likes
      Last Post gwenael
      by gwenael
       
      Started by Karado58, 11-26-2012, 02:57 PM
      8 responses
      14,830 views
      0 likes
      Last Post Option Whisperer  
      Started by Option Whisperer, Today, 09:05 AM
      0 responses
      2 views
      0 likes
      Last Post Option Whisperer  
      Working...
      X