![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Mar 2010
Posts: 29
Thanks: 1
Thanked 0 times in 0 posts
|
Hi,
I am getting some odd behaviour if I run my strategy on market replay when using downloaded data that is more than 4 weeks older than today's date. I have multiple data series within the strategy: primary is 1minute, but also have 5mins, daily etc, to calculate various indicators within the strategy. The strategy works fine if I run on market replay for any recent date up to about 4 weeks ago. But if I run it on an historical date further back than that, then no longer is it able to load the secondary data series - eg daily data is not available to the strategy. I have tried forcing it to wait until it is in realtime mode (on replay) as I read on the forums that replay can cause some issues when dealing with historical data '(Historical)' vs realtime (replay) data. But that makes no difference. It simply does not have access to the data ... I get the error in my output that 'CurrentBars[3] = 0' when my daily data load: Add(PeriodType.Day, 1); is the 3rd secondary dataseries (BarsInProgress = 3). Is this known behaviour that market replay will not load historical data for secondary dataseries if running on data that is older than about 4/5 weeks old? many thanks |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Mar 2012
Location: Denver, CO
Posts: 1,197
Thanks: 135
Thanked 181 times in 180 posts
|
Hello Pourleau,
Thanks for the note. By default the Market Replay will use historical data to backfill from the historical database from your local PC only. Could you verify that that you have Daily historical data for the dates that you are having trouble with? Also, when working with a multi-time frame series are you synchronizing with data series object to ensure that your calculation will be accurate? http://www.ninjatrader.com/support/f...ead.php?t=3572 Happy to be of further assistance.
JC
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Mar 2010
Posts: 29
Thanks: 1
Thanked 0 times in 0 posts
|
Thanks, JC.
Re synching the timeseries, yes I did follow Josh's sample script in order to sync them with a data series within the same BarsArray, thanks. Re historical data,I always ensure that I have a chart open for each timeframe required by my strategy. So I will have a 5min chart, daily chart etc going back several months further (in the daily case) than the day I am trying to run the strategy on. Is that sufficient to have the data available on a chart in order to make it available to the strategy? thanks |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Mar 2012
Location: Denver, CO
Posts: 1,197
Thanks: 135
Thanked 181 times in 180 posts
|
Hello Pourleau,
Depending on who your data provider is it should, yes. You can see what your data provider supports on the following link. http://www.ninjatrader.com/support/h...rical_data.htm Alternatively, you can check the Historical Data Manager to see what data you have by going to Tools -> Historical Data Manager -> Edit tab and then press the "+" next to the instrument to see the types of data and press the "+" next to the type of data and so forth. Attached is an image as an example. http://www.ninjatrader.com/support/h...ta_manager.htm Let me know if the problem persists.
JC
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Mar 2010
Posts: 29
Thanks: 1
Thanked 0 times in 0 posts
|
Thanks, JC. I was not aware of the historical data manager - that is a nice tool.
I do have historical data in there, however. It shows I have daily data all the way back to Nov11, and 1min data from April12. The problem of the strategy not picking up daily data ( in BarsArray[3] ) starts to occur if I go back to end of June, or about 4-5 weeks prior to the current date. Given that this seems to be a problem with daily data, and having seen that daily and 1min data are stored separately by the historical data manager, I wonder if there are certain conditions or rules for accessing daily data beyond a certain historical point in time? thanks |
|
|
|
|
|
#6 | |
|
Senior Member
Join Date: Aug 2010
Location: Washington, D.C.
Posts: 1,184
Thanks: 178
Thanked 301 times in 259 posts
|
Quote:
Can you post some sample code that at a bare minimum that shows this condition ? Take out whatever you have that is private to you. I can check it out over on my machine and test it in my market replay. |
|
|
|
|
|
The following user says thank you to sledge for this post: |
|
|
|
#7 |
|
NinjaTrader Customer Service
Join Date: Mar 2012
Location: Denver, CO
Posts: 1,197
Thanks: 135
Thanked 181 times in 180 posts
|
Hello Pourleau,
Alternatively, you can send a toy* NinjaScript code replicating the behavior to Support[At]NinjaTrader[Dot]com so that I may be of further assistance. Happy to be of further assistance. *Toy - basically a stripped down version of code that isn't necessarily the whole logic. Making it easier to identify lines of code.
JC
NinjaTrader Customer Service |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Mar 2010
Posts: 29
Thanks: 1
Thanked 0 times in 0 posts
|
Sledge / JC
Many thanks - I have sent a cut-down version of code highlighting this issue to the ninja support mail address. Any guidance as to why this might occur is very much appreciated. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multi-DataSeries Indicator works differently in Market Replay | SatChitAnanda | Indicator Development | 1 | 07-26-2012 03:32 AM |
| DataSeries on a secondary data series | JoshDance | Indicator Development | 4 | 05-30-2012 11:29 AM |
| Syncing custom DataSeries to secondary series | buylosellhi | General Programming | 4 | 08-11-2011 09:30 PM |
| NT7B7: DataSeries Sync to secondary bars is still broken | kdoren | Version 7 Beta General Questions & Bug Reports | 3 | 01-28-2010 02:14 PM |
| Sync a DataSeries with a secondary timeframe | jriverac | Strategy Development | 14 | 05-27-2008 01:19 PM |