Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to get "real" previous day close value?
Collapse
X
-
Yes, now when I use Kinetick as my end day data provider it works great. Unfortunately there must be something wrong with my NT7. On day chart all the bars (days) have a date one day higher, therefore the indicator shows value of one day before prior day. I checked time zone on my PC and NT7. It is set to UTC +1 which correct and also PC's date is correct.
Any advice?
Comment
-
Hello,
This can occur due to the session template offsetting the time enough to where it can push the date into the next date depending about where in the world you are located.
What time zone are you located in?
Also, what session template are you using on the daily chart?
I look forward to assisting you further.BrettNinjaTrader Product Management
Comment
-
Hello,
On the daily charts only, please switch from default 24/7 session template to an appropriate RTH session template and see if the issue is resolved. THis will not change the data on the chart only the dates being placed one day forward. Since session template cannot be applied to daily charts. However there is still some time conversion going on for this and if your day is set to start at 12:00 AM then if the time stamp on data is 12:00 AM for a new daily bar if you apply the time offset to make the time in your local time that pushes that time over into the next day.
Thanks.BrettNinjaTrader Product Management
Comment
-
Thanks for your posts. Changing to correct RTH helped. I have modified kdoren's script. I hope he will not mind. Now it plots max and min price change possible for ZC. I'm having problems to debug it so I'm not sure if it works correctly. Is there a way how to write the scripts in Visual Studio Express Edition? I read somewhere that express edition is not supported.Attached Files
Comment
-
I fixed it; you can't check the price from 2 days ago on the first day; you have to put in a check to make sure there are 2 days of data there, otherwise it will throw an exception.
I put back the code you commented out to fix your earlier problem with days. The problem was not with the code, it was with your data. Check the earlier suggestions for how to fix it.
You should go into Historical Data Manager and Download new "Day" data from Kinetick for your ZC contracts. Then go into the "Edit" tab and look at the data for some of the days to make sure it's correct. If it's still off by a day you have some kind of configuration problem, but the answer is NOT to change the code to compensate, you need to debug why the data is getting loaded with the wrong day.
Good luck, Kevin
Comment
-
Thanks Kevin, but still can't figure out what could be the problem. I have tried to download all the data again and it still returns close of one day before yesterday. It seems my data is now correct. I might have something to do with time zone. I will try to investigate further.
Comment
-
Sounds like some kind of time zone problem, I suggest you re-read the earlier suggestion from bukkan (he created a special session template that specified his time zone).
I think your session setting of 24/7 is causing a problem. NT7 will stamp the daily bar with the end time of the session, then convert it to your local time. That should work fine for you in GMT+1 if you set your session to the exchange hours. But a session setting of 24/7 will stamp the daily bar with a default of midnight Eastern time, and since you are GMT+1 that will be converted to the following day.
If you really want 24/7, try setting the time zone for "Default 24/7" in the session manager to your own time zone, I think that might work.
I've attached a debug version of the indicator which prints the time/date/close info to the output window. That should make it clear what's going on.
Good luck,
Kevin
Comment
-
Actually I think there might be another way to fix it.... On your chart, add a second data series, same instrument as your intraday (ZC ??-??), but use Daily (1-Day) bars, and set the Session template to whatever the trading hours are for the instrument. (If it's set in the instrument manager, you can use "instrument default".
When the indicator uses daily bars, they will be stamped with the session end time from the daily bars in the chart, which should be the correct date even after conversion to your local time zone.
Comment
-
I think the best way to deal with the issue is in the indicator, to convert the dates to the exchange time zone using the GetTradingDayFromLocal() method. I've attached a revised version, I think this should fix it. It will change the daily price limit plots when it sees the first intraday bar that occurs on a new day in the exchange time zone. There are debug Print statements in comments, you can uncomment them if you still have trouble.
I also set it to not plot limits once the limits come off (2 business days before the 1st day of the delivery month). This hasn't been thoroughly tested so keep an eye out for issues.
Let me know if it works for you.
Comment
-
Thanks a lot Kevin. You have done big piece of work. It works correctly timezone issue has been solved. But there are still few things. At least in my case only the current day limit value is correct. Please take a look on attachment. Other days back have a different limit value then close day value downloaded from Kinetick. It is not a problem if it continues correctly next days. I will let you know. As you mention my logic is not exactly correct. It seems to be too advanced for me to implement it. Also yours seems not to be correct because on 28.4.2011 price dropped by 30 points so on 29.4.2011 limit should be 45 points and the price went upper this limit.
Thanks a lot again Kevin.
Comment
-
Try going to "Tools -> Options" and setting "Merge Policy" to "Do Not Merge". I think that will fix it.
In my opinion, this is an NT7 bug.
NT7 is changing the data that it sends to the indicator, apparently because it's trying to do some kind of contract merge. This is just wrong, it should only do a merge if you specify a continuous futures contract. You are specifying the ZC 07-11 contract, and that is the only data it should give you. Instead it's screwing with the data, and giving you data that is neither May nor July.
You can turn this off, but it really shouldn't be the default behavior.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
592 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
343 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
556 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
554 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment