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!
See more
See less

Partner 728x90

Collapse

fnding market close and open times

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • bltdavid
    replied
    Originally posted by ballboy11 View Post
    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 .
    But is that really necessary? I mean, come market close on
    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˘.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hi ballboy11,

    What are the error messages you are getting?

    Is sessionBegin set to a valid time (and does not have a null value)?

    Leave a comment:


  • ballboy11
    replied
    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.

    Leave a comment:


  • NinjaTrader_JoshG
    replied
    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.

    Leave a comment:


  • ballboy11
    replied
    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

    Leave a comment:


  • NinjaTrader_JoshG
    replied
    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.

    Leave a comment:


  • bltdavid
    replied
    Originally posted by NinjaTrader_Josh View Post
    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.


    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.
    There will be gotchas along the way if you (or someone using your indicator)
    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?

    Leave a comment:


  • NinjaTrader_JoshG
    replied
    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.

    Leave a comment:


  • ballboy11
    started a topic fnding market close and open times

    fnding market close and open times

    I am trying to find the market close and open times for instruments. the reason is my drawing objects group up in that area. If i know the open and close of the times I will add it to my indicator.

Latest Posts

Collapse

Topics Statistics Last Post
Started by elirion, Today, 01:36 AM
0 responses
3 views
0 likes
Last Post elirion
by elirion
 
Started by gentlebenthebear, Today, 01:30 AM
0 responses
2 views
0 likes
Last Post gentlebenthebear  
Started by samish18, Yesterday, 08:31 AM
2 responses
9 views
0 likes
Last Post elirion
by elirion
 
Started by Mestor, 03-10-2023, 01:50 AM
16 responses
389 views
0 likes
Last Post z.franck  
Started by rtwave, 04-12-2024, 09:30 AM
4 responses
33 views
0 likes
Last Post rtwave
by rtwave
 
Working...
X