Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Programatically Drawn Line Display on Multiple Charts

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Programatically Drawn Line Display on Multiple Charts

    NT folks,

    I have just started to explore 7. So far I really like what I see. But I am running into some issues.

    How would I get a Line drawn by indicator code that is placed on a 5 Min Chart to show up on the 500 Volume Chart. Is there some Sample Code for this. The attached image of the 5 Min and 500 Volume chart shows what I have so far. And I have a attached a very simple indicator to draw the line on the 5 Min Chart.

    Is there an OverLoad that I have missed that would Enable the line to be drawn on (All charts)? If not, could that be included?

    Thanks for pointing me in the right direction.

    PHP Code:
    #region Using declarations
    using System;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Data;
    using NinjaTrader.Gui.Chart;
    #endregion
    
    // This namespace holds all indicators and is required. Do not change it.
    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 htcDrawLineTest : Indicator
        {
            #region Variables
            // Wizard generated variables
            // User defined variables (add any user defined variables below)
            #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 (ToTime(Time[0]) == 11500)
                    // Draws a Line
                     //ILine line = DrawLine("tag1", false, 10, 1000, 0, 1001, Color.LimeGreen, DashStyle.Dot, 2);
                    //  The ILine will NOT COMPILE
                    
                if (ToTime(Time[0]) == 11500)
                    DrawLine("TestLine", true, 20, 1204, 0, 1204, Color.Blue, DashStyle.Solid, 5);
    
            }
    
            #region Properties
    
            #endregion
        }
    } 
    
    Attached Files
    Last edited by TAJTrades; 04-18-2010, 04:10 AM.

    #2
    Being able to draw global lines via NinjaScript is not supported at this time. This is something we have been asked for several times through the Beta process and is on our list for future improvement consideration.
    RayNinjaTrader Customer Service

    Comment


      #3
      Thanks Ray.

      Saved me the aggravation of trying to find a solution that does not exist.

      Once the first Production Version is released could this be given serious consideration. It would be great if there was an Overload to match every manually drawn object and all its elements. Would make life a lot simpler to know that if I can draw it manually I can create code to equal the effect.

      Lastly, if there is a work around for this could one of the great support folks post it.

      Thanks

      Comment


        #4
        All of our feature requests are prioritized in part by demand. This feature has been requested many times already.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        591 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        342 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        555 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X