Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using historical data for a live strategy

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

    Using historical data for a live strategy

    I am trying to run my strategy while connected to a live feed. My strategy needs to use some historical data for calculations. I looked through the help file and saw an option for this, but when I put a strategy in the strategies tab, the option is not present. What options do I have to resolve this?

    #2
    I don't know what option you are referring to. Your strategy will automatically pull the minimum amount of data needed. You can program into your strategy how many bars you require. BarsRequired = 20 is the default setting.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      "Running a NinjaScript Strategy from Strategies Tab" in the help file. Number 4 on that page is what I'm referring to. Aside from that, will it make a difference if I'm using multiple time frames? My main time frame will be 1 min or tick, and I need the Lows of the last two weeks. I have the data, but it does not seem to be accessing it. Does that make sense or should I give a more thorough description?

      Comment


        #4
        That option is available via the BarsRequired property I mentioned earlier. Just type BarsReequired = 100 or whatever you want inside the Initialize() method.

        Also, the option should still be there when you run it from the Strategies Tab of the Control Center. The best way to check if your strategy performs as expected is to throw the strategy up onto a chart.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Does the BarsRequired property refer to main data series? In my case I am using ticks or 1 min, so how can I determine how many bars I would need? And if I end up needing 20,000, would that require a lot of time before the strategy starts running? If so, would it be smarter to manually enter the lows of the last two weeks? That would remove my requirement for historical data.

          Comment


            #6
            I've got it working, thank you for your help.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            599 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            344 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            558 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            557 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X