• 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

Extend plot lines in to future

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

    Extend plot lines in to future

    Hi,

    I am using opening range breakout indicator for NT 8 that is available here.

    Is it possible to extend the plot lines in to future?
    As of now they extend when every bar closes. (screenshot attached)

    this is what I am trying to do -

    This is a 30 min breakout
    once piloted they should extend till the end of the current day.

    Thank you.
    Attached Files

    #2
    Hello

    Thank you for your post.

    Glad to assist. To test, please right click on the chart > select Indicators > try changing the Calculate setting to "On each tick" see if this will extend the lines to the current bar. Regarding extending into the future, also review the settings for way to accomplish this.

    If none is found, then the indicator would need to changed to extend the lines. Our NinjaTrader team would be able to follow up with programming assistance if you would like, or I can have someone reach out with a list of third parties that would be interested in building this for you.

    Please let us know if you need further assistance.
    Eric B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Eric,

      Yes, when I switched to - on each tick - lines do extend to current bar however there are no specific settings in properties panel to extend the lines in future. Specifically once plotted they should extend till the end of the current day.

      If programming team can help that would be great

      code below.

      namespace NinjaTrader.NinjaScript.Indicators
      {

      /// <summary>
      /// </summary>
      public class OpeningRangeIndicator : Indicator
      {
      double highestPrice = 0.0;
      double lowestPrice = 0.0;
      bool bFirst = true;
      double d30minbar = 0.0;

      protected override void OnStateChange()
      {
      if (State == State.SetDefaults)
      {
      Description = "Opening Range Indicator";
      Name = "Opening Range Indicator";
      IsOverlay = true;
      IsSuspendedWhileInactive = true;

      AddPlot(Brushes.Red, "Opening Range High");
      AddPlot(Brushes.Red, "Opening Range Low");

      }
      else if (State == State.Configure)
      {
      AddDataSeries(BarsPeriodType.Minute, 30);
      }
      }

      protected override void OnBarUpdate()
      {

      if (BarsPeriod.BarsPeriodType == BarsPeriodType.Minute )
      {
      if (bFirst)
      {
      d30minbar = (30/BarsPeriod.Value)-1;
      bFirst = false;
      }

      if (CurrentBar < 20)
      {
      return;
      }


      if( BarsPeriod.Value == 30)
      {
      if( Bars.BarsSinceNewTradingDay == 0)
      {
      highestPrice = Highs[1][0];
      lowestPrice = Lows[1][0];
      }
      }

      if (Bars.BarsSinceNewTradingDay > d30minbar)
      {
      HighOfRange[0] = highestPrice;
      LowOfRange[0] = lowestPrice;
      }
      }
      }

      #region Properties
      [Browsable(false)]
      [XmlIgnore()]
      public Series<double> HighOfRange
      {
      get { return Values[0]; }
      }

      [Browsable(false)]
      [XmlIgnore()]
      public Series<double> LowOfRange
      {
      get { return Values[1]; }
      }
      #endregion
      }

      Comment


        #4
        Hello prashant290,

        Thanks for your reply.

        You would not be able to extend plot lines into the future. One way to accomplish your goal would be to draw a line using the Time overload that would allow you to specify the end of session. Reference: https://ninjatrader.com/support/help...?draw_line.htm To obtain the end of session time automatically you would need to have a session iterator, reference: https://ninjatrader.com/support/help...sessionend.htm

        Alternatively, you could use another indicator that already provides this capability, here is a short video of the "Repeater V2.2" indicator that offers an opening range type (in addition to other capabilities): https://Paul-ninjaTrader.tinytake.co...Q0Nl84NzkyNTA1

        Here is a link to that indicator if it is of interest: https://ninjatrader.com/support/foru...d=7&linkid=680
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          You guys are awesome....

          this is exactly what I was looking for.

          Thank you so much for your help.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by tecmisc1, Today, 09:57 AM
          0 responses
          2 views
          0 likes
          Last Post tecmisc1  
          Started by mbesha, Today, 09:26 AM
          0 responses
          1 view
          0 likes
          Last Post mbesha
          by mbesha
           
          Started by Brillo, Today, 08:58 AM
          0 responses
          5 views
          0 likes
          Last Post Brillo
          by Brillo
           
          Started by avrege, Today, 01:48 AM
          2 responses
          13 views
          0 likes
          Last Post avrege
          by avrege
           
          Started by markbb10, Today, 07:14 AM
          0 responses
          7 views
          0 likes
          Last Post markbb10  
          Working...
          X