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

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.

    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.

        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.
          BertrandNinjaTrader Customer Service

          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).
              BertrandNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Waxavi, Today, 02:10 AM
              0 responses
              3 views
              0 likes
              Last Post Waxavi
              by Waxavi
               
              Started by TradeForge, Today, 02:09 AM
              0 responses
              8 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
              4 views
              0 likes
              Last Post gentlebenthebear  
              Working...
              X