CMI Pivots and Fibonacci for NT7 - Mike's version - futures io
futures io futures trading



CMI Pivots and Fibonacci for NT7 - Mike's version


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Big Mike with 4 posts (5 thanks)
    2. looks_two aslan with 3 posts (5 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 Fat Tails with 1 posts (8 thanks)
      Best Posters
    1. looks_one Fat Tails with 8 thanks per post
    2. looks_two gulabv with 2 thanks per post
    3. looks_3 aslan with 1.7 thanks per post
    4. looks_4 Big Mike with 1.3 thanks per post
    1. trending_up 8,771 views
    2. thumb_up 22 thanks given
    3. group 7 followers
    1. forum 12 posts
    2. attach_file 10 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

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

Closed Thread
 
Search this Thread
 

CMI Pivots and Fibonacci for NT7 - Mike's version

(login for full post details)
  #1 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,733 since Jun 2009
Thanks: 32,283 given, 97,466 received

When I switched to NT7 I couldn't find a CMI Pivots that worked natively, the latest version I found was 8.0.

So I just modified it to work with NT7 which wasn't hard, and then I modified it to give it the visual look I wanted and also add some features I wanted (added more levels). Screen shots below. There are two indicators at work here, the Weekly Pivots -- the only one I modified because it's the only one I use -- and the CurrentDay, which is also the one showing the Fibonacci levels and the yesterday high and low.

I have two problems with these.

1) They occasionally throw an exception. I can't show you the exception because it didn't happen today and I don't have a capture of it. But, the exception is in the Plot override, an out of index exception.

2) They do not auto-update as new day highs and lows are made.

In both cases, you can Ctrl-Shift-R to reload historical data in NT7 and get the chart to update. A simple F5 update doesn't work.

I could use some help!

a) Can you fix the exception? I've stared at it a bit too long, can't see it!
b) Can you fix the auto update?
c) I am pretty sure the original CMI allowed you to scroll back to prior chart days and the pivots would update as you did. I guess I broke that, probably part of problem 1 and 2, but can't figure out where/how I broke it.

Also, on occasion I have noticed the indicator will complain of "Insufficient historical data, load a longer chart period" or whatever the message is, even though I have 60 days of chart history (plenty for a weekly pivot). Sometimes Ctrl-Shift-R fixes it, sometimes I have to exit Ninja and reload. I am not sure if it's a Ninja bug or a CMI bug or a bug I introduced to the CMI code.

I trade CL only, so I set the number scaling to two digits. For 6E it will look funny probably. I also set the padding for two digits, so if trade ES the margin will be a bit off. You can change it in the code.

You'll want a right-margin of about 125 or 150 for these on your chart.

Attached. Please upload the fixes and share

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Attached Thumbnails
Click image for larger version

Name:	2-13-2010 1-55-02 AM.png
Views:	758
Size:	182.7 KB
ID:	8043   Click image for larger version

Name:	2-13-2010 1-55-35 AM.png
Views:	502
Size:	220.1 KB
ID:	8044   Click image for larger version

Name:	2-13-2010 1-56-41 AM.png
Views:	375
Size:	193.1 KB
ID:	8045   Click image for larger version

Name:	2-13-2010 1-57-44 AM.png
Views:	378
Size:	222.1 KB
ID:	8046  
Attached Files
Register to download File Type: cs CMIPivotsWeeklyV80.cs (61.7 KB, 168 views)
Register to download File Type: cs CMICurrentDayOHLV80.cs (51.6 KB, 157 views)
Follow me on Twitter Visit my futures io Trade Journal Started this thread
The following 4 users say Thank You to Big Mike for this post:

Journal Challenge February 2021 results (so far):
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(140 thanks from 28 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(106 thanks from 27 posts)
looks_3Wisdom is Emptinessby Mtype
(66 thanks from 24 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(30 thanks from 14 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #3 (permalink)
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
 
aslan's Avatar
 
Posts: 616 since Jan 2010
Thanks: 351 given, 1,109 received


I think the reason you are getting the exception occasionally, is that internals of how custom Plots() are a little different. The problem is LastBarPainted and BarsPainted are no longer always consistent. So, the current code is referencing bars that don't exist.

You need to do something like the following:

int lastbar = Math.Min(Bars.Count - 1, ChartControl.LastBarPainted);
int barspainted = lastbar - ChartControl.FirstBarPainted;

and then use those vars instead of ChartControl vars. FirstBarPainted is the only one that seems ok.

Here is a Ninja post about it: Internal NT ChartControl Inconsistencies - NinjaTrader Support Forum

This is sorta/kinda in the NT7 code breaking changes doc.

Why NT would have vars in their objects that are not consistent is a whole other issue.

The following user says Thank You to aslan for this post:
 
(login for full post details)
  #4 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,733 since Jun 2009
Thanks: 32,283 given, 97,466 received

aslan/anyone,

I replaced the variables as you suggested (attached), unfortunately the error persists. Any other ideas?

My changes start on line 1264/1265 with the lastbar/barspainted, then I replaced all the instances of LastBarPainted and BarsPainted with them.

 
Code
1/18/2010 12:00:00 AM Bar = 5237: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Collections.ArrayList.get_Item(Int32 index)
   at NinjaTrader.Data.MemBars.GetOpen(Int32 index)
   at NinjaTrader.Data.Bars.Get(Int32 index)
   at NinjaTrader.Indicator.CMICurrentDayOHL_V80.Plot(Graphics graphics, Rectangle bounds, Double min, Double max)
This one is driving me nuts.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Attached Files
Register to download File Type: cs CMICurrentDayOHLV80.cs (52.3 KB, 43 views)
Follow me on Twitter Visit my futures io Trade Journal Started this thread
 
(login for full post details)
  #5 (permalink)
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
 
aslan's Avatar
 
Posts: 616 since Jan 2010
Thanks: 351 given, 1,109 received

I'll take a look today.

The following user says Thank You to aslan for this post:
 
(login for full post details)
  #6 (permalink)
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
 
aslan's Avatar
 
Posts: 616 since Jan 2010
Thanks: 351 given, 1,109 received

Attached is an updated version of the indicator.

Changes:
* uncommented the pivot type parm to play with different types
* changed insufficent data checks, moved out of plot method

When I used this on NT7 B8, it was generally working. I looked thru your plot changes, and they all looked good, except one in the code that checks insufficent data (first bar time index should still be zero). I was not able to reproduce the exception when scrolling data.

For the auto-update on high/lows, they seem to work fine, but update at the end of the bar when CalcOnBarClose=true.

The scrolling back to prev days seemed to work fine as well. If you turn off autoscroll, you can see them correctly while you scroll back bar by bar.

The insufficent data checks were being checked in the Plot() method, so I moved them out to just check on the last bar of the chart. This may not be the intent of the original indicator.

The Plot() method could be cleaned up a bunch, but what is there is working.

Attached Files
Register to download File Type: cs CMICurrentDayOHLV80.cs (65.9 KB, 110 views)
The following 3 users say Thank You to aslan for this post:
 
(login for full post details)
  #7 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,733 since Jun 2009
Thanks: 32,283 given, 97,466 received

aslan,

Thanks! I will try it in the coming days, so far I couldn't get it to throw an exception.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Started this thread
 
(login for full post details)
  #8 (permalink)
Market Wizard
Berlin, Europe
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,855 since Mar 2010
Thanks: 4,238 given, 26,726 received

Hi Mike,

this is my first post on your forum. Hello to everybody.

There is a new version of the session pivots indicator available for NinjaTrader 7 ( file attached), and I would appreciate, if you tested it.

Some changes with respect to CMIPivots

(1) Plot Override adapted to code breaking changes, so I have not had any plot errors for this version so far.
(2) Loading of daily bars modified to avoid deadlock, may take a few seconds to load.
(3) Indicator checks for daily data (does not plot, if not complete).
(4) The session is no longer defined via indicator panel, but via the NT7 session manager. This is crucial: garbage in-> garbage out.
(5) For day session HLC and pivots just reduce the session length but use the correct session close.
(6) You may enter holidays. If you enter February 15 as a holiday (day after President's day) the indicator takes into account that there was no settlement on February 15, but all trades were for trade date next day. So for both February 15 and 16, pivot values are calculated from Friday's HLC,. HLC will also be shown for the combined session of February 15 and 16, and pivots for February 17 will be calculated for the combined session. Could do this, because NT 7allows me to drop the session times from the indicator menu.
(7) I only use floor pivots, but the indicator has other formulae, including an option "Wide" for a different way to calculate R3, S3, R4 and S4.

There is one issue related to NT7: NT7 does not close the daily bar after the session end, but continues to update this with the last price traded. This nonsense only stops at midnight local time. So in DailyBars mode you will likely get false pivots between session close and midnight per your PC clock. After midnight you need to disconnect and reconnect before you can use DailyBars again. If you set the indicator to CalcFromIntradayData this will not happen. Sorry, this is a NinjaTrader bug, and the indicator should behave in an orderly manner, once NT 7 does.

Please feel free to report any bugs.

Attached Files
Register to download File Type: zip SessionPivotsV16.zip (36.9 KB, 180 views)
The following 8 users say Thank You to Fat Tails for this post:
 
(login for full post details)
  #9 (permalink)
belmont,ca
 
Experience: Intermediate
Platform: ninja
Broker: amp
Trading: es,nq,6b,6e,ym,tf
 
hoseman's Avatar
 
Posts: 16 since Jan 2010
Thanks: 31 given, 6 received

Hello mike I have been searching the forum for 2 days now and can't seem to find a cci pivots indicator for ninja like the one you use on your charts. I realize you use multicharts, but was hoping someone had a version for ninja. I looked at jeffs cci but it looks like the indicator has been removed. I enjoyed your last webinar by the way thank you for giving traders some great real advice.

The following user says Thank You to hoseman for this post:
 
(login for full post details)
  #10 (permalink)
Dallas, TX
 
Experience: Beginner
Platform: Ninjatrader
Broker: Zen-Fire
Trading: ZN, 6E
 
gulabv's Avatar
 
Posts: 286 since May 2010
Thanks: 161 given, 167 received


hoseman try this link

The following 2 users say Thank You to gulabv for this post:
 
(login for full post details)
  #11 (permalink)
Scottsdale,AZ
 
Experience: Advanced
Platform: Ninja trader
Trading: ES, Currency Futures, Forex, oil, gold, EUR/USD
 
Hifive5's Avatar
 
Posts: 32 since Oct 2011
Thanks: 15 given, 22 received


Big Mike View Post
When I switched to NT7 I couldn't find a CMI Pivots that worked natively, the latest version I found was 8.0.

So I just modified it to work with NT7 which wasn't hard, and then I modified it to give it the visual look I wanted and also add some features I wanted (added more levels). Screen shots below. There are two indicators at work here, the Weekly Pivots -- the only one I modified because it's the only one I use -- and the CurrentDay, which is also the one showing the Fibonacci levels and the yesterday high and low.

I have two problems with these.

1) They occasionally throw an exception. I can't show you the exception because it didn't happen today and I don't have a capture of it. But, the exception is in the Plot override, an out of index exception.

2) They do not auto-update as new day highs and lows are made.

In both cases, you can Ctrl-Shift-R to reload historical data in NT7 and get the chart to update. A simple F5 update doesn't work.

I could use some help!

a) Can you fix the exception? I've stared at it a bit too long, can't see it!
b) Can you fix the auto update?
c) I am pretty sure the original CMI allowed you to scroll back to prior chart days and the pivots would update as you did. I guess I broke that, probably part of problem 1 and 2, but can't figure out where/how I broke it.

Also, on occasion I have noticed the indicator will complain of "Insufficient historical data, load a longer chart period" or whatever the message is, even though I have 60 days of chart history (plenty for a weekly pivot). Sometimes Ctrl-Shift-R fixes it, sometimes I have to exit Ninja and reload. I am not sure if it's a Ninja bug or a CMI bug or a bug I introduced to the CMI code.

I trade CL only, so I set the number scaling to two digits. For 6E it will look funny probably. I also set the padding for two digits, so if trade ES the margin will be a bit off. You can change it in the code.

You'll want a right-margin of about 125 or 150 for these on your chart.

Attached. Please upload the fixes and share

Mike

Hi BM,
I see you have the Fib. bands that are shown in your screen caps. Could you help me find the indicator? I really want it so I can start trading the ABC pattern. Attached is the one I found but it gives me an error when uploading to NT7.
Wish you a Merry Christmas and a Happy New Year

Regards;
HiFive5

Attached Files
Register to download File Type: cs Fib_Bands_BMT.cs (12.0 KB, 39 views)
 
(login for full post details)
  #12 (permalink)
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
 
Posts: 1,147 since Feb 2010
Thanks: 304 given, 839 received


Hifive5 View Post
Hi BM,
I see you have the Fib. bands that are shown in your screen caps. Could you help me find the indicator? I really want it so I can start trading the ABC pattern. Attached is the one I found but it gives me an error when uploading to NT7.
Wish you a Merry Christmas and a Happy New Year

Regards;
HiFive5

You also need the futures.io (formerly BMT)CollectiveMA.cs file, this file references it

The following user says Thank You to vegasfoster for this post:
 
(login for full post details)
  #13 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,733 since Jun 2009
Thanks: 32,283 given, 97,466 received


Hifive5 View Post
Hi BM,
I see you have the Fib. bands that are shown in your screen caps. Could you help me find the indicator? I really want it so I can start trading the ABC pattern. Attached is the one I found but it gives me an error when uploading to NT7.
Wish you a Merry Christmas and a Happy New Year

Regards;
HiFive5

This is about two years old, you most definitely do not want to use this - it is out of date and has problems. Use Fat Tails version in the downloads section instead.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Started this thread
The following user says Thank You to Big Mike for this post:

Closed Thread

futures io Trading Community Platforms and Indicators NinjaTrader > CMI Pivots and Fibonacci for NT7 - Mike's version


Last Updated on December 25, 2011


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1500 prizes from Topstep!

February
 

Identifying Setups & Targets Using Profile Charts w/Trevor & Tradovate

Feb 25
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
     



Copyright © 2021 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