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 CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        52 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        29 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        194 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        355 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        274 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X