Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calculate Trading Days Count Between Two Date

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

    Calculate Trading Days Count Between Two Date

    Hello,

    Is there a fuction in ninja that calculate real trading days between to date which is exclude holidays, weekend etc? If there is, what is it behaviour for half trading days (late open, early close days)?

    Thanks.

    #2
    Hello aytacasan,

    Thanks for your post.

    You can use the Session Iterator for the trading days, please see the method/properties here: https://ninjatrader.com/support/help...oniterator.htm

    You may also need to use the Trading hours method/properties here: https://ninjatrader.com/support/help...adinghours.htm

    Comment


      #3
      Hello Paul,

      I'm aware of tradinghours and sessioniterator classes. I used them in my indicators many times. I asked a question because of is tehere any internal method directly calculate value? Or is there any indicator calculate value already now. So i used an existing code easily. Can you help more about my problem?

      Thanks,
      Aytac

      Comment


        #4
        Hello aytacasan,

        Thanks for your reply.

        I may not be understanding what you are asking for but If you would like something created for you we can provide a link to 3rd party programmers in the NinjaTrader Ecosystem that can create what you need.

        Comment


          #5
          Hello Paul,

          Thanks for your 3rd party recomendation. This is what you call support. How could not think about it? Are you sure i need 3rd party programmer for find how many trading days are between current bar and 20 bar ago bar on a daily or weekly or monthly chart?

          Also i'm a software developer and have 25 years experience so dont need any programmer. I asked simple question. If you have any usefull info for me please share it. If not simply say don't know. Sure i can solve my problem my self. Ask this question because maybe you have more effective solution/idea beucase you have experiance especially about ninjatrader.

          PS: If you said "I dont understand your problem can you explain in more detail". I would gladly explain it in more detail. I don't like to hear 3rd party recomendation from ninjatrader support team especially for a simple little question. I think most of the people knows there is a 3rd party solution if you need full solution for custom indicator or trading strategy.

          Thanks for your support.
          Last edited by aytacasan; 03-10-2021, 06:39 PM.

          Comment


            #6
            Hello aytacasan,

            Thanks for your reply.

            There is no direct method to advise.

            You could loop through days and use IsTradingDayDefined to determine if it is a trading day.
            Reference: https://ninjatrader.com/support/help...daydefined.htm

            Comment


              #7
              Hello Paul,

              Thanks for your help.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              626 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              359 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              105 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              562 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              567 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X