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

Bid Ask size from addon

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

    Bid Ask size from addon

    Hi,

    I'm developing an add-on.

    Data feed is Iqfeed.

    I'm not subscribing to level2 data for ZL(soybeans).

    In the Add-on, I'm subscribing to MarketData and MarketDepth. In the add on, when using ZL(level1) I don't get level2 MarketDepth events. I understand, I'm not subscribed to a level2 feed for ZL, so no MarketDepth events. I do get MarketData events as expected.

    However, when I bring up the DOM in Ninjatrader for ZL, I seem to get the top of the book bid-ask size.

    From my addon, the only way I know to access bid-ask size is via the MarketDepth MarketDepthEventArgs bid-ask lists. But, like I mentioned before, not getting MarketDepth events in my addon for ZL.

    So, how is the DOM getting top of book bid-ask size for ZL and how can I access the same bid-ask size in my add on ?

    Thanks

    Click image for larger version  Name:	dom.png Views:	0 Size:	24.7 KB ID:	1105320

    #2
    Hello michelm,

    Thank you for the post.

    As I can't see the source code here for the dom I would not be able to provide a specific answer for how it does this however you could likely accomplish this by using a BarsRequest. The BarsRequest could be used to create an ask and bid request and then retrieve the last bar values that get returned along with its volume. If that is not a solution for your use case I could also push this question to development to see if they can answer how it retrieves the values from the internal code.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi,

      I tried what you suggested:

      BarsPeriod barsPeriod = new BarsPeriod() { BarsPeriodType = BarsPeriodType.Second, Value = 10, MarketDataType = MarketDataType.Ask };

      I'm getting the BarUpdates, but the volume(e.BarsSeries.GetVolume(i)) looks like the traded volume, not the ask volume. The volume value is too big for the ask volume and it only increases as more trades come in, and then it resets with each new bar.....
      Last edited by michelm; 06-17-2020, 04:53 PM.

      Comment


        #4
        Hi,

        If you don't mind I would like to take you up on your offer to ping development to see how they are doing it.

        The only way I see to provide BarsRequest with a MarketDataType(Ask bid in my case) is via the BarsRequest.BarsPeriod property. Does BarsRequest even use the MarketDataType property in the BarsPeriod object I provide it? That might be a related question to dev since you don't have access to the source....

        I'd be happy to look myself, just need readonly access to your source repo

        Comment


          #5
          Hi,

          Wonder if this is what I'm after.



          Is it safe and reliable to call this from a BarsRequest.OnBarUpdate handler?

          Comment


            #6
            Hello michelm,

            I will put in a question here. The item you linked would only be helpful if used from an indicator/strategy. I am not aware if that can be used from the addon context.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ghoul, Today, 06:02 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            44 views
            0 likes
            Last Post jeronymite  
            Started by Barry Milan, Yesterday, 10:35 PM
            7 responses
            20 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by AttiM, 02-14-2024, 05:20 PM
            10 responses
            179 views
            0 likes
            Last Post jeronymite  
            Started by DanielSanMartin, Yesterday, 02:37 PM
            2 responses
            13 views
            0 likes
            Last Post DanielSanMartin  
            Working...
            X