View Full Version : Using historical data for a live strategy
tony900hwk
06-25-2008, 09:56 PM
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?
NinjaTrader_Josh
06-25-2008, 10:24 PM
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.
tony900hwk
06-25-2008, 10:36 PM
"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?
NinjaTrader_Josh
06-26-2008, 01:29 AM
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.
tony900hwk
06-26-2008, 10:49 AM
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.
tony900hwk
06-26-2008, 11:27 AM
I've got it working, thank you for your help.