Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Orderflow Trade Detector

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

    Orderflow Trade Detector

    Hey!

    Is there any way to get access to the OrderFlow Trade Detector indicator that NinjaTrader provides?

    Thanks,

    Tarik

    #2
    Hello tarikmedjber,

    Thanks for your note.

    There is no NinjaScript access available for the Order Flow Trade Detector indicator at this time.

    The available Order Flow indicators that support NinjaScript access could be found in the System Indicator Methods help guide linked below. The available Order Flow indicators are:
    • Order Flow Cumulative Delta
    • Order Flow Volumetric Bars
    • Order Flow VWAP

    System Indicator Methods: https://ninjatrader.com/support/help...indicators.htm

    Let me know if I may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Ahh okay thank you,

      Do you know the way to get the size of each trade that has just come into the market then? Basically level 2 buys and sells?

      I'm doing
      Code:
       protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
      {
      // Print some data to the Output window
      if (marketDataUpdate.MarketDataType == MarketDataType.Last)
      {
       Print(marketDataUpdate.Volume) // which prints what I want I think but how would I get whether it was a buy or sell?
      }
      }
      Thanks,

      Tarik

      Comment


        #4
        Hello tarikmedjber,

        Thanks for your note.

        OnMarketData() would be used to access level 1 data.

        Ask would refer to buys and Bid would refer to sells.

        See this help guide for information about OnMarketData() and sample code: https://ninjatrader.com/support/help...marketdata.htm

        The BuySellVolume indicator that comes default with NinjaTrader is a good example of getting the Buys and Sells using OnMarketData(). To view the script, open a New > NinjaScript Editor window, open the Indicators folder, and double click on the BuySellVolume indicator file.

        You could use OnMarketDepth() to access level 2 data in NinjaScript.

        See the help guide page linked below for more information about OnMarketDepth() and sample code demonstrating how to get the most recent change in ask price and volume.

        OnMarketDepth(): https://ninjatrader.com/support/help...arketdepth.htm

        Let me know if I may assist further.
        Last edited by NinjaTrader_BrandonH; 08-24-2022, 10:21 AM.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          Hi Brandon,

          Thanks for your help but using OnMarketData does work only if the MarketDataType is "last", it shows the most recent size traded but I need to know whether that was a buy or sell? Using the "Ask" or "Bid" seems to get the volume that is sitting at the nearest bid or ask price and not the volume that has just traded?

          Thanks

          Comment


            #6
            Hello tarikmedjber,

            Thanks for your note.

            The BuySellVolume indicator mentioned in my previous email demonstrates how to determine if the Last tick was an Ask or Bid tick using the logic below. Ask ticks refer to buys and bid ticks refer to sells. You could then print out the volume of that ask or bid tick.

            Code:
            [I]protected override void OnMarketData(MarketDataEventArgs e)
            {
                if(e.MarketDataType == MarketDataType.Last)
                {
                    if(e.Price >= e.Ask)
                        //Ask tick
                    else if (e.Price <= e.Bid)
                        //Bid tick
                }
            }[/I]
            To see the BuySellVolume indicator code, open a New > NinjaScript Editor window, open the Indicators folder, and double click on the BuySellVolume indicator file.

            See this help guide for information about OnMarketData() and sample code: https://ninjatrader.com/support/help...marketdata.htm

            Let me know if I may assist further.
            <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

            Comment


              #7
              Ahhhh perfect thank you, sorry I didn’t realise I had to combine the two. That’s great thanks very much.

              tarik

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              582 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              338 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              103 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              554 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              552 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X