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

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 ZenCortexCLICK, Today, 04:58 AM
        0 responses
        5 views
        0 likes
        Last Post ZenCortexCLICK  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        172 responses
        2,280 views
        0 likes
        Last Post sidlercom80  
        Started by Irukandji, Yesterday, 02:53 AM
        2 responses
        18 views
        0 likes
        Last Post Irukandji  
        Started by adeelshahzad, Today, 03:54 AM
        0 responses
        7 views
        0 likes
        Last Post adeelshahzad  
        Started by Barry Milan, Yesterday, 10:35 PM
        3 responses
        13 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X