Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 GLFX005, Today, 03:23 AM
            0 responses
            1 view
            0 likes
            Last Post GLFX005
            by GLFX005
             
            Started by XXtrader, Yesterday, 11:30 PM
            2 responses
            11 views
            0 likes
            Last Post XXtrader  
            Started by Waxavi, Today, 02:10 AM
            0 responses
            6 views
            0 likes
            Last Post Waxavi
            by Waxavi
             
            Started by TradeForge, Today, 02:09 AM
            0 responses
            14 views
            0 likes
            Last Post TradeForge  
            Started by Waxavi, Today, 02:00 AM
            0 responses
            3 views
            0 likes
            Last Post Waxavi
            by Waxavi
             
            Working...
            X