Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to plot a chart which starts from the the current day's market opening
Collapse
X
-
How to plot a chart which starts from the the current day's market opening
Hi. I am using M6E instrument (time zone is UTC+09:00) and I am having a problem with the chart that is being plotted. Despite adjusting the setting of no. of days to load as 0, I still get the chart plotting with the previous day's data. What should I do to plot a chart starting from the start of today's market opening (around 7 a.m. here)? Does it have something to do with the session template?Tags: None
-
Originally posted by mbesha View PostHi. I am using M6E instrument (time zone is UTC+09:00) and I am having a problem with the chart that is being plotted. Despite adjusting the setting of no. of days to load as 0, I still get the chart plotting with the previous day's data. What should I do to plot a chart starting from the start of today's market opening (around 7 a.m. here)? Does it have something to do with the session template?
-
-
Hello mbesha,
This is going to be due to the Default Session Template that the M6E is using. It is using the CME FX Futures ETH, which is a defines the overnight session of the instruments. So when NinjaTrader is loading up the instrument it will load data for the entire session that is valid at those given times. If you would like to view only data for an individual day you may want to create a session template that is going to display the hours that you would like to view for each individual day and the time zone that you are in.
You may view/edit/create session templates in the Session Manager window. You can access the Session Manager by going to Tools > Session Manager. Below is a link to the Session Manager section of our help guide.
* http://www.ninjatrader.com/support/h...on_manager.htm
Attached is an example of this using an Eastern Time zone computer, but you may want to change your to the Time zone your computer is currently set to.JCNinjaTrader Customer Service
Comment
-
Still experiencing problems limiting the data displayed to only one trading day
I tried creating my own session template so as to only display the data for one trading day but I still get data for two days. I have attached screen shots of what I am talking about. From the screen shot of the chart, you can clearly see the end of the first trading day (as shown by the arrow) and yet the data of the next trading is still being displayed. I have also attached the time settings of the chart and the session template I am using.
Could this problem have anything to do with the fact that the chart uses line break (tick) as the data series? Since this data series is time-independent, a single bar can be created from anything ranging from a second to hours even.
Please advise.
Comment
-
Hello mbesha,
This is because your Session Template include an overnight session.
When you have a date set inside of your Chart NinjaTrader will take all sessions that are going to display for that day and display them fully meaning that since the two sessions are going to be displaying on one day NinjaTrader will load them both up.
If you wanted to see only one you will want to define one from Sunday To Sunday and Monday to Monday.
Also make sure that the Session Time zone matches your local PC time zone.
Let us know if that helps.JCNinjaTrader Customer Service
Comment
-
Let me see if I got you right...
So am I to understand that since one session crosses over from one day into the next under my current session template, the chart will display the data for the 2 days i.e two trading sessions? I tried the suggestion you gave me (to set the parameters of the sessions template between one midnight and the next) but this ends up truncating some of the data for the session because a session starts and ends just before 7 a.m. here. So is there no possible way of plotting the data for just 1 session because it spans across two literal days? I am asking this because I am using an automated custom strategy to execute my trades and it is designed such that it only works correctly if the data it is fed with is from the start of one session to its end. If it is impossible to chart the data as per my request, could you then advise me on how I can set my custom strategy to only execute within one session ( even though the chart were to plot 2 sessions under my current session template, I would like the custom strategy to execute only within the limits of the start and end of one session). Thanks.
Comment
-
Originally posted by mbesha View Post... I am asking this because I am using an automated custom strategy to execute my trades and it is designed such that it only works correctly if the data it is fed with is from the start of one session to its end. If it is impossible to chart the data as per my request, could you then advise me on how I can set my custom strategy to only execute within one session ( even though the chart were to plot 2 sessions under my current session template, I would like the custom strategy to execute only within the limits of the start and end of one session). Thanks.
Comment
-
Hello mbesha,
Correct, this is a limitation inside of NinjaTrader 7, we are looking at reworking how Sessions are handled in the next major release of NinjaTrader.
With that said, you may want to add some checks as Koganam stated so that you can filter out data that you do not want to see.
You may also use the GetNextBeginEnd() to get the session start and end date time to help filter it as well.
Happy to be of further assistance.JCNinjaTrader Customer Service
Comment
-
Originally posted by koganam View PostIt looks then like you need to reset your data at FirstBarOfSession. ref: http://www.ninjatrader.com/support/h...rofsession.htm
Comment
-
Hello mbesha,
Here is an example of how to filter out data:
Code:private bool firstSession = true; protected override void OnBarUpdate() { //Since by default BarsRequired is 20 the FirstBarOfSession is not going to be true // but we can check the for the next session to stop the strategy from calculating. if(Bars.FirstBarOfSession) { firstSession = false; } if(firstSession) { //Do something... } }
JCNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by bortz, 11-06-2023, 08:04 AM
|
47 responses
1,606 views
0 likes
|
Last Post
by aligator
Today, 07:22 PM
|
||
Started by jaybedreamin, Today, 05:56 PM
|
0 responses
8 views
0 likes
|
Last Post
by jaybedreamin
Today, 05:56 PM
|
||
Started by DJ888, 04-16-2024, 06:09 PM
|
6 responses
18 views
0 likes
|
Last Post
by DJ888
Today, 05:12 PM
|
||
Started by Jon17, Today, 04:33 PM
|
0 responses
4 views
0 likes
|
Last Post
by Jon17
Today, 04:33 PM
|
||
Started by Javierw.ok, Today, 04:12 PM
|
0 responses
13 views
0 likes
|
Last Post
by Javierw.ok
Today, 04:12 PM
|
Comment