Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Data-Series by indicator

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

    Data-Series by indicator

    I am creating indicator now I added one DataSeries by indicator like

    if (State == State.Configure)
    {

    AddDataSeries(BarsPeriodType.Tick, 100);

    }
    now I want to fetch low or high value of this DataSeries.


    #2
    Hello yeshujbp,
    Thanks for your post.

    You would use Lows[1][0] to get the current low of the added series and Highs[1][0] to get the current high of the added series.




    Please see the following link for more information on the Multi-Time Frame and Instrument concepts you will need when creating NinjaScripts such as this: https://ninjatrader.com/support/help...nstruments.htm
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Thank you very much

      Comment


        #4
        what is the wrong ...

        protected override void OnStateChange()
        {
        if (State == State.SetDefaults)
        {
        Description = @"Enter the description for your new custom Indicator here.";
        Name = "MyCustomIndicator";
        Calculate = Calculate.OnEachTick;
        AddPlot(Brushes.Green, "PreviousBarLow");

        }
        else if (State == State.Configure)
        {
        AddDataSeries(BarsPeriodType.Tick, 150);
        }
        }
        protected override void OnBarUpdate()
        {
        if (CurrentBar > 0)
        { if (Close[1] > Open[1])
        {

        Draw.Line(this, "greenup" + CurrentBar, false, 1, Highs[0][1], 0, Highs[0][0], Brushes.Silver, DashStyleHelper.Solid, 2);

        Draw.Line(this, "greendown" + CurrentBar, false, 1, Lows[1][1], 0, Lows[1][0], Brushes.Silver, DashStyleHelper.Solid, 2);
        //this line not working if this line ADD nothing draw otherwise it work


        }

        }// CurrentBar

        This is indicator code. I use this Indicator on Renko bar chart and I want to fetch low/high of BarsPeriodType.Tick on Renko Bar .code Lows[1][1] Lows[1][0] not working


        Comment


          #5
          yeshujbp,

          It's possible you are not checking for the right amount of bars before your logic. What does the Logs tab of your Control Center report?
          Josh G.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          639 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          366 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          107 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          569 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          572 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X