NexusFi: Find Your Edge


Home Menu

 





Getting reference to NT7 internal like ToolBar or Chart Trader column


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Adamus with 4 posts (0 thanks)
    2. looks_two bukkan with 1 posts (1 thanks)
    3. looks_3 devdas with 1 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 3,277 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
Adamus's Avatar
 Adamus 
London, UK
 
Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker: IB/IQFeed
Trading: EUR/USD
Posts: 1,064 since Dec 2010
Thanks Given: 471
Thanks Received: 789

With charts, there are quite a few things I do all the time that I'd like to be able to execute with a click on a button instead of manually.

I could put it on the ToolBar but since I have Chart Trader open all the time, I figure I can put bigger buttons on the Chart Trader panel, and there's a lot of space on it.

This is the line that grabs the chart's toolstrip, I guess?

 
Code
ToolStrip toolStrip = (ToolStrip)  ChartControl.Controls["tsrTool"];
I lifted that from someone else's indicator here on NexusFi (formerly BMT).

Does anyone know what the code would be to grab the Chart Trader button bar? Or does anyone know how I'd find out?

Thanks.


You can discover what your enemy fears most by observing the means he uses to frighten you.
Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Oil Surges ~18% in One Week as Iran Conflict Disrupts Gl …
Commodities
Five Days Until the Gap Dies -- CME Goes 24/7 on All Dig …
Traders Hideout
Topstep Acquires The Futures Desk -- Prop Firm Consolida …
Funded Trading Evaluation Firms
$12M Ceasefire Contract Goes Disputed as Bandar Abbas St …
Prediction Markets & Event Contracts
The 50/50 Paradox: Peace and Invasion Each at 20% -- Ira …
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
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
  #3 (permalink)
 
Adamus's Avatar
 Adamus 
London, UK
 
Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker: IB/IQFeed
Trading: EUR/USD
Posts: 1,064 since Dec 2010
Thanks Given: 471
Thanks Received: 789


It's simple stuff I want to do. I want to put a button on the Chart Trader that will centre the current price to the middle of the y-axis.


You can discover what your enemy fears most by observing the means he uses to frighten you.
Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #4 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271

Control ctrader = ChartControl.Controls["pnlChartTrader"].Controls["ctrChartTraderControl"];

i have posted some codes relating to the same sometimes back. pls search my posts you will get the same.


Reply With Quote
Thanked by:
  #5 (permalink)
 
devdas's Avatar
 devdas 
Al,India
 
Experience: Advanced
Platform: NinjaTrader
Broker: Z
Trading: NiftyFuture
Posts: 1,562 since Feb 2010
Thanks Given: 1,513
Thanks Received: 1,701


Adamus View Post
It's simple stuff I want to do. I want to put a button on the Chart Trader that will centre the current price to the middle of the y-axis.

you can try vertical scroll tool indi, it has an option to keep current price in middle in 'Centre' AutoScroll mode. Have a look ,if it solve ur purpose.


Harvest The Moon
Nest The Market
Follow me on X Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 
Adamus's Avatar
 Adamus 
London, UK
 
Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker: IB/IQFeed
Trading: EUR/USD
Posts: 1,064 since Dec 2010
Thanks Given: 471
Thanks Received: 789

Thanks for the advice. The other thing I need is a quick button to toggle the trades on and off.


You can discover what your enemy fears most by observing the means he uses to frighten you.
Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #7 (permalink)
 
Adamus's Avatar
 Adamus 
London, UK
 
Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker: IB/IQFeed
Trading: EUR/USD
Posts: 1,064 since Dec 2010
Thanks Given: 471
Thanks Received: 789

Just lost my post! Guess I must have hit preview instead of submit.

Here it is again.

I put together an indicator to put buttons onto the Chart Trader panel which I use a lot.

The buttons don't do anything yet - that's the next challenge. The first button is meant to toggle the trade display on or off, the second centres the price on the Y-axis. I'll look at the vertical scroll tool indi and I'll search around for the rest, but if anyone's got any more help, that'd be totally appreciated.

 
Code
#region Using declarations
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Resources;
using System.Windows.Forms;
using System.Collections;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
#endregion

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Indicator
{
    /// <summary>
    /// Enter the description of your Indicator here
    /// </summary>
    [Description("Indicator to add chart trader buttons")]
    public class ChartTraderExtra : Indicator
    {
        protected bool Initialized = false;
        private Button toggleTradesButton = null;        
        private Button centrePriceButton = null;        
                        
        public override void Dispose()
        {
            if (Initialized)
            {
                if (ChartControl != null)
                {
                    Panel panel = (Panel) ChartControl.Controls["pnlChartTrader"];
                    if (panel != null 
                        && panel.Controls["ctrChartTraderControl"] != null
                        && toggleTradesButton != null)
                    {
                        Control control = panel.Controls["ctrChartTraderControl"];
                        control.Controls.Remove(toggleTradesButton);
                        control.Controls.Remove(centrePriceButton);
                        toggleTradesButton.Click -= new EventHandler(toggleTrades_Click);
                        centrePriceButton.Click -= new EventHandler(centrePrice_Click);
                    }
                }
            }
        }
        
        protected virtual void OnInitializeBeforeStart()
        {
            CreateChartTraderButtons();
        }
                
        protected override void Initialize()
        {
            Overlay = true;
            CalculateOnBarClose = true;
        }

        
        protected override void OnBarUpdate()
        {
            if (!Initialized)
            {
                OnInitializeBeforeStart();
                Initialized = true;
                Panel panel = (Panel) ChartControl.Controls["pnlChartTrader"];
                if (false // remove "false" for debugging
                    && panel != null 
                    && panel.Controls["ctrChartTraderControl"] != null)
                {
                    Control control = panel.Controls["ctrChartTraderControl"];
                    for (int k = 0; k <= control.Controls.Count - 1; k++)
                    {
                        Control button = control.Controls[k];
                        string msg = button.Name 
                            + " L:" + button.Left
                            + " T:" + button.Top
                            + " H:" + button.Height
                            + " W:" + button.Width;
                        Log(msg, NinjaTrader.Cbi.LogLevel.Alert);
                    }
                }
            }
        }
        
        protected void CreateChartTraderButtons()
        {
            if (ChartControl != null)
            {
                Panel panel = (Panel) ChartControl.Controls["pnlChartTrader"];
                if (panel != null 
                    && panel.Controls["ctrChartTraderControl"] != null)
                {
                    Control control = panel.Controls["ctrChartTraderControl"];
                    toggleTradesButton = new Button();
                    toggleTradesButton.Name = "toggleTrades";
                    toggleTradesButton.Text = "Toggle Trades";
                    toggleTradesButton.Height = 40;
                    toggleTradesButton.Width = 72;
                    toggleTradesButton.Left = 8;
                    toggleTradesButton.Top = 436;
                    toggleTradesButton.Click += new EventHandler(toggleTrades_Click);
                    control.Controls.Add(toggleTradesButton);
                    centrePriceButton = new Button();
                    centrePriceButton.Name = "centrePrice";
                    centrePriceButton.Text = "Centre Price";
                    centrePriceButton.Height = 40;
                    centrePriceButton.Width = 72;
                    centrePriceButton.Left = 88;
                    centrePriceButton.Top = 436;
                    centrePriceButton.Click += new EventHandler(centrePrice_Click);
                    control.Controls.Add(centrePriceButton);
                }
            }
        }
        
        private void toggleTrades_Click(object sender, EventArgs e)
        {
            Log("toggle trades!", NinjaTrader.Cbi.LogLevel.Alert);
        }    

        private void centrePrice_Click(object sender, EventArgs e)
        {
            Log("centre price!", NinjaTrader.Cbi.LogLevel.Alert);
        }    
    }
}


You can discover what your enemy fears most by observing the means he uses to frighten you.
Follow me on X Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on November 17, 2011


© 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