Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

only check the last 3 day's data

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

    only check the last 3 day's data

    Hi
    I am new for Ninjascript, I want to build a indicator work in 1 minute time frame, but I want to add a rule : just check the last 3 days' chart data.
    How can I add this rule on the indicator? Thanks a lot

    #2
    Hello,

    You will see how to do it here:


    Note: you must have daily data if you add a daily bar.
    DenNinjaTrader Customer Service

    Comment


      #3
      Thanks Ben
      I understand to add:

      Add(PeriodType.Day,1)

      and set:
      if (BarsInProgress == 1)

      after that I don't know how to filter out the other days,
      I only want the data of last recent 3 days.

      Comment


        #4
        Hello,

        You will need to sort out the logic yourself, but you likely can use the GetBar() method to get the bar reference or you could use some sort of looping structure:
        for (int i = 0; i < my_barsback; i++)
        {
        if
        (my_time == ToTime(Time[i]))
        {
        my_vol = Volume[i];
        break
        ;
        }
        }
        Or maybe this link will help:

        DenNinjaTrader Customer Service

        Comment


          #5
          Thank you Ben , to point me the direction,
          I will like into them. cheers

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          571 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          331 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          549 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          550 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X