Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Does anyone know of a Ninja implementation of John Ehlers' Cycle Period Indicator?
I've searched this forum and the internet for it without success. However the code is freely available in EasyLanguage (link below), and looks pretty straightforward. I note an earlier thread here in 2010 to do this, but the project doesn't seem to have been completed. There are a couple of comments in this and also the Ninja Support Forum that this useful indicator is missed. Whether you use Ehlers' indicators or not, I've found the cycle period to be a useful starting point to set the period of many oscillator-type indicators.
A similarly useful and simple indicator to code, also available in EasyLanguage, is the Ehlers S/N Indicator, that tells you when NOT to trade - speaks for itself!
Any suggestions would be much appreciated - I'm a defecting MetaStock user and attempting to set up with NinjaTrader. Thanks much.
It's very straightforward to port over from EasyLanguage to Ninjascript.
However, most of the Ehlers implementations floating around out there are very, shall we say, naively coded. They include the typical beginner mistakes of failing to define reusable instances of external classes and calculating on every tick variables that only need to be calculated either once ONLY, or once per bar.
Which doesn't sound like something you would be interested in. Until you realize that the wasted CPU cycles contribute to Ninjatrader freezing up in fast markets.
"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett
This code shows how it can be modified to run better, especially on CalculateOnBarClose false.
Because redundant intrabar ticks that would not affect the value of the output are filtered out, the number of OnBarUpdate cycles executed on COBC false is reduced by as much as 90%. Many of the variables only need to be calculated once per bar, instead of on every tick as in the original, so each of those cycles is cheaper to run.
These techniques can easily be applied to virtually all of the Ehlers indicators.
Since this is a system indicator and the modifications were obvious, I don't see a problem with making it freely available.
Special thanks to Bill Dyer and Wilbur Whately.
"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett