Looking for NT7 CCI Indicator based on EMA and not SMA - NinjaTrader | futures io social day trading
futures io futures trading


Looking for NT7 CCI Indicator based on EMA and not SMA
Updated: Views / Replies:5,520 / 29
Created: by Nemesis Attachments:12

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 12  
 
Thread Tools Search this Thread
 

Looking for NT7 CCI Indicator based on EMA and not SMA

  #1 (permalink)
Hard working trader
Miami, Florida
 
Futures Experience: Master
Platform: Ninja Trader 7
Broker/Data: IQ Feed
Favorite Futures: Nasdaq Futures (NQ)
 
Posts: 7 since May 2010
Thanks: 0 given, 1 received

Looking for NT7 CCI Indicator based on EMA and not SMA

The CCI Indicator on NT is SMA based, since I use EMA on my charts I would like to know if there is anyone out there that has coded one with EMA in mind and not SMA.

Thank you much for your time and help.

Reply With Quote
 
  #2 (permalink)
Market Wizard
Columbus, OH
 
Futures Experience: None
Platform: NT 8, TOS
Favorite Futures: ES
 
Silvester17's Avatar
 
Posts: 3,332 since Aug 2009
Thanks: 4,579 given, 10,313 received


Nemesis View Post
The CCI Indicator on NT is SMA based, since I use EMA on my charts I would like to know if there is anyone out there that has coded one with EMA in mind and not SMA.

Thank you much for your time and help.

@Nemesis,

this is the standard cci indicator from nt, but instead of sma with ema.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Last edited by Silvester17; October 20th, 2012 at 09:40 AM. Reason: better version in next post
Reply With Quote
The following 4 users say Thank You to Silvester17 for this post:
 
  #3 (permalink)
Elite Member
Portland Oregon, United States
 
Futures Experience: Beginner
Platform: Ninjatrader®
Broker/Data: CQG, Kinetick
Favorite Futures: Gameplay Klownbine® Trading of Globex
 
Zondor's Avatar
 
Posts: 1,327 since Jul 2009
Thanks: 1,246 given, 2,635 received

cci ema


If the goal was to code an indicator that would waste as many CPU cycles as possible by calculating the same things over and over again, this was a brilliant success.

I will edit this post shortly to update a revised version.

OK, 20 minutes later, the wiseguy is back as promised, and here it is. It's obvious from the code that the loop that was previously executed on every tick is now executed only once per bar, and that the value of the EMA, previously calculated (period +1) times on every TICK, is now only calculated once per tick. (You can't rely on Ninjatrader's unreliable built in caching mechanism to ensure that these repetitive calculations do not happen.)

Of course, I also am using a predefined reusable instance of the EMA class to avoid having to create a new instance thereof on every bar, or to rely on the hope that Ninjatrader's creaky caching mechanism would render that expensive repetitive instantiation operation unnecessary.

However, benchmark testing is not included in my fee so the only thing to go on right now is the above analysis.

I also added multi colored plotting. To compensate for the reduced cpu load, I greatly lengthened the description of the indicator, written in classic Ninjatrader Gibberish style.

Default for COBC is now false. I am confident that performance will still be more than adequate.

I could also use the IDataseries trick to allow the calculation to be done with an MA selected from lots of different types of MA's in an Enum. Which other MA's would we like to see?

Saturday afternoon update. In the cold light of day I realized that I had over optimized. The expression within the loop depends on the current value of the EMA, which can change intrabar. Therefore the loop needs to run and the indicator needs to be updated not just OnFirstTickOfBar, but whenever the value of the EMA changes. But that is a lot less often than on every tick so there is still a huge reduction in CPU use compared to the original code. Code updated at 435PM PT October 20.

Attached Files
Register to download File Type: cs CCIema2.cs (12.6 KB, 53 views)

Last edited by Zondor; October 20th, 2012 at 08:32 PM.
Reply With Quote
The following 8 users say Thank You to Zondor for this post:
 
  #4 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,238 since Jun 2009
Thanks: 29,350 given, 83,217 received


Zondor View Post
If the goal was to code an indicator that would waste as many CPU cycles as possible by calculating the same things over and over again, this was a brilliant success.

I will edit this post shortly to update a revised version.

I'd also like to see benchmark results...



Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #5 (permalink)
Market Wizard
Columbus, OH
 
Futures Experience: None
Platform: NT 8, TOS
Favorite Futures: ES
 
Silvester17's Avatar
 
Posts: 3,332 since Aug 2009
Thanks: 4,579 given, 10,313 received


Zondor View Post
If the goal was to code an indicator that would waste as many CPU cycles as possible by calculating the same things over and over again, this was a brilliant success.

I will edit this post shortly to update a revised version.

OK, 20 minutes later, the wiseguy is back as promised, and here it is. It's obvious from the code that the loop that was previously executed on every tick is now executed only once per bar, and that the value of the EMA, previously calculated (period +1) times on every TICK, is now only calculated once per tick. (You can't rely on Ninjatrader's unreliable built in caching mechanism to ensure that these repetitive calculations do not happen.)

Of course, I also am using a predefined reusable instance of the EMA class to avoid having to create a new instance thereof on every bar, or to rely on the hope that Ninjatrader's creaky caching mechanism would render that expensive repetitive instantiation operation unnecessary.

However, benchmark testing is not included in my fee so the only thing to go on right now is the above analysis.

I also added multi colored plotting. To compensate for the reduced cpu load, I greatly lengthened the description of the indicator, written in classic Ninjatrader Gibberish style.

Default for COBC is now false. I am confident that performance will still be more than adequate.

I could also use the IDataseries trick to allow the calculation to be done with an MA selected from lots of different types of MA's in an Enum. Which other MA's would we like to see?

@Zondor,

thank you very much for your improved version.

and no, the goal was not to code an indicator that would waste as many CPU cycles as possible. that's exactly why I specifically wrote: this is the standard cci indicator from nt

Reply With Quote
The following 2 users say Thank You to Silvester17 for this post:
 
  #6 (permalink)
Elite Member
Chicago Illinois USA
 
Futures Experience: Advanced
Platform: Ninja Trader
Broker/Data: IB
Favorite Futures: duh hammer!
 
wldman's Avatar
 
Posts: 2,067 since Aug 2011
Thanks: 967 given, 2,618 received

I love Mike Winfrey's acci..

@Zondor, would you consider taking a look at Winfrey's adaptive cci with the same critical eye. You are quite the wise guy...but I think I'm starting to understand your tone better.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


I think that Mike's has a lot of code that I am not using. Just wonder if this version is a hog like you described or if cleaning out the unused code would make any difference.

Reply With Quote
 
  #7 (permalink)
Elite Member
Houston,Tx
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: TF
 
ThatManFromTexas's Avatar
 
Posts: 2,302 since Feb 2010
Thanks: 1,208 given, 4,293 received


Silvester17 View Post
@Zondor,

thank you very much for your improved version.

and no, the goal was not to code an indicator that would waste as many CPU cycles as possible. that's exactly why I specifically wrote: this is the standard cci indicator from nt

@Silvester17

Congratulations ... you are now part of the elite group who have been Zondor'd ... that means you have unselfishly given of your time and written enough free indicators to catch the attention of he who stands watch over us mortal coders from on high ... and guides us down the path of the straight and narrow ...


Disclaimer: This post does not represent the view point of the owners, managers, or moderators of this web site and is not intended as a slam against any moderator, board member, any banned former members whose name we dare not say, any other living person, any recently living person or any person or persons whose status we are not sure of and especially not for any platform vendor with a questionable product and a pit bull lawyer. This post is meant purely for entertainment and should not be confused with a real thought.

I am not a programmer, coach, trainer or self appointed guru and do NOT hold myself up to be a good example for anything. I do not have a book, trading room or seminar. Even though I have an opinion on every subject under the sun, I do not give financial advice. Nor should I be held responsible for feeble attempts at humor at your expense. This post is meant purely for entertainment and should not be confused with a real thought.

I'm just a simple man trading a simple plan.

My daddy always said, "Every day above ground is a good day!"
Reply With Quote
 
  #8 (permalink)
Elite Member
Portland Oregon, United States
 
Futures Experience: Beginner
Platform: Ninjatrader®
Broker/Data: CQG, Kinetick
Favorite Futures: Gameplay Klownbine® Trading of Globex
 
Zondor's Avatar
 
Posts: 1,327 since Jul 2009
Thanks: 1,246 given, 2,635 received

Learn from code examples. Please!

If some of you guys would think about the changes I make and start using those techniques in your code, my sarcastic tone would miraculously change to one of sweetness. There is a thread regarding optimization of C# code that hasn't been very active lately, but I consider it to be very important. Unless you never use any indicators.

Where can I find the Winfrey Adaptive CCI?


Last edited by Zondor; October 20th, 2012 at 04:32 PM.
Reply With Quote
The following 2 users say Thank You to Zondor for this post:
 
  #9 (permalink)
Elite Member
Tucson AZ/USA
 
Futures Experience: Beginner
Platform: TradeNavigator
Favorite Futures: ES
 
casey44's Avatar
 
Posts: 133 since Jan 2010
Thanks: 1,923 given, 124 received


Zondor View Post
Where can I find the Winfrey Adaptive CCI?


@Zondor, best to hear from Wldman but think it's in this thread he initiated on the topic.
https://futures.io/ninjatrader/13412-adaptive-cycle-period-cci-2.html

Mwinfrey, post 20: “The Adaptive_CCI and Alternate_Adaptive_CCI indicators are ones that a friend and I developed a very long time ago. I updated them a bit and got them running on NT7. Posted them at the link below. Let me know what you think about them.
https://futures.io/download/vip_elite_circle/988-download.html?view

Reply With Quote
 
  #10 (permalink)
Elite Member
Portland Oregon, United States
 
Futures Experience: Beginner
Platform: Ninjatrader®
Broker/Data: CQG, Kinetick
Favorite Futures: Gameplay Klownbine® Trading of Globex
 
Zondor's Avatar
 
Posts: 1,327 since Jul 2009
Thanks: 1,246 given, 2,635 received

Adaptive CCI and update of CCIema


Thanks for link, Casey.

Anyone using my version of CCIema please see edit to https://futures.io/ninjatrader/23871-looking-ninjatrader-7-cci-indicator-based-ema-not-sma.html#post273256 above and update to latest cs file attached to that post.

The Adaptive CCI had a huge amount of arithmetic on every tick that only needs to be done once per bar. This is typical of the amateurish way that Ehlers indicators have been coded for Ninjatrader.

I really hit the jackpot by moving a switch in OnBarUpdate where it was running on every tick, to OnStartUp(), where it only runs ONCE. That's ONE TIME ONLY, not once per bar.

With the reduction of unnecessary arithmetic, this should run OK on the new default of COBC false. The number of executions of OnBarUpdate could be further reduced around 70% by not responding to redundant intrabar ticks. I will leave that to someone else to implement. It takes three lines of code.

I made some changes, but did not test it at all. At this point all I know is that it compiles. You guys are welcome to check it. Look for multiple /// marks where the changes were made.

Updated the file at 616PM PT. Added instantiation of the array of intrabar invariant Doubles to Initialize block. Updated display name for period of EMA used for slope calculation. Changed default plot colors.

Attached Files
Register to download File Type: cs Adaptive_CCI.cs (38.8 KB, 48 views)

Last edited by Zondor; October 20th, 2012 at 10:17 PM. Reason: added file for Adaptive CCI
Reply With Quote
The following 7 users say Thank You to Zondor for this post:

Reply



futures io > > > > Looking for NT7 CCI Indicator based on EMA and not SMA

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
EMA for CCI perryg NinjaTrader Programming 7 January 19th, 2012 09:45 AM
Dual MA system using the ZLTEMA EMA and SMA Wendell Day NinjaTrader Programming 2 December 12th, 2011 03:19 PM
The SMA/EMA/HMA 3-target method (automated) Big Mike Elite Automated NinjaTrader Trading 54 July 29th, 2011 06:26 AM
Exit using CCI Indicator kian123 NinjaTrader Programming 4 November 17th, 2010 09:23 AM
CCI Fibonacci Indicator wh NinjaTrader Programming 6 November 4th, 2009 07:19 PM


All times are GMT -4. The time now is 03:17 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-11 in 0.15 seconds with 20 queries on phoenix via your IP 54.226.172.30