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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      47 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      23 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X