![]() |
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 2012
Posts: 20
Thanks: 0
Thanked 1 time in 1 post
|
Hello,
My strategy runs intraday but looks at daily charts at well. I've added daily bar data with the following code in the init section: Code:
Add(PeriodType.Minute, 1); // Adds a minute chart to Barsarray[1] Add(PeriodType.Day, 1); // Adds a Daily chart to Barsarray[2] Code:
(Math.Abs(Lows[2][0]- Opens[2][0] I realized this by comparing the values of Open[2][0] / Close/ High for a particular day with the data from yahoo and google finance. How do I fix this? I am using data from Kinetick. Thanks Tal |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 977 times in 960 posts
|
Hi Tal, thanks for the post - if you check the daily chart directly using Kinetick on your setup, would the dates be correct or shifted as well?
What time zone is your PC set up in and which session template are you using for your charts and running the strategy please? Thanks,
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Mar 2012
Posts: 20
Thanks: 0
Thanked 1 time in 1 post
|
Hi Bertrand
If I upon a chart I get an off shift of one day. (I am looking at SPY and am using the flash crash of may 6 2010 as a reference point). When I open a chart it is labeled as 7th of may, When I check the strategy it happens on the 8th. Session Template: default 24/7 Time Zone of my computer : GMT +2 Thanks Tal |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 977 times in 960 posts
|
Thanks Tal, please try using the 'US Equities RTH' template for example - would that correct the data for you?
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Mar 2012
Posts: 20
Thanks: 0
Thanked 1 time in 1 post
|
Hi
This corrects it for the charts but not for the strategy. The strategy now sees the dta if may 6th as may 7th (an improvment but not a solution). Also, I would like to be able to run the strategy 24/7 to enjoy to pre and post market. |
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 977 times in 960 posts
|
Please leave it on this session template to ensure correct data visualization, the daily bar session is set by the provider - so the amount of data included in the bar does not change dynamically here with changing templates.
When you do you exactly try to access the 6th data? You could do so after the bar has closed, so the 7th would be the first possible location to do so.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Mar 2012
Posts: 20
Thanks: 0
Thanked 1 time in 1 post
|
Hmmm.
I want to see if the daily move is larger then a certain percent. So I'm taking to lowest low of the data and subtracting that from the daily open bar. It wont be much help to do it on the next bar. |
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 977 times in 960 posts
|
You can do this in realtime or Market Replay as the intrabar formation is then known, but if you're backtesting first possible location would be the following bar...
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Time Shifted in Export Intraday Data | Alvantage | Miscellaneous Support | 1 | 07-22-2011 11:11 AM |
| Some data from Yahoo is shifted by 1 day | Alvantage | Miscellaneous Support | 7 | 04-08-2011 01:15 PM |
| Orders are shifted one day | LaughingDwarf | Strategy Development | 3 | 03-14-2011 03:42 PM |
| Data minutes shifted 1 day and weekend issue | WhoKnows | Strategy Analyzer | 11 | 12-16-2008 06:17 AM |
| Sma Shifted 3 in future | jed77 | Indicator Development | 1 | 10-21-2008 09:49 AM |