Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 GussJ, 03-04-2020, 03:11 PM
          16 responses
          3,279 views
          0 likes
          Last Post Leafcutter  
          Started by WHICKED, Today, 12:45 PM
          2 responses
          19 views
          0 likes
          Last Post WHICKED
          by WHICKED
           
          Started by Tim-c, Today, 02:10 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by Taddypole, Today, 02:47 PM
          0 responses
          5 views
          0 likes
          Last Post Taddypole  
          Started by chbruno, 04-24-2024, 04:10 PM
          4 responses
          51 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Working...
          X