Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

e.MarketDepth

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

    e.MarketDepth

    How do I use the:

    e.MarketDepth. etc etc variable?

    When i try to use it, I get a

    "...does not contain a definition for 'MarketDepth' ".

    Am i missing a market depth event handler initialization? a #include?

    ALSO. e.Position doesn't work for me also giving "... does not contain a definition for Position"

    My overloaded OnMarketDepth parameters incorrect?

    Thanks for the help .. i feel dumb asking such a simple question

    #2
    Hello,

    Thank you for your forum post.

    Have you checked out are reference sample on using this?




    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      Yes I actually did check out the reference sample.

      I just wanted to see if I could use e.MarketDepth without all the "extra" code.

      Maybe I missed something important. I just wanted the bare minimum amount of code to access the different levels. Such as e.MarketDepth.ask[1]. etc etc

      Comment


        #4
        Hello,

        I will have someone respond to you in the morning to see if there is a simpler way.
        BrettNinjaTrader Product Management

        Comment


          #5
          ballz, the bare mininum would be as shown here - http://www.ninjatrader-support.com/H...rketDepth.html

          For just Level 1 data, you can also access the Close, GetCurrentBid() and GetCurrentAsk() in the OnBarUpdate() directly.

          Comment


            #6
            Yes I understand that part for level 1 data and getting the spread for it.

            I was more interested in going beyond level one and getting market depth data for lets say 3 levels in using e.Position and e.MarketDepth variables.

            Im not sure exactly which line (or part) of code in the sample allows me to use these variables. Is it the handler initialization?

            Comment


              #7
              Thank for the reply, I see - you would need to add a check to which position you want to filter for - http://www.ninjatrader-support.com/H...EventArgs.html (please keep in mind the position on the ladder is zero based, so the level 3 you seek is at Position 2).

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by sjsj2732, 03-23-2026, 04:31 AM
              0 responses
              42 views
              0 likes
              Last Post sjsj2732  
              Started by NullPointStrategies, 03-13-2026, 05:17 AM
              0 responses
              294 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              290 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              135 views
              1 like
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              98 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Working...
              X