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

Weekly Chart - Get Week Number

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

    Weekly Chart - Get Week Number

    On the Weekly charts, the Mini Data Box (click middle mouse button) it shows W: 1/2021. I am assuming that is the week number of the year.

    How can I get access to that week number?

    #2
    Hello TAJTrades,

    Thank you for your post.

    There wouldn't be a NinjaScript method to check this, however, you could check the week of year in code by using C# methods like the following:

    https://docs.microsoft.com/en-us/dot...tframework-4.8

    This thread from the forum goes into how you might apply this in your scripts:

    I want to test whether adding WeekOfYear filter would be of improvement. Yet I am unable to find function WeekOfYear in manual. I tried searching "C# WeekOfYear", yet it seems that C# has that function and NinjaTrader doesn't. How can I calculate WeekOfYear?


    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thank you. I spot checked a couple of weekly charts and it appears that the Microsoft code matches the Ninja Week Number.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by PhillT, Today, 02:16 PM
      2 responses
      3 views
      0 likes
      Last Post PhillT
      by PhillT
       
      Started by Kaledus, Today, 01:29 PM
      3 responses
      9 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by frankthearm, Yesterday, 09:08 AM
      14 responses
      47 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by gentlebenthebear, Today, 01:30 AM
      2 responses
      14 views
      0 likes
      Last Post gentlebenthebear  
      Started by PaulMohn, Today, 12:36 PM
      2 responses
      17 views
      0 likes
      Last Post PaulMohn  
      Working...
      X