![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Apr 2012
Posts: 67
Thanks: 27
Thanked 8 times in 7 posts
|
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 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,770
Thanks: 158
Thanked 562 times in 553 posts
|
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.
Matthew
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Apr 2012
Posts: 67
Thanks: 27
Thanked 8 times in 7 posts
|
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? |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,770
Thanks: 158
Thanked 562 times in 553 posts
|
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.
Matthew
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Matthew for this post: |
|
|
|
#5 | |
|
Senior Member
|
Quote:
|
|
|
|
|
|
The following user says thank you to koganam for this post: |
|
|
|
#6 |
|
Member
Join Date: Apr 2012
Posts: 67
Thanks: 27
Thanked 8 times in 7 posts
|
Thanks for the suggestions Koganam and Matthew! I'm all set over here and coding away. Appreciate the time.
|
|
|
|
![]() |
| Tags |
| arraylist, dataseries, mfi, sequence, volume |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DataSeries verses Array: Processing and storing non-sequential data | tonyh | Indicator Development | 0 | 10-25-2011 08:00 AM |
| Arrays of DataSeries | DLatNT | Indicator Development | 3 | 10-10-2011 11:08 AM |
| Help with Arrays not DataSeries Compiles won't run | Crassius | Indicator Development | 4 | 02-25-2011 03:38 PM |
| Calculating and storing in DataSeries | Skeletor | Strategy Development | 2 | 06-20-2010 01:50 AM |
| Using Arrays | LloydH | Automated Trading | 4 | 03-17-2010 06:05 AM |