Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Peek at Depth of Market before Market Order

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

    Peek at Depth of Market before Market Order

    Hi,

    I have a 1min BarOnClose=false strategy.

    Before I RTFM and try to see if it can be done, can you please advise if it is possible to get the depth at the BID/ASK at the price level when an entry signal is given?
    I am trading a potentially illiquid equities market and want to add a liquidity filter to my Entry signals.

    Thanks.

    #2
    abfc123, you could check the OnMarketDepth() for Level 2 data access - http://www.ninjatrader-support.com/H...rketDepth.html

    If you need the current Bid / Ask and their volume, use the GetCurrentBid / GetCurrentAsk - GetCurrentBidVolume / GetCurrentAskVolume methods.

    Comment


      #3
      Thanks Bertrand,

      Does calling GetCurrentAskVolume() from within OnUpdate() or should i reassign a global value on every update event from within OnMarketDateUpdate()?

      Also is it possible to add a new parameter after a Strategy has been created or do I need to use the wizard to create new one?

      Thanks

      Comment


        #4
        abfc123,

        You will get higher accuracy tracking changes to bid / ask volume in OnMarketData(). OnBarUpdate() is called only when a trade has been made and there can be changes to bid / ask volume even when there is no trade.

        You can add additional parameters after the strategy has been created. This post helps with the properties structure needed for public inputs:
        Creating User Defined Input Parameters
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          And a final question please,

          1)I want to trap a cumulative record of market depth persistently.
          Is it possible to get any other rows in the bid/ask ladder other than best/last?

          2)What do most users use for persistent store? MySQL, shared memory?

          3)And slightly unrelated, I am trying to get the worst Loss experienced by an instrument, I have used Performance.AllTrades.TradesPerformance.Currency.L argestLoser but always get a 0 value.

          Thanks for your help

          Comment


            #6
            Yes, you would access then the OnMarketDepth() method for Level 2 data, all 5 levels.

            Both would be fine, you could for example also maintain an ArrayList.

            Would you get other stats from the Performance class fine in your strategy? The Performance is always individually tied to the strategy, this is not for accessing a global Performance object for all instruments or strategies.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            119 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            62 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            41 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            45 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            82 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X