Announcement

Collapse
No announcement yet.

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.

    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 DannyP96, 05-18-2026, 02:38 PM
      1 response
      83 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      143 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      83 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      256 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      334 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X