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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          81 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          42 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          64 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          66 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          54 views
          0 likes
          Last Post CarlTrading  
          Working...
          X