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

MarketDepthEventArgs clarification

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

    MarketDepthEventArgs clarification

    I read through the Help Guide and couldn't arrive the answers.

    1) What does Operation.Remove and Operation.Insert mean? Does this mean limit orders being removed or added?

    2) Can you confirm Position of 0 refers to the best bid/offer.

    3) What if I use both OnMarketData and OnMarketDepth and the top most bid updates. Do both OnMarkeData and OnMarketDepth get called? So if I wanted to handle all limit order data in OnMarketDepth, could I write:

    Code:
    if (e.MarketDataType == MarketDataType.Bid) { return; }
    under OnMarketData

    then under OnMarketDepth write:
    Code:
    if (e.MarketDataType == MarketDataType.Bid && e.Position == 0 && e.Operation == Operation.Update)
    { //do stuff}
    Thanks.
    Last edited by :::grimReaper:::; 11-18-2012, 05:54 PM.

    #2
    Hello,

    Originally posted by :::grimReaper::: View Post
    I read through the Help Guide and couldn't arrive the answers.

    1) What does Operation.Remove and Operation.Insert mean? Does this mean limit orders being removed or added?
    Yes this means an order is being added or removed (limit, stop, stop-limit...)
    2) Can you confirm Position of 0 refers to the best bid/offer.
    Can you please clarify what Position you are referring to?

    3) What if I use both OnMarketData and OnMarketDepth and the top most bid updates. Do both OnMarkeData and OnMarketDepth get called? So if I wanted to handle all limit order data in OnMarketDepth, could I write:

    Code:
    if (e.MarketDataType == MarketDataType.Bid) { return; }
    under OnMarketData

    then under OnMarketDepth write:
    Code:
    if (e.MarketDataType == MarketDataType.Bid && e.Position == 0 && e.Operation == Operation.Update)
    { //do stuff}
    Thanks.
    They will both get called asynchronously. Could you please clarify what you mean by handle limit order data?
    LanceNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Lance View Post
      Yes this means an order is being added or removed (limit, stop, stop-limit...)
      What do you mean by stop and stop limit? Are you saying I have access to stop and stop limit order data from the exchange? I use Zenfire. Thanks.

      Comment


        #4
        Hello,
        Originally posted by :::grimReaper::: View Post
        What do you mean by stop and stop limit? Are you saying I have access to stop and stop limit order data from the exchange? I use Zenfire. Thanks.
        Operation represents the action you should take when building a level two book.
        Possible values are
        Operation.Insert Operation.Remove
        Operation.Update


        These will not let you see the individual order type being sent to the exchange but are used to add/remove/update the bid/ask price.



        I mentioned the different order types because I wanted to make clear that the orders could be of different types and would not be just limit orders.

        Here is some sample code that might be of further help: http://www.ninjatrader.com/support/f...ead.php?t=3478

        Please let me know if I can be of further assistance.
        Last edited by NinjaTrader_Lance; 11-20-2012, 09:52 AM.
        LanceNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by MarianApalaghiei, Today, 10:49 PM
        3 responses
        9 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by XXtrader, Today, 11:30 PM
        0 responses
        3 views
        0 likes
        Last Post XXtrader  
        Started by love2code2trade, Yesterday, 01:45 PM
        4 responses
        28 views
        0 likes
        Last Post love2code2trade  
        Started by funk10101, Today, 09:43 PM
        0 responses
        9 views
        0 likes
        Last Post funk10101  
        Started by pkefal, 04-11-2024, 07:39 AM
        11 responses
        37 views
        0 likes
        Last Post jeronymite  
        Working...
        X