NexusFi: Find Your Edge


Home Menu

 





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 10,549 views
    2. thumb_up 22 thanks given
    3. group 7 followers
    1. forum 12 posts
    2. attach_file 10 attachments




Closed Thread
 
Search this Thread

CMI Pivots and Fibonacci for NT7 - Mike's version

  #1 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,397 since Jun 2009
Thanks Given: 33,173
Thanks Received: 101,537

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 the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Attached Thumbnails
Click image for larger version

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

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

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

Name:	2-13-2010 1-57-44 AM.png
Views:	494
Size:	222.1 KB
ID:	8046  
Attached Files
Elite Membership required to download: CMIPivotsWeeklyV80.cs
Elite Membership required to download: CMICurrentDayOHLV80.cs
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
NexusFi Journal Challenge - April 2024
Feedback and Announcements
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Are there any eval firms that allow you to sink to your …
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
27 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #3 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 625 since Jan 2010
Thanks Given: 356
Thanks Received: 1,127


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 - [AUTOLINK]NinjaTrader[/AUTOLINK] 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.

Thanked by:
  #4 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,397 since Jun 2009
Thanks Given: 33,173
Thanks Received: 101,537

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 the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Attached Files
Elite Membership required to download: CMICurrentDayOHLV80.cs
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread
  #5 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 625 since Jan 2010
Thanks Given: 356
Thanks Received: 1,127

I'll take a look today.

Thanked by:
  #6 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 625 since Jan 2010
Thanks Given: 356
Thanks Received: 1,127

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
Elite Membership required to download: CMICurrentDayOHLV80.cs
Thanked by:
  #7 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,397 since Jun 2009
Thanks Given: 33,173
Thanks Received: 101,537

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 the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread
  #8 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102

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
Elite Membership required to download: SessionPivotsV16.zip
  #9 (permalink)
 
hoseman's Avatar
 hoseman 
belmont,ca
 
Experience: Intermediate
Platform: ninja
Broker: amp
Trading: es,nq,6b,6e,ym,tf
Posts: 16 since Jan 2010
Thanks Given: 31
Thanks Received: 6

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.

Thanked by:
  #10 (permalink)
 
gulabv's Avatar
 gulabv 
Dallas, TX
 
Experience: Beginner
Platform: Ninjatrader
Broker: Zen-Fire
Trading: ZN, 6E
Posts: 286 since May 2010
Thanks Given: 161
Thanks Received: 169


hoseman try this link

Thanked by:

Closed Thread



Last Updated on December 25, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts