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

lastsize is inconsistent #11

Open
rooklift opened this issue Jan 5, 2016 · 3 comments
Open

lastsize is inconsistent #11

rooklift opened this issue Jan 5, 2016 · 3 comments

Comments

@rooklift
Copy link

rooklift commented Jan 5, 2016

When an incoming order is filled from several standing orders, sometimes the lastsize field (in a later quote) seems to be the sum of the fills, and sometimes not.

sell
price = 2
qty = 5

sell
price = 3
qty = 100

BUY
price = 4
qty = 50

This results in a lastsize of 50, even though the fills were of size 45 and 5.

But on other occasions this does not happen:

sell
price = 1
qty = 5

sell
price = 1
qty = 5

BUY
price = 1
qty = 10

This results in a lastsize of 5.

I'm telling you this because it's the only way in which our 2 servers diverge in results now. I fired off 2000 randomly-generated orders at both of them, and the final results were otherwise identical. :)

@rooklift
Copy link
Author

rooklift commented Jan 5, 2016

Meh I'm diverging from the official server myself, so I can't even say your version is wrong.

@rooklift rooklift closed this as completed Jan 5, 2016
@rooklift
Copy link
Author

rooklift commented Jan 5, 2016

I can now confirm we both diverge from official, as well as from each other, solely in lastsize. Not sure why. The Python 3 script I used for this is at:

https://github.com/fohristiwhirl/disorderBook/blob/master/tests/disorder_vs_real_test.py

You can change the settings to work on a Mockfighter venue. Of course, if someone uses the official test server while you're running this test, stuff gets messed up. (But it displays the change in order ID at the end, which lets you detect it.)

@rooklift rooklift reopened this Jan 5, 2016
@rooklift
Copy link
Author

rooklift commented Jan 5, 2016

Hmm I discovered that when multiple fills are generated on official at the same time, it's arbitrary which one ends up as the last price / size.

So perhaps this isn't worth worrying about.

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

1 participant