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!
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
NinjaTrader
Confused by output of onMarketData
Collapse
X
-
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:
-
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:
-
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:
-
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:
-
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:
-
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?
Thanks1 Photo
Leave a comment:
-
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:
-
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:
-
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:
-
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:
-
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:
-
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 eduardodipp7, Today, 10:29 AM
|
1 response
4 views
0 likes
|
Last Post Today, 12:35 PM | ||
Started by spottysallrite, Today, 11:31 AM
|
3 responses
9 views
0 likes
|
Last Post Today, 12:32 PM | ||
Started by adeelshahzad, Today, 11:49 AM
|
3 responses
5 views
0 likes
|
Last Post Today, 12:22 PM | ||
Started by johnMoss, 03-04-2024, 01:53 PM
|
2 responses
34 views
0 likes
|
Last Post
by Overnhou
Today, 11:21 AM
|
||
Started by Padan, Today, 02:02 AM
|
5 responses
17 views
0 likes
|
Last Post Today, 11:14 AM |
Leave a comment: