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

Book Sweep

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

    Book Sweep

    Hi,
    I am trying to identify "book sweep" events in the order book


    My definition for "Book Sweep"(for now to keep things simple) would be - where a single OR multiple market orders(say BUY) take all the liquidity from a LEVEL and price moves to the next LEVEL above.

    I would then basically then have a parameter to define the number of levels taken out to qualify as a book sweep.
    I have looked through OnMarketDepth() and OnMarketData()
    but not clear on how to identify a Order(s) as a Market Buy, which matched ALL available liquidity at a LEVEL.


    Not looking for complete code, just some samples or pointers, I guess similar to the "Order Flow Trade Detector" indicator, which basically is trying to identify large trades, but in my case, I am looking for ALL trades, small or large.


    I have access to BOTH CQG and Rithmic data feeds, as not sure whether this may be a MDP 2.0 vs MDP 3.0 issue, as some posts here seem to suggest



    TIA,


    SDG



    #2
    Hello SuperDriveGuy,

    Thanks for the post.


    If you have not done so already, have a look at this reference sample that implements a level II price book in the style of the SuperDOM.



    A more simplified indicator that uses this buy/sell detection technique is the BuySellVolume indicator.

    If you have already established this logic in your script, I will need more information on this problem statement:

    ...how to identify a Order(s) as a Market Buy, which matched all available liquidity at a level.
    I look forward to assisting further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi Chris,


      Thanks for your update. I will look into the examples you sent. In answer to your query, regarding my statement...



      "...how to identify a Order(s) as a Market Buy, which matched all available liquidity at a level.


      Price x Quantity
      66.29 x 60
      66.28 x 50
      66.27 x 10


      Market Buy Order for 100 contracts comes through at 66.27 and it "sweeps" ALL available liquidity at 66.27(10)+66.28(50) and fills the rest from 66.29(40).

      (in real life, it could be one or more market buy orders) See liquidity at 27 of 31, was taken out by multiple orders, I would define this as a book sweep, as they were all BUY orders
      Ask = 12826.5 3
      Last = 12826.5 1
      Ask = 12826.5 2
      Last = 12826.5 1
      Ask = 12826.5 1
      Last = 12826.5 1
      Last = 12827 1
      Ask = 12827 31
      Last = 12827 1
      Ask = 12827 30
      Last = 12827 1
      Ask = 12827 29
      Last = 12827 1
      Ask = 12827 28
      Last = 12827 3
      Ask = 12827 25
      Last = 12827 11
      Ask = 12827 14
      Last = 12827 6
      Ask = 12827 8
      Last = 12827 1
      Ask = 12827 7
      Last = 12827 1
      Ask = 12827 6
      Last = 12827 2
      Ask = 12827 4
      Last = 12827 2
      Ask = 12827 2
      Last = 12827 2
      Ask = 12827.5 3
      Last = 12827.5 3

      In this scenario, I would interested in identifying "Book Sweep" as having occured at 66.27 and 66.28.


      I hope that makes sense.


      Thanks
      Last edited by SuperDriveGuy; 06-13-2018, 02:51 AM.

      Comment


        #4
        Rather than editing my post I should have replied with a NEW post, sorry about that.

        I repeated below the entire post....




        Hi Chris,


        Thanks for your update. I will look into the examples you sent. In answer to your query, regarding my statement...



        "...how to identify a Order(s) as a Market Buy, which matched all available liquidity at a level.


        Price x Quantity
        66.29 x 60
        66.28 x 50
        66.27 x 10


        Market Buy Order for 100 contracts comes through at 66.27 and it "sweeps" ALL available liquidity at 66.27(10)+66.28(50) and fills the rest from 66.29(40).



        In this scenario, I would interested in identifying "Book Sweep" as having occurred at 66.27 and 66.28.

        (in real life, it could be one or more market buy orders) See liquidity at 27 of 31, was taken out by multiple orders, I would define this as a book sweep, as they were all BUY orders
        Ask = 12826.5 3
        Last = 12826.5 1
        Ask = 12826.5 2
        Last = 12826.5 1
        Ask = 12826.5 1
        Last = 12826.5 1
        Last = 12827 1
        Ask = 12827 31 ---->
        Last = 12827 1
        Ask = 12827 30
        Last = 12827 1
        Ask = 12827 29
        Last = 12827 1
        Ask = 12827 28
        Last = 12827 3
        Ask = 12827 25
        Last = 12827 11
        Ask = 12827 14
        Last = 12827 6
        Ask = 12827 8
        Last = 12827 1
        Ask = 12827 7
        Last = 12827 1
        Ask = 12827 6
        Last = 12827 2
        Ask = 12827 4
        Last = 12827 2
        Ask = 12827 2
        Last = 12827 2
        Ask = 12827.5 3
        Last = 12827.5 3




        I hope that makes sense.


        Thanks
        Last edited by SuperDriveGuy; 06-17-2018, 11:44 AM.

        Comment


          #5
          Hello SuperDriveGuy,

          Thanks for the reply.

          Were you able to look through the samples I recommended? It looks like all the data you would need for this idea would be in the price ladder of any given market.

          Please let me know if you have any additional questions.
          Chris L.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ScottWalsh, Today, 04:52 PM
          0 responses
          1 view
          0 likes
          Last Post ScottWalsh  
          Started by ScottWalsh, Today, 04:29 PM
          0 responses
          5 views
          0 likes
          Last Post ScottWalsh  
          Started by rtwave, 04-12-2024, 09:30 AM
          2 responses
          22 views
          0 likes
          Last Post rtwave
          by rtwave
           
          Started by tsantospinto, 04-12-2024, 07:04 PM
          5 responses
          70 views
          0 likes
          Last Post tsantospinto  
          Started by cre8able, Today, 03:20 PM
          0 responses
          7 views
          0 likes
          Last Post cre8able  
          Working...
          X