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

Confused by output of onMarketData

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

  • Cilla
    replied
    Many thanks Chris, I understand now. I look forward to the change in the help guide.

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hello Cilla,

    Thanks for your patience.

    A change to the help guide will be made to make it more clear that OnMarketData will give you every change in level one data that is given through your data provider.

    Please let me know if I can assist any further.

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hello Cilla,

    Thanks for the follow-up.

    I do see the help guide claims the OnMarketData method will be in sync. I will run a test in NInjaTrader 7 to see if the same thing happens there. It appears we will need to make a change to the help guide and/or report this as a bug.

    Thanks in advance for your patience.

    Leave a comment:


  • Cilla
    replied
    Hi Chris

    The documentation for OnMarketData states that it is "guaranteed to be in the correct sequence for every change in level one market data for the underlying instrument", so I would expect the ask/bid stream to perfectly sync with last update events. Is there possibly a problem with the data feed from Kinetick? Can you refer this to them?

    Also, I have used OnMarketDepth extensively before and the problem there is that OnMarketDepth doesn't provide last update events and you cannot rely on e.g. OnMarketDepth always being called before OnMarketData, as NinjaTrader is multi-threaded (also from the docs). In any case, I'm only interested in level one data, for continuous last, bid and ask events and volumes. It's looking very like this data is not reliable, which is disappointing.

    Thanks again for investigating this issue.

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hello Cilla,

    Thank you for your patience.

    After testing different data providers, I found a difference in the synchronicity of OnMarketData between all of them. The OnMarketData ask/bid stream is subject to the data feed you are using and should not be expected to perfectly sync with the last update events. The use case of OnMarketData should be looked at from a different perspective. For a useful approach to utilizing OnMarketData, we monitor changes on the Last event and primarily use the Bid and Ask Market Events to detect a new bid/ask price. Please refer to the default indicators BuySellPressure, VolumeProfile, and BuySellVolume. These three use the Last update event to gather actual market data on Bid/Ask fills. OnMarketDepth is a better tool that should be used for monitoring volume at price, which is what we are testing here. OnMarketDepth will update when a change is detected in volume at various price levels. See this reference sample that implements a Level 2 data book
    like the SuperDOM within an indicator.

    Please let me know if I can assist any further.

    Leave a comment:


  • Cilla
    replied
    Thanks Chris - I look forward to hearing back from you.

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hello Cilla,

    Thank you for your reply.

    When I mentioned I saw the same thing as you, that wasn't quite accurate. I didn't realize I was looking at a case where the price changed to a different price level, like in my previous screenshot.

    For now, I will let my supervisor look into this with me.

    Thanks in advance for your patience.

    Leave a comment:


  • Cilla
    replied
    Hi Chris

    The only difference I can see between your code and mine is that you don't print the change in volume at the bid or ask, so the original result I posted (and I thought you'd managed to replicate) is still valid. However, just in case, I've tried your indicator and eventually seen the "anomaly" - you just have to wait long enough.

    Please see the uploaded screenshot. It looks like there's a trade of 21 contracts at the bid, but the bid volume actually increases by 1. What do you make of it?

    Thanks

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hello Cilla,

    Thank you for your reply.

    I ran some tests on a slimmed down version of your OnMarketData. I never found an instance where the volume of a last filled more than the previously reported bid/ask price. I did find that if the price level runs out of volume, the ask/bid price will change to the next level, giving you the volume for that new price level.

    See this screen shot I gathered:


    Could you run the attached indicator and observe the output window for the issue you are seeing? If you can see it in the output window, could you please post a screenshot here? Place the attached file within \Documents\NinjaTrader 8\bin\Custom\Indicators and compile.

    I look forward to hearing of your results.
    Attached Files

    Leave a comment:


  • Cilla
    replied
    Hi Chris

    I think I've managed to see similar behaviour on ES.

    Today at 08:11:47, there was bid volume of 76, followed by a large number of trades at bid, total volume = 78, and then the bid volume only reduced by 69, all at the same bid price of 2835.75

    Leave a comment:


  • Cilla
    replied
    Hello Chris

    Thanks for sticking with this one!

    I first tried to reproduce it today on YM, matching up with T&S data - eventually succeeded with this, but somehow T&S is able to determine things like "above ask" even though the "last" price is equal to the "ask" price - perhaps T&S has access to data not available to OnMarketData?

    I'm now seeing if I can get the same behaviour on ES and will let you know what I find.

    Thanks

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hello Cilla,

    Thank you for your reply.

    I was able to get the behavior you are seeing on the YM instrument, but not the ES. Could you see if you get this on the ES as well? I am also reaching out to my superior so he can have a look a well.

    I look forward to your reply.

    Leave a comment:


  • Cilla
    replied
    Hi Chris

    It's YM 06-19 from Kinetick.

    Leave a comment:


  • NinjaTrader_ChrisL
    replied
    Hello Cilla,

    Thank you for your reply.

    That would be the expected results for volume. I am not getting any anomalies like the example that you posted though. What instrument are you looking at and what data feed are you connected to?

    I look forward to your reply.

    Leave a comment:


  • Cilla
    replied
    Hi again Chris

    I can see that multiple trades can occur at a given bid/ask price without changing the price instantly, but my question is about volume at the ask, not price. Putting it another way, if there are 10 contracts (i.e. ask volume = 10) at the current ask price (say 25950) and a single trade of 3 contracts takes place at the ask, should we not expect to see last price = 25950, last volume = 3 and then ask price = 25950, ask volume = 7?

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by lightsun47, Today, 03:51 PM
0 responses
4 views
0 likes
Last Post lightsun47  
Started by 00nevest, Today, 02:27 PM
1 response
8 views
0 likes
Last Post 00nevest  
Started by futtrader, 04-21-2024, 01:50 AM
4 responses
44 views
0 likes
Last Post futtrader  
Started by Option Whisperer, Today, 09:55 AM
1 response
13 views
0 likes
Last Post bltdavid  
Started by port119, Today, 02:43 PM
0 responses
9 views
0 likes
Last Post port119
by port119
 
Working...
X