Announcement

Collapse
No announcement yet.

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, "Buys: " + priceLevelsAsk[marketDataUpdate.Price.ToString()].ToString(), -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 Realsmooth3, Yesterday, 09:10 PM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_Marco  
            Started by wooofad, 06-15-2020, 01:08 PM
            8 responses
            92 views
            0 likes
            Last Post echoxray  
            Started by bubblegum, Today, 12:00 AM
            0 responses
            2 views
            0 likes
            Last Post bubblegum  
            Started by eseorvuda, Yesterday, 10:28 PM
            0 responses
            2 views
            0 likes
            Last Post eseorvuda  
            Started by ctrent, Yesterday, 09:58 PM
            0 responses
            5 views
            0 likes
            Last Post ctrent
            by ctrent
             
            Working...
            X