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 SalmaTrader, 07-07-2026, 10:26 PM
          0 responses
          30 views
          0 likes
          Last Post SalmaTrader  
          Started by CarlTrading, 07-05-2026, 01:16 PM
          0 responses
          17 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 06-17-2026, 10:32 AM
          0 responses
          9 views
          0 likes
          Last Post CaptainJack  
          Started by kinfxhk, 06-17-2026, 04:15 AM
          0 responses
          16 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Started by kinfxhk, 06-17-2026, 04:06 AM
          0 responses
          19 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Working...
          X