Moving the ChartTrader buttons down - NinjaTrader | futures io social day trading
futures io futures trading


Moving the ChartTrader buttons down
Updated: Views / Replies:1,678 / 11
Created: by Otterly Attachments:1

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

Moving the ChartTrader buttons down

  #1 (permalink)
Elite Member
Zurich, Switzerland
 
Futures Experience: Intermediate
Platform: Ninja, CTS, TOS
Favorite Futures: ES, TF, CL, NQ, GC
 
Otterly's Avatar
 
Posts: 130 since Aug 2011
Thanks: 251 given, 57 received

Moving the ChartTrader buttons down

At the moment when ChartTrader is opened on the right side of the chart, the buttons are aligned from the top.

Is there a way, to amend the code, to make a gap at the top? So that all the buttons are pushed downwards a certain number of pixels?

My screen is very tall, and the buttons are all at the top, I want to move them down so they are closer to the middle/bottom of the screen.

Thanks for any help.

Reply With Quote
 
  #2 (permalink)
Elite Member
glostrup, denmark
 
Futures Experience: Advanced
Platform: Custom platform
Broker/Data: CQG
Favorite Futures: Futures, Options, Stocks
 
ktrader's Avatar
 
Posts: 249 since Aug 2011
Thanks: 151 given, 274 received

One way....

One way of doing it is to move the buttons from code, for example an indicator (or other code you are running that have access to the chart-window).

here is a rough example of how to do it in an indicator:

Just set the "pixels" variable to whatever number of pixels you want the buttons to be moved down.

 
Code
Namespace NinjaTrader.Indicator
{
    /// <summary>
    /// Enter the description of your new custom indicator here
    /// </summary>
    [Description("Enter the description of your new custom indicator here")]
    public class MoveButtons : Indicator
    {
        #region Variables
			
        // User defined variables (add any user defined variables below)
			private int pixels = 100;
        #endregion

        /// <summary>
        /// This method is used to configure the indicator and is called once before any bar data is loaded.
        /// </summary>
        protected override void Initialize()
        {
			this.Overlay=true;
		}

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            // Use this method for calculating your indicator values. Assign a value to each
            // plot below by replacing 'Close[0]' with your own formula.

			if (CurrentBar==0) {			
				
								
				Control.ControlCollection ccol = ChartControl.Controls;	
				Control ch = ccol["pnlChartTrader"];
				if (ch!=null) {
					Control ct = ch.Controls["ctrChartTraderControl"];					
					if (ct!=null) {
						Control tb = ct.Controls["btnChartTraderVisible"];
						if (tb!=null) {
							if (tb.Top==0) {
								int cclen = ct.Controls.Count;
								for (int i=0;i<cclen;i++) {
									ct.Controls[i].Top+=pixels;
								}
							}
						}					
					}
				}
			}

        }

        #region Properties

        #endregion
    }
}
--ktrader


Last edited by ktrader; July 17th, 2013 at 04:02 PM. Reason: using variable for pixels
Reply With Quote
The following 2 users say Thank You to ktrader for this post:
 
  #3 (permalink)
Elite Member
Zurich, Switzerland
 
Futures Experience: Intermediate
Platform: Ninja, CTS, TOS
Favorite Futures: ES, TF, CL, NQ, GC
 
Otterly's Avatar
 
Posts: 130 since Aug 2011
Thanks: 251 given, 57 received


Fantastic Ktrader, thankyou for your help.

I have put your code into a new indicator, but am getting an error code on compiling. Sorry for my noobness.

Lines 44 - 49 are getting the error "The type or namespace name "Control" could not be found (are you missing a using directive or an assembely reference?).

Sorry, I understand what to do to resolve this.

Reply With Quote
 
  #4 (permalink)
Elite Member
glostrup, denmark
 
Futures Experience: Advanced
Platform: Custom platform
Broker/Data: CQG
Favorite Futures: Futures, Options, Stocks
 
ktrader's Avatar
 
Posts: 249 since Aug 2011
Thanks: 151 given, 274 received


Otterly View Post
Fantastic Ktrader, thankyou for your help.

I have put your code into a new indicator, but am getting an error code on compiling. Sorry for my noobness.

Lines 44 - 49 are getting the error "The type or namespace name "Control" could not be found (are you missing a using directive or an assembely reference?).

Sorry, I understand what to do to resolve this.

Thats in System.Windows.Forms namespace. So in the very top of file there are some "using declarations" (you might need to press the "+" to expand them.)

after the last using declaration add this:

using System.Windows.Forms;


I have exported my indicator and attached to this post too - so if you prefer you can just download and import into ninja...

-ktrader

l

Attached Files
Register to download File Type: zip movebuttons.zip (1.8 KB, 43 views)
Reply With Quote
The following 4 users say Thank You to ktrader for this post:
 
  #5 (permalink)
Elite Member
Zurich, Switzerland
 
Futures Experience: Intermediate
Platform: Ninja, CTS, TOS
Favorite Futures: ES, TF, CL, NQ, GC
 
Otterly's Avatar
 
Posts: 130 since Aug 2011
Thanks: 251 given, 57 received

Fantastic!

It works very nicely. ThankYou.

Itīs good to know there are people who know what they are doing. Unfortunately, at NinjaTrader their employee gurus said it couldnīt be done. Iīve no surprise that someone from futures.io (formerly BMT) could do it.

Great job Ktrader.

Reply With Quote
 
  #6 (permalink)
Elite Member
UK
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: ib
Favorite Futures: Electric Guitar
 
Mindset's Avatar
 
Posts: 355 since Sep 2009
Thanks: 88 given, 285 received

Enumerate chart trader buttons

ktrader
Nice coding. I thought I could enumerate all the buttons in the Chart Trader Container by
Print(ct.Control[i].Name);

but this doesn't produce anything. Any ideas of how to do this?

Reply With Quote
 
  #7 (permalink)
Elite Member
UK
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: ib
Favorite Futures: Electric Guitar
 
Mindset's Avatar
 
Posts: 355 since Sep 2009
Thanks: 88 given, 285 received

Solution

My Bad

 
Code
	foreach(Control control in ct.Controls)
				{
					Print (control.Name);
				}

Reply With Quote
 
  #8 (permalink)
Elite Member
Cedar Rapids, iowa
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Ninjatrader - Continuum
Favorite Futures: 6E, TF, 6J
 
Tasker_182's Avatar
 
Posts: 626 since Aug 2009
Thanks: 426 given, 1,126 received


ktrader View Post
One way of doing it is to move the buttons from code, for example an indicator (or other code you are running that have access to the chart-window).

here is a rough example of how to do it in an indicator:

Just set the "pixels" variable to whatever number of pixels you want the buttons to be moved down.

 
Code
Namespace NinjaTrader.Indicator
{
    /// <summary>
    /// Enter the description of your new custom indicator here
    /// </summary>
    [Description("Enter the description of your new custom indicator here")]
    public class MoveButtons : Indicator
    {
        #region Variables
			
        // User defined variables (add any user defined variables below)
			private int pixels = 100;
        #endregion

        /// <summary>
        /// This method is used to configure the indicator and is called once before any bar data is loaded.
        /// </summary>
        protected override void Initialize()
        {
			this.Overlay=true;
		}

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            // Use this method for calculating your indicator values. Assign a value to each
            // plot below by replacing 'Close[0]' with your own formula.

			if (CurrentBar==0) {			
				
								
				Control.ControlCollection ccol = ChartControl.Controls;	
				Control ch = ccol["pnlChartTrader"];
				if (ch!=null) {
					Control ct = ch.Controls["ctrChartTraderControl"];					
					if (ct!=null) {
						Control tb = ct.Controls["btnChartTraderVisible"];
						if (tb!=null) {
							if (tb.Top==0) {
								int cclen = ct.Controls.Count;
								for (int i=0;i<cclen;i++) {
									ct.Controls[i].Top+=pixels;
								}
							}
						}					
					}
				}
			}

        }

        #region Properties

        #endregion
    }
}
--ktrader


Hey ktrader,

just a technical question. It appears the code only operates once but the variable CurrentBar is checked on each onbarupdate. Can the code be executed in OnStartUp instead? (as in I'm too lazy to try and thought I could just ask...)

Regards

"Money is better than poverty, if only for financial reasons." - Woody Allen
Reply With Quote
 
  #9 (permalink)
Elite Member
UK
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: ib
Favorite Futures: Electric Guitar
 
Mindset's Avatar
 
Posts: 355 since Sep 2009
Thanks: 88 given, 285 received

On start up

An alternative is just to use a bool

so...

If(init)
{execute code
set init to false
end code}


Then it only runs once. There are two small bugs in this code. If you refresh, the buttons keep going down and if you remove the code the buttons don't revert back to their original place. I have tried to sort this out but it's beyond my ken at the moment.

Reply With Quote
 
  #10 (permalink)
Elite Member
Cedar Rapids, iowa
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Ninjatrader - Continuum
Favorite Futures: 6E, TF, 6J
 
Tasker_182's Avatar
 
Posts: 626 since Aug 2009
Thanks: 426 given, 1,126 received



Mindset View Post
An alternative is just to use a bool

so...

If(init)
{execute code
set init to false
end code}


Then it only runs once. There are two small bugs in this code. If you refresh, the buttons keep going down and if you remove the code the buttons don't revert back to their original place. I have tried to sort this out but it's beyond my ken at the moment.

He is using CurrentBar ==0 as the bool check. I thought that moving it to onstart-up just eliminates the bool check.

"Money is better than poverty, if only for financial reasons." - Woody Allen
Reply With Quote

Reply



futures io > > > > Moving the ChartTrader buttons down

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
Open ChartTrader with Strategy nailz420 NinjaTrader Programming 18 March 27th, 2013 01:16 PM
ChartTrader -- How to get the selected ATM with script vantojo NinjaTrader Programming 6 March 14th, 2013 11:05 AM
ChartTrader bukkan NinjaTrader Programming 7 August 3rd, 2012 01:25 AM
ChartTrader Indicator louiswelt NinjaTrader 1 June 16th, 2011 12:03 AM
ChartTrader moving stop loss rejection PiCoTrader NinjaTrader 7 November 15th, 2010 07:55 AM


All times are GMT -4. The time now is 01:29 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-16 in 0.14 seconds with 20 queries on phoenix via your IP 23.22.136.56