Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Arrays or DataSeries for storing sequences?

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

    Arrays or DataSeries for storing sequences?

    Hi all,

    I'm trying to decide what type of list method I should use to store patterns of volume/MFI sequences I'm seeing on an equity chart. I'm leaning more towards ArrayLists, but I'd like some perspective.

    Here's what I'm attempting to do.

    As the market moves through the day on a one minute chart, I'm having my strategy look for volume and MFI (Money Flow Index) patterns. Right now, whenever a one-minute volume bar goes over the 14 period moving average by more than 2 (i.e. the moving average of an example one minute bar is 50000, and volume is 115000), it registers a hit and increments a value.

    What I'm thinking about doing is storing these patterns in a multi-dimensional array list and triggering buy/sell orders based on those patterns. So it would work something like this:

    Start:

    2x volume hit (Set the first value of the array to '2x')
    Evaluate arraylist for pattern. If no pattern, no action.

    3x volume hit (Set the second value of the array to '3x')
    Evaluate.. If no pattern, no action and continue.

    MFI hit (Set the third value of the array to 'MFI')
    Evaluate. Pattern matches, and order executes.
    Array either resets all stored values, or moves do a different dimension (Array[1][0]) to store a new pattern.

    ....

    Rinse and repeat.

    Make sense? I'd probably also add a date/time stamp to see when the pattern occurred if I were to store the dimensions in the array.

    My biggest question is.. would a dataseries object be more appropriate for this?

    Thanks in advance to any responses.

    Yours,
    Spider

    #2
    Unfortunately we would not be able to assist with creating an ArrayList, but it would be possible to use with custom C# programming.

    I see no reason you wouldn't be able to accomplish this with using a supported DataSeries object.
    MatthewNinjaTrader Product Management

    Comment


      #3
      I'm not asking for anyone to code it . I'm planning on doing that.
      I'm just wondering if arraylists or dataseries objects are a better direction to go in.

      The one question I'm trying to answer is... can dataseries and/or arraylists be evaluated by looking for sequences? Meaning, can I search a dataseries by "3x", "2x", "2x", in that order?

      Comment


        #4
        Hello,

        A data series would only be able to hold one value for every bar on the chart. If you are looking to store more information per bar, you would need to use an Array or Array list.
        MatthewNinjaTrader Product Management

        Comment


          #5
          Originally posted by Spiderbird View Post
          I'm not asking for anyone to code it . I'm planning on doing that.
          I'm just wondering if arraylists or dataseries objects are a better direction to go in.

          The one question I'm trying to answer is... can dataseries and/or arraylists be evaluated by looking for sequences? Meaning, can I search a dataseries by "3x", "2x", "2x", in that order?
          Sounds like you need to use structs to hold your related values, and ArrayLists to hold your structs.

          Comment


            #6
            Thanks for the suggestions Koganam and Matthew! I'm all set over here and coding away. Appreciate the time.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            633 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            364 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            567 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            568 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X