Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asks/Bids in the public lob passed to traders don't have any kind of identifier #5

Closed
fables-tales opened this issue Oct 28, 2012 · 3 comments

Comments

@fables-tales
Copy link
Contributor

If two asks or bids are given that have the same price and quantity by two different traders, these are represented in the lob passed into respond method of a trader by two lists which will contain the exact same values. If the trader is maintaining a list of existing trades when the new lob comes in and attempts to diff the new lob with the old one, it becomes difficult to determine if these orders have already been seen. An example of this is detailed below:

>>> existing_bids = [[185,1]]
>>> previous_lob = {"bids":{"lob":[[185,1]]}}
>>> new_lob = {"bids":{"lob":[[185,1],[185,1]]}}
>>> [x for x in new_lob["bids"]["lob"] if x not in existing_bids]
[]

I believe this could be solved if each bid/ask was given a unique identifier which lasts for as long as it is on the order book.

@fables-tales
Copy link
Contributor Author

it looks like the orderbook combines orders of the same price. Is this right @davecliff ?

@davecliff
Copy link
Owner

it looks like the orderbook combines orders of the same price. Is this right @davecliff ?

Yes, because that is what real LOBs look like in so-called "Level 2" market data.

If ever BSE produces a LOB like {'bids':{'lob':[[185,1],[185,1]]}} then something has gone wrong: it should be [[185,2]].

Was this not clear from what's written in BSEguide.pdf, e.g. in the discussion of Figure 1.1?

@fables-tales
Copy link
Contributor Author

Hi Dave,

Yeah. I took another look over this afterwards. I think I was seeing some ghosts in the machine due to a bug in my own code.

Thanks

Sam Phippen

On 28 Oct 2012, at 19:34, davecliff wrote:

it looks like the orderbook combines orders of the same price. Is this right @davecliff ?

Yes, because that is what real LOBs look like in so-called "Level 2" market data.

If ever BSE produces a LOB like {'bids':{'lob':[[185,1],[185,1]]}} then something has gone wrong: it should be [[185,2]].

Was this not clear from what's written in BSEguide.pdf, e.g. in the discussion of Figure 1.1?


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants