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 Mindset, 04-21-2026, 06:46 AM
          0 responses
          46 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          67 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          35 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          95 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          59 views
          0 likes
          Last Post PaulMohn  
          Working...
          X