Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT not drawing MA lines correctly in chart

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

    NT not drawing MA lines correctly in chart

    Please below the sample code I am using which works fine in NT6.5
    In 7, the linreg is not plotted continuously in chart, It looks like a few places where there are clear breaks. I am including a sample image using CL 03-10. If I change the plot style to dots in chart window, it's drawn correctly.

    thanks for the help,

    Alex

    protected override void Initialize()
    {
    Add(new Plot(Color.Red, PlotStyle.Line, "Plot1"));
    Add(new Plot(Color.Lime, PlotStyle.Line, "Plot2"));
    CalculateOnBarClose = false;
    }
    protected override void OnBarUpdate()
    {
    if(CurrentBar <= 10)
    return;

    if(LinReg(10)[0] < LinReg(10)[1])
    PlotLsma1.Set(LinReg(10)[0]);
    else if(LinReg(10)[0] > LinReg(10)[1])
    PlotLsma2.Set(LinReg(10)[0]);
    }
    #region Properties
    [Browsable(false)]
    [XmlIgnore()]
    public DataSeries PlotLsma1
    {
    get { return Values[0]; }
    }
    [Browsable(false)]
    [XmlIgnore()]
    public DataSeries PlotLsma2
    {
    get { return Values[1]; }
    }
    #endregion
    Attached Files

    #2
    AlexJetski,

    For multi-colored plot please try out this new technique introduced in NT7. http://www.ninjatrader-support2.com/...ad.php?t=21225
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hi Josh,

      Thanks for the quick reply. That solves my issues, thanks a bunch for the great description and code link.

      cheers

      Alex

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      626 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      359 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      562 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      567 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X