• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Volume Footprint in DataSeries?

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

    Volume Footprint in DataSeries?

    Hi everyone

    I want to program my own implementation of volume footprints similar to what OFA and Rancho Dinero are doing.

    So I need to be able to store arrays of "bid x ask volumes" at different prices corresponding to the bars on the chart. A single bar might look like this:

    2101.25, 1256, 0
    2101.00, 753, 987
    2100.75, 277, 881
    2100.50, 0, 233

    How do I do that? As I understand DataSeries only stores double values...

    Any help would be greatly appreciated!
    Chris

    #2
    Hello,

    You should be able to input each of these numbers as doubles into a data series. Then, if you need to use them as ints in the future, you can use Math.Round() with an explicit type case to int, like so:

    int x = (int) Math.Round(Values[0][0], 2);

    Using a data series for this will give you the advantage of the indexes already being pegged to each bar in the primary data series, which makes matching things up much easier.
    Dave I.NinjaTrader Product Management

    Comment


      #3
      I am still struggling with how to store the data in Dataseries...

      I want to store sets of price-bid vol-ask vol data for each bar as mentioned in the original post. Do I have to use three separate Dataseries per each set I guess? And then I need to be able to store a unknown number of these sets in any given bar, how do I do that?

      Thx!

      Comment


        #4
        Hello,

        I can see two potential ways to accomplish this, although there could be more. Since data series are automatically pegged to bar numbers, you might consider just using two data series -- one for the Bid price, and another for the Ask volume. The two data series should always be in synch, since their indexes correspond to bar numbers.

        To set values in a data series, you can either use .Add(), or assign values to specific indexes, such as "Values[0][0] = x"

        Alternatively, if you really want to link this information together, you might consider using a multi-dimensional array. More information on multi-dimensional arrays can be found at the link below:

        https://msdn.microsoft.com/en-us/library/2yd9wwz4.aspx
        Dave I.NinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by sergey_z, Today, 02:34 AM
        2 responses
        11 views
        0 likes
        Last Post sergey_z  
        Started by frankduc, Today, 05:24 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by shmarola, Today, 01:01 AM
        0 responses
        4 views
        0 likes
        Last Post shmarola  
        Started by CriticalMind, 11-29-2015, 12:39 PM
        3 responses
        1,323 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by novel168, 06-14-2019, 09:20 PM
        2 responses
        9 views
        0 likes
        Last Post novel168  
        Working...
        X