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 charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          73 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          152 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          162 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          100 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          288 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X