Announcement
Collapse
No announcement yet.
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.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
633 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
364 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
567 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment