• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Labelled lines

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

    Labelled lines

    Just a little feedback for the author (NT staff, I believe).

    To prevent unhandled 'null' errors (object reference not set to an instance of an object), labeled lines onRender needs to be updated with the following (or some equivalent), because you will still get an "NinjaTrader.NinjaScript.DrawingTools.DrawingTool. **GetAttachedToChartBars**(...) returned null." error with the current null detection

    Code:
            public override void OnRender(ChartControl chartControl, ChartScale chartScale)
            {
                base.OnRender(chartControl, chartScale);
    
                Stroke.RenderTarget         = RenderTarget;
                OutlineStroke.RenderTarget    = RenderTarget;
    
                try
                {
                    if (GetAttachedToChartBars().Bars.Instrument.MasterInstrument == null)
                        return;
                }
                catch
                {
                    return;
                }
    Regards,

    Paul

    #2

    Try this instead

    Code:
    ChartBars tcbs = AttachedTo.ChartObject as ChartBars;
    if(tcbs == null) { Print("ChartBar Problem"); return; }


    -=Edge=-
    NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

    Comment


      #3
      Thank you, Sir! Have a great weekend.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Gorkhaan, Today, 02:55 AM
      0 responses
      6 views
      0 likes
      Last Post Gorkhaan  
      Started by mbell.irves, Today, 12:36 AM
      0 responses
      11 views
      0 likes
      Last Post mbell.irves  
      Started by cutzpr, Yesterday, 09:18 PM
      0 responses
      7 views
      0 likes
      Last Post cutzpr
      by cutzpr
       
      Started by CoffeeOutlaw, Yesterday, 05:59 PM
      3 responses
      22 views
      0 likes
      Last Post CoffeeOutlaw  
      Started by Da vinci, Yesterday, 04:19 PM
      2 responses
      15 views
      0 likes
      Last Post Da vinci  
      Working...
      X