NT-7 Context Menu Items - NinjaTrader Programming | futures io social day trading
futures io futures trading


NT-7 Context Menu Items
Updated: Views / Replies:4,777 / 10
Created: by Prtester Attachments:2

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
 2  
 
Thread Tools Search this Thread
 

NT-7 Context Menu Items

  #1 (permalink)
Elite Member
SE-Asia
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Amp
Favorite Futures: ES
 
Posts: 141 since Jun 2009
Thanks: 57 given, 114 received

NT-7 Context Menu Items

Anyone work with Context Menu Items in NT-7?, I have a working indicator in 6.5 , but the code break in nt7.

the problem is with this line :
int event1 = ChartControl.ContextMenu.MenuItems.Add(0, menuItem1);

it throw an exception ("Object reference not set to an instance of an object.")

Reply With Quote
 
  #2 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,572 given, 3,982 received


Prtester View Post
Anyone work with Context Menu Items in NT-7?, I have a working indicator in 6.5 , but the code break in nt7.

the problem is with this line :
int event1 = ChartControl.ContextMenu.MenuItems.Add(0, menuItem1);

it throw an exception ("Object reference not set to an instance of an object.")

Can you provide the NT 6.5 code ?

Success requires no deodorant! (Sun Tzu)
Reply With Quote
The following user says Thank You to sam028 for this post:
 
  #3 (permalink)
Elite Member
SE-Asia
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Amp
Favorite Futures: ES
 
Posts: 141 since Jun 2009
Thanks: 57 given, 114 received



sam028 View Post
Can you provide the NT 6.5 code ?

Not complete but here are the important sections:

On BarUpdate section:

if (!inited && ChartControl!=null )
{
MenuItem menuItem1 = new MenuItem("My Option-1", new EventHandler(MyOption1));
MenuItem menuItem2 = new MenuItem("My Option-2, new EventHandler(MyOption2));
int event1 = ChartControl.ContextMenu.MenuItems.Add(0, menuItem1);
int event2 = ChartControl.ContextMenu.MenuItems.Add(1, menuItem2);
int event4 = ChartControl.ContextMenu.MenuItems.Add(3, new MenuItem("-"));
ChartControl.MouseDown += new MouseEventHandler(OnMouseClick);
inited=true;
}

public void MyOption1(object sender, EventArgs e)
{
in here insert your action code
}

public void MyOption2(object sender, EventArgs e)
{
in here insert your action code
}
protected override void Dispose()
{
if (inited && ChartControl!=null)
{
ChartControl.ContextMenu.MenuItems.RemoveAt (1);
ChartControl.ContextMenu.MenuItems.RemoveAt (0);
ChartControl.ChartPanel.MouseDown -= new MouseEventHandler (this.OnMouseClick);

inited = false;
}
base.Dispose ();
}

Reply With Quote
 
  #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,218 received



I would like to know as well.

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)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,572 given, 3,982 received

Prtester, with only the piece of code included, it's very hard to make something working on NT 6.5.
So, very hard to find what's wrong with NT 7.0...

Success requires no deodorant! (Sun Tzu)
Reply With Quote
 
  #6 (permalink)
Elite Member
SE-Asia
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Amp
Favorite Futures: ES
 
Posts: 141 since Jun 2009
Thanks: 57 given, 114 received


sam028 View Post
Prtester, with only the piece of code included, it's very hard to make something working on NT 6.5.
So, very hard to find what's wrong with NT 7.0...

Try with this Sam

Attached Files
Register to download File Type: cs Sam28_test.cs (6.1 KB, 54 views)
Reply With Quote
 
  #7 (permalink)
 Vendor: www.tradingstudies.com 
Denver, CO
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: TF, ES, CL
 
roonius's Avatar
 
Posts: 132 since Jun 2009
Thanks: 20 given, 272 received


Prtester View Post
Anyone work with Context Menu Items in NT-7?, I have a working indicator in 6.5 , but the code break in nt7.

the problem is with this line :
int event1 = ChartControl.ContextMenu.MenuItems.Add(0, menuItem1);

it throw an exception ("Object reference not set to an instance of an object.")

NT 7 upgraded ContextMenu to ContextMenuStrip.
You can see quick sample how to implement Context Menu Items in the attached file.
To PrTester and others: Please DO NOT bypass TriggerCustomEvent or you can end up messing up internal NinjaTrader Events and get unpredictable results and/or behavior.

P.S. Attached file is for NT7 only. NT 6.5 users do not bother trying it.

Attached Files
Register to download File Type: zip CtxMenu.zip (1.7 KB, 188 views)
Reply With Quote
The following 12 users say Thank You to roonius for this post:
 
  #8 (permalink)
Elite Member
SE-Asia
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Amp
Favorite Futures: ES
 
Posts: 141 since Jun 2009
Thanks: 57 given, 114 received


roonius View Post
NT 7 upgraded ContextMenu to ContextMenuStrip.
You can see quick sample how to implement Context Menu Items in the attached file.
To PrTester and others: Please DO NOT bypass TriggerCustomEvent or you can end up messing up internal NinjaTrader Events and get unpredictable results and/or behavior.

P.S. Attached file is for NT7 only. NT 6.5 users do not bother trying it.

Thank you Sir :-), I will try to not mess my NT

Reply With Quote
 
  #9 (permalink)
Elite Member
UK
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: ib
Favorite Futures: Electric Guitar
 
Mindset's Avatar
 
Posts: 355 since Sep 2009
Thanks: 88 given, 285 received

contextmenustrip

Roonius
Thanks for the code example - I am slightly confused though. You declare ToolStripitems yet place them in a contextmenustrip.
I haven't worked out what ontermination() does yet eitherbut I have only had beta for a day - it can't be instead of dispose which is where I would have put this code previously. EDIT -YES IT IS- NT7 does away with Dispose()

Just as I thought I had some kind of handle on NS it all changes (lol)

Edit - when you hover the mouse over Trigger Custom Event it now urges you to use another signature as it is deprecated?? Oops I see the new signature.
I have spent a fruitless 3 hours trying to get my menu to work using this Code structure but it won't.
I shall have to see if support can help ( that should be a laugh!)
Sorted it myself with Roonius' code example above.


Last edited by Mindset; December 22nd, 2009 at 03:21 PM.
Reply With Quote
 
  #10 (permalink)
Elite Member
UK
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: ib
Favorite Futures: Electric Guitar
 
Mindset's Avatar
 
Posts: 355 since Sep 2009
Thanks: 88 given, 285 received

Thanks Roonius


Big thanks to Roonius for supplying the context menu snippet - saved me hours of searching.
I am brand new to NT7 and without that concept of ContextMenuStrip I have no idea how long it would have taken me to sort out.

Reply With Quote

Reply



futures io > > > > > NT-7 Context Menu Items

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
Greek Restructuring: Off the Table, Not Off the Menu Quick Summary News and Current Events 0 June 1st, 2011 06:50 AM
Today's ES context cleon Emini Index Futures Trading 1 April 8th, 2011 11:42 AM
Simple template to convert NT Strategy to NT IUndicator visounds NinjaTrader Programming 4 March 31st, 2011 08:16 AM
How to Capture Context in Designing Trading Strategies? aviat72 The Elite Circle 4 July 23rd, 2010 01:36 AM
NT 6.5 issue - image sometimes stays on screen after I close NT window Todd The Elite Circle 11 March 19th, 2010 10:14 AM


All times are GMT -4. The time now is 07:05 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.12 seconds with 20 queries on phoenix via your IP 54.92.194.75