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

Block trade identification

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

    Block trade identification

    Hi, how can I tell if a block trade is posted as a buy or sell order?

    #2
    Hello torch2k,

    Thank you for your post.

    To determine the position of orders made you could use the Account class and loop through your account positions to print the position Quantity, MarketPosition, and AveragePrice.

    See the attached example script demonstrating how this could be accomplished.

    Also, see the help guide documentation below for more information.
    Account class - https://ninjatrader.com/support/help...ount_class.htm
    Positions - https://ninjatrader.com/support/help...ns_account.htm

    Let us know if we may assist further.
    Attached Files
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Sorry, i don't think I was clear enough in my initial question..

      I am using an indicator that I found supplied on here called TnSVolumeExample. It draws orders on the chart based on a certain block size using "OnMarketData". I'd like to know if it is possible to determine if these large blocks are sell orders, or buy orders.

      Attached Files

      Comment


        #4
        Hello torch2k,

        Thank you for the clarification.

        You could do something similar to the BuySellVolume indicator that comes default with NinjaTrader. The BuySellVolume indicator uses OnMarketData() to check if the price is greater than or equal to the Ask to determine the number of buys made and it also checks if the Price is less than or equal to the Bid to determine the number of sells made.

        I see the TnSVolumeExample already checks if the Price is >= the Ask and checks if the Price is <= Bid within OnMarketData(). You could consider simply changing the text of the Draw.Text() methods so that they draw something like "Buys" or "Sells".

        For example, see below:
        Code:
        Draw.Text(this, "My text 1" + marketDataUpdate.Price.ToString() + CurrentBar, true,[B] "Buys: " + priceLevelsAsk[marketDataUpdate.Price.ToString()].ToString()[/B], -1, marketDataUpdate.Price + offset, 0, Brushes.Green, new SimpleFont("Arial", 11), TextAlignment.Center, Brushes.Transparent, Brushes.Black, 100);
        See the BuySellVolume indicator that comes with NinjaTrader for an example of determining buys and sells. To view the BuySellVolume indicator code, open a New > NinjaScript Editor window, open the Indicators folder, then locate and select the BuySellVolume indicator.

        Also, see the help guide documentation below for more information about using OnMarketData().
        OnMarketData() - https://ninjatrader.com/support/help...marketdata.htm
        Draw.Text() - https://ninjatrader.com/support/help...tsub=Draw.Text

        Let us know if we may assist further.
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Ok, thanks. Just to be clear though, this is not telling me if the order is a specifically a buy or a short though, right? Just if the sale price was above ask or below bid?

          Comment


            #6
            Hello torch2k,

            Thank you for your note.

            That is correct. Buys would be considered as the price above the Ask. Sells would be considered as the price below the Bid.

            Please let us know if you have further questions.
            Brandon H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Waxavi, Today, 02:10 AM
            0 responses
            6 views
            0 likes
            Last Post Waxavi
            by Waxavi
             
            Started by TradeForge, Today, 02:09 AM
            0 responses
            11 views
            0 likes
            Last Post TradeForge  
            Started by Waxavi, Today, 02:00 AM
            0 responses
            2 views
            0 likes
            Last Post Waxavi
            by Waxavi
             
            Started by elirion, Today, 01:36 AM
            0 responses
            4 views
            0 likes
            Last Post elirion
            by elirion
             
            Started by gentlebenthebear, Today, 01:30 AM
            0 responses
            5 views
            0 likes
            Last Post gentlebenthebear  
            Working...
            X