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
fnding market close and open times
Collapse
X
-
Hello,
Thanks for your post.
By using GetNextBeginEnd, you can access the session begin/end times being used for each unique instrument that you are charting.
https://ninjatrader.com/support/help...xtbeginend.htm
Along with the GetNextBeginEnd help guide article above, you may want to check out the MSDN page for DateTime as well. I am including a link to that page below.
https://msdn.microsoft.com/en-us/library/xcfzdy4x.aspx
Please let me know if you have any further questions.Josh G.NinjaTrader Customer Service
-
Originally posted by NinjaTrader_Josh View PostHello,
Thanks for your post.
By using GetNextBeginEnd, you can access the session begin/end times being used for each unique instrument that you are charting.
Along with the GetNextBeginEnd help guide article above, you may want to check out the MSDN page for DateTime as well. I am including a link to that page below.
Please let me know if you have any further questions.
uses a Session Template other than <Use instrument settings>.
I mean, using "Default 24/7" seems common, but doing so means
GetNextBeginEnd will return the time equivalent to midnight in New,
York (ie, midnight from Eastern time zone adjusted to your local time
zone) as the session close DateTime.
If you use a multi-session Session Template (as needed sometimes
for Harry's, aka "FatTails" on futures.io, session indicators), these
templates return different values for GetNextBeginEnd, depending
which hour of the multiple defined sessions you're "inside of".
NinjaTrader support, is this correct?
Isn't GetNextBeginEnd completely dependent upon the session
template in use?
Comment
-
Hello,
You are correct. Unfortunately, there is no way to set the Session template in your strategy using NinjaScript. So, using GetNextBeginEnd would be entirely dependent on the Session Template that is selected when the strategy is applied.
Please let me know if you have any further questions.Josh G.NinjaTrader Customer Service
Comment
-
Interesting but for a basic user to find when the market closes IE MST 1500 and Opens at 1600 GetNextBeginEnd is the best solution. What I have to do is find the close and truncate that 1 hour time when I draw. I have rays and sometimes my Anchors lie in that close hour. Also I have noticed in financials NQ there is a 15 minute hole. Is that common and if so what is a common solution in printing around these times
Comment
-
Hello ballboy,
Unfortunately, there is not a way to check for gaps in data through NinjaScript. I would not say that gaps are a particularly common occurrence, but it does happen from time to time. That being said, we would like to know more information about the gap that you experienced in your data. Please write into our support team at PlatformSupport(at)NinjaTrader(dot)com with this item so that we can check on this for you.Josh G.NinjaTrader Customer Service
Comment
-
i was wondering if you can look at the code sample I am close but I still have some line issues
public DateTime EndOfDayWeekendConversion(DateTime tTimeToCheck)
{
if(tTimeToCheck.DayOfWeek == DayOfWeek.Friday && sessionBegin.Hour <= tTimeToCheck.Hour )
{
tTimeToCheck = tTimeToCheck.AddHours(50);
}
else if(sessionBegin.Hour == tTimeToCheck.Hour)
{
tTimeToCheck = tTimeToCheck.AddHours(1);
return tTimeToCheck;
}
What it does is supposed to bypass the weekend and start drawing on sunday open or in that area AND if it is a weekday jump an hour .
the timestamp is recorded so it needs to check only once.
Comment
-
Originally posted by ballboy11 View PostWhat it does is supposed to bypass the weekend and start drawing on sunday open or in that area AND if it is a weekday jump an hour .
a Friday, there are no bars to worry about until Sunday's open.
Your code simply will not run until bars appear, so if left to run
over the weekend, it does nothing -- but this is considered
completely normal.
For ex, no indicator in bin/Custom/Indicators cares about the
weekend break, yet they all look "visually continuous" come
session open on Sunday.
Just my 2˘.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by f.saeidi, Today, 11:02 AM
|
1 response
2 views
0 likes
|
Last Post Today, 11:08 AM | ||
Started by geotrades1, Today, 10:02 AM
|
4 responses
12 views
0 likes
|
Last Post
by geotrades1
Today, 11:08 AM
|
||
Started by rajendrasubedi2023, Today, 09:50 AM
|
3 responses
16 views
0 likes
|
Last Post Today, 10:57 AM | ||
Started by lorem, Today, 09:18 AM
|
2 responses
11 views
0 likes
|
Last Post Today, 10:55 AM | ||
Started by geddyisodin, Today, 05:20 AM
|
4 responses
30 views
0 likes
|
Last Post
by geddyisodin
Today, 10:45 AM
|
Comment