Getting reference to NT7 internal like ToolBar or Chart Trader column - NinjaTrader Programming | futures io social day trading
futures io futures trading


Getting reference to NT7 internal like ToolBar or Chart Trader column
Updated: Views / Replies:1,801 / 6
Created: by Adamus Attachments:0

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

Getting reference to NT7 internal like ToolBar or Chart Trader column

  #1 (permalink)
Elite Member
London, UK
 
Futures Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker/Data: IB/IQFeed
Favorite Futures: EUR/USD
 
Adamus's Avatar
 
Posts: 1,085 since Dec 2010
Thanks: 470 given, 778 received

Getting reference to NT7 internal like ToolBar or Chart Trader column

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.
Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
London, UK
 
Futures Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker/Data: IB/IQFeed
Favorite Futures: EUR/USD
 
Adamus's Avatar
 
Posts: 1,085 since Dec 2010
Thanks: 470 given, 778 received


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.
Reply With Quote
 
  #4 (permalink)
Elite Member
Calcutta, India
 
Futures Experience: Intermediate
Platform: ArthaChitra
 
Posts: 278 since Jun 2009
Thanks: 161 given, 259 received

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
The following user says Thank You to bukkan for this post:
 
  #5 (permalink)
 Vendor: www.edevaay.com 
Al,India
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: RKG
Favorite Futures: NiftyFuture
 
devdas's Avatar
 
Posts: 1,547 since Feb 2010
Thanks: 1,460 given, 1,661 received


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
Reply With Quote
 
  #6 (permalink)
Elite Member
London, UK
 
Futures Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker/Data: IB/IQFeed
Favorite Futures: EUR/USD
 
Adamus's Avatar
 
Posts: 1,085 since Dec 2010
Thanks: 470 given, 778 received

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.
Reply With Quote
 
  #7 (permalink)
Elite Member
London, UK
 
Futures Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker/Data: IB/IQFeed
Favorite Futures: EUR/USD
 
Adamus's Avatar
 
Posts: 1,085 since Dec 2010
Thanks: 470 given, 778 received

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.
Reply With Quote

Reply



futures io > > > > > Getting reference to NT7 internal like ToolBar or Chart Trader column

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a 2nd Toolbar on a NT chart? fosch NinjaTrader Programming 6 October 6th, 2016 01:38 PM
Custom Toolbar Button for NT7 protrader007 The Elite Circle 38 February 24th, 2013 09:38 AM
Ninja Trader chart trader toggle? GaryD NinjaTrader 5 December 17th, 2011 12:40 AM
show poster's name in last post column LostTrader Feedback and Announcements 0 June 15th, 2011 11:04 AM
ninja trader object reference not set to an instance kk240 NinjaTrader Programming 4 December 29th, 2010 11:16 AM


All times are GMT -4. The time now is 03:27 AM.

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-18 in 0.10 seconds with 19 queries on phoenix via your IP 54.163.209.109