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)
Looking for NT7 CCI Indicator based on EMA and not SMA
For those of us who have no formal training in programming and learned to write indicators by hacking on indicators included with NinjaTrader .... we know what we do is not cutting edge ... and we make no pretense otherwise .... but for many trader's requests on futures.io (formerly BMT) ... they work well enough to get the job done ... think of us as the WalMart of custom programming ... we make indicators available to the masses....
No one disputes that your code is very efficient ... difficult to follow for the uneducated ... but efficient ... and Gawd knows.... NinjaTrader needs all the help it can get ... but the problem is not with your code... it's your delivery
I got Zondor'd when I posted a re-worked NT indicator and you posted a dire Warning that no one should download such an inefficient indicator for fear it would cause their machines to grind to a halt ... even though ... to this day it runs fine without incident
That's like :
Innocent Bystander: I need a car to drive back and forth to work but I can't afford to buy one.
TMFT: I have an old car you can have. It's not fancy but it starts and runs and will get you to work and back.
Zondor: Don't drive that car... it doesn't get good enough gas mileage .
I have rewritten my personal indicators with the sample code you sent me .... it works well and I have learned a lot from reading your code ... but had it not been for @Fat Tails support ... I probably would have quit posting indicators altogether after that...
You have a good message ... but you could stand a more efficient way of communicating it...
I'm just a simple man trading a simple plan.
My daddy always said, "Every day above ground is a good day!"
Found this quite funny, and I fixed it for you here:
Zondor: Don't drive that car... it doesn't get good enough gas mileage. And god will kill a kitten for every mile you drive in it.
Some indicators are quite terrible and can even crash NinjaTrader. But "most" indicators are "ok". Still, optimization is a good and noble goal, especially if you are going to use any of them in NT's backtester.
The version linked by Widman in post 13 is the one with lots of unnecessary arithmetic that I updated in post 10. I just updated it again to correct a minor error (detrender was not being updated on every tick) and to reduce the number of cycles through the OnBarUpdate block by about 70% on average with COBC false, but I can't seem to edit post 10 anymore. So here it is.
The adaptive cci makes calls to the alternate adaptive cci, which had the same problem of doing on every tick arithmetic that only needs to be done once per bar. So I cleaned that up too. I think. For posterity reasons.
The following italicized statment was NOT CORRECT !Cannot use predefined reusable instances for the calls to adaptive alternate cci because the parameters keep changing. This would have to be dealt with by incorporating the alternate cci code inside the adaptive cci code. That would be a nice coding project... for someone else.
The car mileage analogy is folksy and cute but not very appropriate. With typical badly coded indicators it's more like driving 500 miles to go across the street. Because the time scale is that of the computer clock you don't really notice it until there are enough indicators and charts to have a severe impact, or fast market conditions make the charts stop and lag. Of course, nobody should be using indicators anyway. Or charts for that matter.
I don't have any "formal training" and am not a professional programmer, have freely shared information about optimization techniques..... feel free to ignore my advice and use the "legacy" versions.
BTW, the adaptive CCI is not something I would be likely to use in my trading, so I updated it just for fun.
I hope everyone is enjoying today's market crashette.
NEW! I made additional changes which will FURTHER reduce CPU load AND memory consumption. Uploaded at 1:13 AM ET on October 23, I think.
It turned out that I COULD use reusable instances of the external Adaptive_Alternate_CCI. There were a couple of loops executing on every tick that only need to run once per bar. The internal arithmetic was changed from double precision to single precison because that is much cheaper to run and gives 7 significant digits, which are enough. The ten digit precision of the double precision numbers exceeds the precision of the output data so is spurious and unnecessary. Refer to SIGNIFICANT DIGITS
Latest version uploaded at 2:53 AM Oct 23. Previous version went just a little too far and did not work correctly on real time bars!
... folksy and cute but inappropriate .... I hear that a lot.... Wait ... Who am I kidding.... I have never been accused of being cute....
I appreciate your contributions ..... I have learned a lot from your reading your code ... I have re-written my personal indicators from your examples ... and just so you know... being "Zondor'd is considered a badge of honor....
I'm just a simple man trading a simple plan.
My daddy always said, "Every day above ground is a good day!"