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 NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        93 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        152 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        80 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        53 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        65 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X