How do I go about doing this? Thanks
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!
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
NinjaTrader
Accessing Historical Data from Live Strategy
Collapse
X
-
Accessing Historical Data from Live Strategy
I have a strategy that needs to look at the prior n bars in order to calculate market conditions. Of course I can just wait for n bars to be processed in the strategy, but if n is large I'd like to pull that from historical data (rather than wait several hours/days each time the strategy is started in real time before trading).
How do I go about doing this? Thanks -
You don't need to do anything special, other than making sure you have enough bars loaded in the chart you're running the strategy and in the strategy be sure to do a check of having enough bars (eg. something like CurrentBar > n where n is the number of bars you minimally need).
HTH
-
Ok, great. I figured that when I started a strategy up, there would be no bars available until it had been running long enough to collect those bars. Good to know it can use historical bars automatically if they exist.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by OllieFeraher, 05-09-2024, 11:14 AM
|
6 responses
18 views
0 likes
|
Last Post
by OllieFeraher
Today, 04:00 AM
|
||
Started by PaulMohn, 05-02-2024, 06:59 PM
|
2 responses
42 views
0 likes
|
Last Post
by PaulMohn
Today, 03:51 AM
|
||
Started by ETFVoyageur, Today, 02:10 AM
|
0 responses
9 views
0 likes
|
Last Post
by ETFVoyageur
Today, 02:10 AM
|
||
Started by rayyyu12, Today, 12:47 AM
|
0 responses
8 views
0 likes
|
Last Post
by rayyyu12
Today, 12:47 AM
|
||
Started by ETFVoyageur, 05-07-2024, 07:05 PM
|
17 responses
137 views
0 likes
|
Last Post
by ETFVoyageur
Yesterday, 11:27 PM
|
Comment