N7 DrawLine not working - NinjaTrader Programming | futures io social day trading
futures io futures trading


N7 DrawLine not working
Updated: Views / Replies:879 / 4
Created: by ceramictilepro 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
 

N7 DrawLine not working

  #1 (permalink)
Elite Member
Roseville CA
 
Futures Experience: Advanced
Platform: N7
Broker/Data: Amp Futures/CQG
Favorite Futures: ES
 
Posts: 124 since Jun 2009
Thanks: 32 given, 19 received

N7 DrawLine not working

Hello,

Any ideas on why this is drawing on chart?

 
Code
protected override void OnBarUpdate()
		
        {

			DrawLine("MyLine", 10, Close[10], 0, Close[0], Color.Blue);
 
 

        }
thank 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)
Market Wizard
Columbus, OH
 
Futures Experience: None
Platform: NT 8, TOS
Favorite Futures: ES
 
Silvester17's Avatar
 
Posts: 3,332 since Aug 2009
Thanks: 4,579 given, 10,313 received



ceramictilepro View Post
Hello,

Any ideas on why this is drawing on chart?

 
Code
protected override void OnBarUpdate()
		
        {

			DrawLine("MyLine", 10, Close[10], 0, Close[0], Color.Blue);
 
 

        }
thank you

I think if you add: "if (CurrentBar < 10) return;"

it should work

edit:

made a simple example where you can change the lookback period in the indicator window:

 
Code
       #region Variables
        
        private int 		length 			= 10;
		
	private Color		lineColor           	= Color.Blue;
	private DashStyle	dash0Style		= DashStyle.Solid;
	private int		plot0Width		= 1;
        
        #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()
	{
            Overlay		= true;
        }

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
	    if (CurrentBar < length)  
		return;
			
            DrawLine("MyLine", true, length, Close[length], 0, Close[0], lineColor, dash0Style, plot0Width);
        }

        #region Properties
        
        [Description("lookback period")]
        [Category("Line Settings")]
	[Gui.Design.DisplayNameAttribute("Length")]
        public int Length
        {
            get { return length; }
            set { length = Math.Max(1, value); }
        }
		
	/// <summary>
	/// </summary>
	[XmlIgnore()]
	[Description("line color")]
	[Category("Line Settings")]
	[Gui.Design.DisplayName("Line Color")]
	public Color LineColor
	{
		get { return lineColor; }
		set { lineColor = value; }
	}
		
	[Browsable(false)]
	public string LineColorSerialize
	{
		get { return NinjaTrader.Gui.Design.SerializableColor.ToString(lineColor); }
		set { lineColor = NinjaTrader.Gui.Design.SerializableColor.FromString(value); }
	}
		
	/// <summary>
	/// </summary>
	[Description("DashStyle for Line")]
	[Category("Line Settings")]
	[Gui.Design.DisplayNameAttribute("Line Dash Style")]
	public DashStyle Dash0Style
	{
		get { return dash0Style; }
		set { dash0Style = value; }
	}
		
	/// <summary>
	/// </summary>
	[Description("Width for Line")]
	[Category("Line Settings")]
	[Gui.Design.DisplayNameAttribute("Line Width")]
	public int Plot0Width
	{
		get { return plot0Width; }
		set { plot0Width = Math.Max(1, value); }
	}
		
        #endregion


Last edited by Silvester17; February 1st, 2014 at 02:11 PM. Reason: added example
Reply With Quote
The following 5 users say Thank You to Silvester17 for this post:
 
  #4 (permalink)
Elite Member
Roseville CA
 
Futures Experience: Advanced
Platform: N7
Broker/Data: Amp Futures/CQG
Favorite Futures: ES
 
Posts: 124 since Jun 2009
Thanks: 32 given, 19 received

Very Nice! I'm using this one for sure!

Can you tell me if this can be attached to global drawing objects?

Thank You!


Silvester17 View Post
I think if you add: "if (CurrentBar < 10) return;"

it should work

edit:

made a simple example where you can change the lookback period in the indicator window:

 
Code
       #region Variables
        
        private int 		length 			= 10;
		
	private Color		lineColor           	= Color.Blue;
	private DashStyle	dash0Style		= DashStyle.Solid;
	private int		plot0Width		= 1;
        
        #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()
	{
            Overlay		= true;
        }

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
	    if (CurrentBar < length)  
		return;
			
            DrawLine("MyLine", true, length, Close[length], 0, Close[0], lineColor, dash0Style, plot0Width);
        }

        #region Properties
        
        [Description("lookback period")]
        [Category("Line Settings")]
	[Gui.Design.DisplayNameAttribute("Length")]
        public int Length
        {
            get { return length; }
            set { length = Math.Max(1, value); }
        }
		
	/// <summary>
	/// </summary>
	[XmlIgnore()]
	[Description("line color")]
	[Category("Line Settings")]
	[Gui.Design.DisplayName("Line Color")]
	public Color LineColor
	{
		get { return lineColor; }
		set { lineColor = value; }
	}
		
	[Browsable(false)]
	public string LineColorSerialize
	{
		get { return NinjaTrader.Gui.Design.SerializableColor.ToString(lineColor); }
		set { lineColor = NinjaTrader.Gui.Design.SerializableColor.FromString(value); }
	}
		
	/// <summary>
	/// </summary>
	[Description("DashStyle for Line")]
	[Category("Line Settings")]
	[Gui.Design.DisplayNameAttribute("Line Dash Style")]
	public DashStyle Dash0Style
	{
		get { return dash0Style; }
		set { dash0Style = value; }
	}
		
	/// <summary>
	/// </summary>
	[Description("Width for Line")]
	[Category("Line Settings")]
	[Gui.Design.DisplayNameAttribute("Line Width")]
	public int Plot0Width
	{
		get { return plot0Width; }
		set { plot0Width = Math.Max(1, value); }
	}
		
        #endregion


Reply With Quote
The following user says Thank You to ceramictilepro for this post:
 
  #5 (permalink)
Market Wizard
Columbus, OH
 
Futures Experience: None
Platform: NT 8, TOS
Favorite Futures: ES
 
Silvester17's Avatar
 
Posts: 3,332 since Aug 2009
Thanks: 4,579 given, 10,313 received


ceramictilepro View Post
Very Nice! I'm using this one for sure!

Can you tell me if this can be attached to global drawing objects?

Thank You!

as far as I know, global drawing objects can't be accessed via ninja script.

I might be wrong, but I don't think so.

Reply With Quote
The following 3 users say Thank You to Silvester17 for this post:

Reply



futures io > > > > > N7 DrawLine not working

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
DrawLine kaywai NinjaTrader Programming 4 December 5th, 2012 12:22 AM
N7 ZigZag modification ceramictilepro NinjaTrader Programming 12 May 3rd, 2012 10:17 AM
Shorter vertical line with DrawLine Randwulf NinjaTrader Programming 3 May 3rd, 2012 08:49 AM
Help converting an indicator to N7 tomonly23 NinjaTrader Programming 2 December 14th, 2010 02:02 PM
TrendBars for N7 timefreedom The Elite Circle 1 April 12th, 2010 05:50 PM


All times are GMT -4. The time now is 08:37 PM.

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