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 Big Mike with 1 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 tony98 with 1 posts (0 thanks)
    1. trending_up 7,362 views
    2. thumb_up 4 thanks given
    3. group 6 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread
  #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?
Iran Airspace Contract Surges to 33.5% as Project Freedo …
Prediction Markets & Event Contracts
Khamenei Vetoes Uranium Transfer as Peace Odds Surge to …
Prediction Markets & Event Contracts
Fabrication or Framework? Irans Denied MOU Explains the …
Prediction Markets & Event Contracts
CME Lists U.S. Election Event Contracts as 2028 Democrat …
Prediction Markets & Event Contracts
Warsh Confirmed 54-45 on PPI Day -- 97% Say He Holds in …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #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,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,557




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 X 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


© 2026 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 - Downloads - Top
no new posts