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

Order Flow Methods?

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

    Order Flow Methods?

    Hello!

    I'm searching around for a complete list of methods to access Order Flow.

    I see some things here and there but I'm not seeing any methods to access imbalance. Specifically, I'd like to count the number of imbalances per bar as a condition. See attachment.

    Can you point me to the docs?

    Thanks!

    P.S. Also, the docs are in frames so I can't figure out how you guys send links. Whenever I try and drop a link here it's just a general holding page, not the detail page I'm referencing. How do you send those direct links to pages?
    Attached Files

    #2
    Hello coopgrafik,

    Thanks for your post.

    Here are links to the available Ninjascript Methods and properties:





    To determine the imbalances you would need to iterate through each price level and pull the volume data. There is no direct method for this.

    in the help guide, on a sub-page, look to the bottom right of the sub-page for "permalink" what will provide the link to that sub-page.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply. I ran the trace in the example code for the volumetric bars and got this:

      ================================================== =====================
      Bar: 6587
      Trades: 112
      Total Volume: 249
      Total Buying Volume: 78
      Total Selling Volume: 171
      Delta for bar: -93
      Delta for bar (%): -37.3493975903614
      Delta for Close: 9
      Ask for Close: 9
      Bid for Close: 0
      Volume for Close: 9
      Maximum Ask: 69 at price: 3915.75
      Maximum Bid: 166 at price: 3915.75
      Maximum Combined: 235 at price: 3915.75
      Maximum Positive Delta: 9
      Maximum Negative Delta: -97
      Max seen delta (bar): 1
      Min seen delta (bar): -96
      Cumulative delta (bar): 2063

      What I feel like I'm looking for is a method that would return an array of values that would correspond with each tick level on the current bar after it closes. Once I had that, I'd be able to loop through those values and pick out the info I'm looking for and make the comparisons.

      When you say, "To determine the imbalances you would need to iterate through each price level and pull the volume data." which specific method are you referring to collect that data? Again, everything I see that is available is a single value. To determine an imbalance I would need bid and ask values for each tick of a bar. Hope that makes sense.

      Thanks!
      Last edited by coopgrafik; 02-12-2021, 12:03 PM.

      Comment


        #4
        Hello coopgrafik,

        Thanks for your reply.

        Correct, you will need to cycle through each price level in the bar and use GetAskVolumeForPrice(), GetBidVolumeForPrice()

        Here is an example:

        for (int i = 0; i <= ((High[0] - Low[0]) / TickSize); i++) // cycle through each tick level
        {
        long a = barsType1.Volumes[CurrentBar].GetAskVolumeForPrice(High[0] -(i*TickSize)); // start at the top and work down
        long b = barsType1.Volumes[CurrentBar].GetBidVolumeForPrice(High[0] -(i*TickSize));
        long c = barsType1.Volumes[CurrentBar].GetDeltaForPrice(High[0] -(i*TickSize));
        Print ("CB: "+CurrentBar+" Price: "+(High[0] - (i*TickSize))+" BidV: "+b+" AskV: "+a+" delta? "+c);
        }
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Ok, that was a HUGE leg up. I'm more of a javascript guy so I have C# to deal with and I'm not totally familiar with all the available methods yet so this got me pointed in the right direction.

          Thank you so much!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by anp23, 02-09-2024, 04:40 PM
          5 responses
          712 views
          0 likes
          Last Post backtester831  
          Started by Clevchin, Today, 12:57 PM
          0 responses
          2 views
          0 likes
          Last Post Clevchin  
          Started by kidpoker007, 05-30-2024, 01:43 PM
          12 responses
          136 views
          0 likes
          Last Post backtester831  
          Started by rtwave, 06-13-2024, 12:10 AM
          8 responses
          92 views
          0 likes
          Last Post rtwave
          by rtwave
           
          Started by samish18, Today, 03:48 AM
          6 responses
          13 views
          0 likes
          Last Post samish18  
          Working...
          X