Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Regression Channel

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

    Regression Channel

    How do I plot Regression Channel dynamically as dashed line and blue color within NinjaScript?? I am proficient in C# and I have tried using “DrawRegressionChannel()” inside the OnBarUpdate() and Initialize() methods without any success. A code snippet would be great or any suggestions of where to look?


    Thanks for your support.

    TazManII

    #2
    Please see here: http://www.ninjatrader-support.com/H...onChannel.html

    I suggest trying with a simple drawing method like DrawDot and then take it from there http://www.ninjatrader-support.com/H...6/DrawDot.html
    DierkNinjaTrader Customer Service

    Comment


      #3
      Regression Channel

      I tried and it doesn't plot anything. Below is my code snippet. I am trying to plot regression channel around pivot points.

      protectedoverridevoid Initialize()
      {
      Add(
      new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
      RegressionChannel(6
      , 2).Plots[0].Pen.DashStyle = DashStyle.Dash;
      CalculateOnBarClose =
      true;
      Overlay =
      true;
      PriceTypeSupported =
      false;
      }

      protectedoverridevoid OnBarUpdate()
      {
      Plot0.Indicator.DrawRegressionChannel("Reg Ch",true,6,0,Color.Blue,DashStyle.Dash,2,Color.Blue,DashStyle.Dash,2,Color.Blue,DashStyle.Dash,2);
      Plot0.Set(Close[
      0]);
      }

      Comment


        #4
        The fishy line here is this one: Plot0.Indicator.DrawRegressionChannel("Reg Ch",true,6,0,Color.Blue,DashStyle.Dash,2,Color.Blue,DashStyle.Dash,2,Color.Blue,DashStyle.Dash,2);

        You do not need to do Plot0.Indicator. Please see the Control Center for any subsequent errors too.

        All you need to do is use this syntax and drop it in: DrawRegressionChannel(string tag, bool autoScale, int startBarsAgo, int endBarsAgo, Color upperColor, DashStyle upperDashStyle, int upperWidth, Color middleColor, DashStyle middleDashStyle, int middleWidth, Color lowerColor, DashStyle lowerDashStyle, int lowerWidth)
        Last edited by NinjaTrader_JoshP; 05-31-2008, 11:24 AM.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Regression Channel

          Josh,

          Thanks very much. Your suggestion to see the Control Center for any subsequent errors helped fixed my problem. The problem was startBarsAgo and endBarsAgo were out of valid range.

          Once again many thanks.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Island_Boy_Trading, Today, 07:39 AM
          2 responses
          13 views
          0 likes
          Last Post Island_Boy_Trading  
          Started by cmarkb, Today, 07:19 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by wjadevries, Today, 03:29 AM
          1 response
          15 views
          0 likes
          Last Post NinjaTrader_Jim  
          Started by Oracletrades, Yesterday, 09:10 PM
          1 response
          119 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by ginx10k, Today, 07:04 AM
          2 responses
          8 views
          0 likes
          Last Post ginx10k
          by ginx10k
           
          Working...
          X