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




 
Search this Thread

Getting reference to NT7 internal like ToolBar or Chart Trader column

  #1 (permalink)
 
Adamus's Avatar
 Adamus 
London, UK
 
Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker: IB/IQFeed
Trading: EUR/USD
Posts: 1,085 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 futures.io (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 Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
Increase in trading performance by 75%
The Elite Circle
Exit Strategy
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
34 thanks
Tao te Trade: way of the WLD
24 thanks
GFIs1 1 DAX trade per day journal
16 thanks
My NQ Trading Journal
14 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
13 thanks
  #3 (permalink)
 
Adamus's Avatar
 Adamus 
London, UK
 
Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker: IB/IQFeed
Trading: EUR/USD
Posts: 1,085 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 Twitter 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 Twitter 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,085 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 Twitter 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,085 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 Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on November 17, 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