• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Check whether Bar is last bar of current month

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

    Check whether Bar is last bar of current month

    Hi

    I was searching already the forum and found some similar discussions, but not exactly what I look for.

    In my strategy I want to know whether the current bar is the last bar of that month.
    Example: Time[0] = 29th March 2019. This would be the last bar of the month "March 2019", because 30th March is Saturday and the next bar I have in the data set is 1st of April 2019.

    I guesst the problem is that one cannot look forward in the dataset. But maybe there is a function or a way to identify whether the current bar ist last bar of the month?


    #2
    Hello Beauregard, thank you for your post.

    I found this solution on getting the last business day of the month:

    You can check if Times[0][0].Day == the calculated day from that solution and also use IsLastBarOfSession to get a "last bar of month" condition.

    Best regards.


    Chris L.NinjaTrader Customer Service

    Comment


      #3
      hi Chris

      thanks for the feedback. Yes, I am aware that it can be calculated,there are also libraries returning for a given date & stock exchange, whether it is a business day or not.
      However, if NT would have had such a function, it would be much easier, since NT "knows" the data in the dataseries object.

      Comment


        #4
        Hello Beauregard, thanks for your reply.

        I will submit a feature request to add a last bar of month method.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ralett, Today, 11:28 AM
        0 responses
        2 views
        0 likes
        Last Post ralett
        by ralett
         
        Started by ChazJ, Today, 09:59 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Irukandji, Today, 09:34 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by lunardiplomacy, Today, 08:32 AM
        3 responses
        13 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by ralett, Today, 08:24 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Working...
        X