NexusFi: Find Your Edge


Home Menu

 





Adding a 2nd Toolbar on a NT chart?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one fosch with 2 posts (0 thanks)
    2. looks_two bukkan with 1 posts (4 thanks)
    3. looks_3 estradingforum with 1 posts (0 thanks)
    4. looks_4 Big Mike with 1 posts (0 thanks)
    1. trending_up 6,540 views
    2. thumb_up 4 thanks given
    3. group 6 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread

Adding a 2nd Toolbar on a NT chart?

  #1 (permalink)
 fosch 
Bethesda, Maryland
 
Experience: Intermediate
Platform: NinjaTrader
Trading: stocks
Posts: 5 since May 2011
Thanks Given: 36
Thanks Received: 2

My first post to Big Mike's... I'm trying to add a 2nd toolbar to the default NT toolbar on a chart. I've managed to find code that enables me to add buttons on the same default NT toolbar. However, I would like to add a new toolbar just below the default one. I'm sure this is something simple, but I'm just not there yet.

Help.

-fosch

Here is the code that I used to add my buttons to the first toolbar... (perhaps it's just a tweak, or a couple lines of code to get my 2nd toolbar?)

#region Variables

private System.Windows.Forms.ToolStrip strip = null;
private System.Windows.Forms.Control[] controls = null;
private System.Windows.Forms.ToolStripButton btnOrderType = null;

protectedoverridevoid OnStartUp()
{
System.Windows.Forms.Control[] controls = ChartControl.Controls.Find("tsrTool", false);

if (controls.Length > 0)
{
ToolStripButton btnTemp = new System.Windows.Forms.ToolStripButton("temp");
boldFont = new Font("Arial", 8,FontStyle.Bold);
regularFont = new Font("Arial", 8);
btnTemp = null;

strip = (System.Windows.Forms.ToolStrip)controls[0];
//BUTTON #1 -- Order Type Button (STPLMT, LIMIT) -------------------
btnOrderType = new System.Windows.Forms.ToolStripButton("btnOrderType");
btnOrderType.Font =regularFont;
btnOrderType.ForeColor = Color.Black;
btnOrderType.BackColor=Color.Orange;
btnOrderType.Text = "SL";
strip.Items.Add(btnOrderType);
btnOrderType.Click += btnOrderType_Click;
//--------------------------------------------------------------------
buttonsloaded=true;
}
}

protectedoverridevoid OnTermination() {
if (buttonsloaded==true)
{
strip.Items.Remove(btnOrderType); //Button #1
} }

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Quant vue
Trading Reviews and Vendors
What broker to use for trading palladium futures
Commodities
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
About a successful futures trader who didn´t know anyth …
Psychology and Money Management
ZombieSqueeze
Platforms and Indicators
 
  #3 (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,463 since Jun 2009
Thanks Given: 33,239
Thanks Received: 101,662




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 Reply With Quote
  #4 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271

you have to add the toolstrip in the chartcontrol. like

ToolStrip ts = new ToolStrip();
ChartControl.Controls.Add(ts);

Reply With Quote
  #5 (permalink)
 fosch 
Bethesda, Maryland
 
Experience: Intermediate
Platform: NinjaTrader
Trading: stocks
Posts: 5 since May 2011
Thanks Given: 36
Thanks Received: 2


bukkan View Post
you have to add the toolstrip in the chartcontrol. like

ToolStrip ts = new ToolStrip();
ChartControl.Controls.Add(ts);

Many thanks bukkan!!!

Started this thread Reply With Quote
  #6 (permalink)
tony98
canada
 
Posts: 1 since Jan 2011
Thanks Given: 1
Thanks Received: 0

hi bukkan,

I used your code:
you have to add the toolstrip in the chartcontrol. like

ToolStrip ts = new ToolStrip();
ChartControl.Controls.Add(ts);

but I cannot remove the strip OnTermination:

I am trying ChartControl.Controls.Remove(ts);
but it creates multiple strips if i run the indicator again. Any ideas? Thanks.

Tony

Reply With Quote
  #7 (permalink)
 estradingforum 
Santa Ana, CA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 7 since Nov 2010
Thanks Given: 0
Thanks Received: 1

Code to add buttons means is that new indicator needs to be created or strategy or something else?

Thanks.

Reply With Quote




Last Updated on October 6, 2016


© 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