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!
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
NinjaTrader
Ehlers super smoothing filter
Collapse
X
-
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.
-
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 Today, 09:41 AM | ||
Started by mishhh, 05-25-2010, 08:54 AM
|
19 responses
6,189 views
0 likes
|
Last Post
by rene69851
Today, 09:29 AM
|
||
Started by gwenael, Today, 09:29 AM
|
0 responses
5 views
0 likes
|
Last Post
by gwenael
Today, 09:29 AM
|
||
Started by Karado58, 11-26-2012, 02:57 PM
|
8 responses
14,830 views
0 likes
|
Last Post Today, 09:09 AM | ||
Started by Option Whisperer, Today, 09:05 AM
|
0 responses
2 views
0 likes
|
Last Post Today, 09:05 AM |
Comment