Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Create Custom Date Series

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

    Create Custom Date Series

    Hello,

    I have a set of 50 dates in Excel and in my strategy, I want to be able to check to see if today's date is equal to any of those 50 dates.

    I figured that I need to create a custom series in the strategy and store all the dates in that series somehow and then check against it in a loop, but I'm unsure how to do that exactly. Would anyone be able to help? Thanks in advance.

    #2
    Hello fiddich,

    A Series<T> object holds a value for every bar on the chart. Are you trying to save a value for every bar on the chart?

    Or are you trying to save a list of items which can be saved in an Array or List<T> object?

    Below is a link to the help guide on Series<T> which includes example code.


    Also, below is a public link to a 3rd party educational site on for loops.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      The latter, trying to save a list of items (dates) and store them in an array so I can check against them within the strategy.

      Comment


        #4
        Hello fiddich,

        Use an array (DateTime[]) or a list (List<DateTime>). These are general c# objects and are specific to NinjaScript.

        Below are public links to a 3rd party educational site on arrays and lists.

        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        87 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        132 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        65 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        118 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        67 views
        0 likes
        Last Post PaulMohn  
        Working...
        X