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 lightsun47, Today, 03:51 PM
      0 responses
      4 views
      0 likes
      Last Post lightsun47  
      Started by 00nevest, Today, 02:27 PM
      1 response
      8 views
      0 likes
      Last Post 00nevest  
      Started by futtrader, 04-21-2024, 01:50 AM
      4 responses
      44 views
      0 likes
      Last Post futtrader  
      Started by Option Whisperer, Today, 09:55 AM
      1 response
      13 views
      0 likes
      Last Post bltdavid  
      Started by port119, Today, 02:43 PM
      0 responses
      8 views
      0 likes
      Last Post port119
      by port119
       
      Working...
      X