davecliff / BSE2

Bristol Stock Exchange, Version 2: a simulation of a contemporary limit-order-book financial exchange.
23 stars 2 forks source link

Where is it? #1

Open eabase opened 3 years ago

eabase commented 3 years ago

Hi, sounded promising, but where is the code?

davecliff commented 3 years ago

The BSE2 code is exactly where it has been for ages and ages now: in very late stage of development, just a few day's work away from initial commit -- but then I think of another feature that I want/need to add, or something else I have to add to the documentation, and the release date slips again. I'd really rather not release something that immediately causes me need to deal with a bunch of pull requests, because I don't have very much spare time. I have a demanding day-job which makes it hard to find time to get BSE2 finished to the standard that I want; no one is paying me for this.

I am fairly confident of a BSE2 commit in 2021Q1 because I have graduate students who will be using it for their research projects, and that forces me to get it finished, for their sake.

eabase commented 3 years ago

Hi Dave,

Sounds awfully familiar. I have a lot of repos... and feel terrible when I am not able to maintain them to the level want.

I just came across your BSE1 the other day, and very curious to how it all works. I still need to try it and understand it, and in that regard, what will be different in BSE2? I mean all those added features etc. Are those enough to warrant a new version or is there substantial other changes?

That said, is there any related course material I can look at? (Apart the very nice BSE1 Wiki and PDF file.) I am also missing a bit of more info how to install and run this. Maybe something to add to the README.

I also found and tried one of the JS ports [from one of your students?] that runs in your browser. Looked pretty nice, but looking nice usually hide the logic and understanding about what is (supposedly) going on under the hood. I.e. what is it that we are trying to simulate and teach? How well does it correspond to reality on a real platform? (what are the differences and similarities thereof?)

davecliff commented 3 years ago

Hi,

BSE1 makes a large number (as many as possible) of simplifying assumptions -- BSE1 was intended to give students a reasonably realistic LimitOrderBook (LOB)-based exchange to play with. A major simplification is that it is single-threaded (and so Agent A can take 1 microsecond of walltime to compute its response; while Agent B can take 100 seconds of walltime, but BSE1 doesn't note the difference -- A and B each take one simulated clock-tick within BSE); another is that each order into the market is a limit order (LIM) and if the price of the incoming order crosses the spread then it is interpreted as Market (MKT) and takes the best price off the top of the counterparty side of the LOB; and the third big simplification is that all orders are limited to quantity of size 1 (a common constraint in the experimental economics research literature).

BSE1's simplicity means that naive students can download the single BSE.py script and run it from the command line and it will do interesting things "out of the box", so in that sense it did the job required and we've used it for teaching here at UoBristol since 2012.

BSE2 started out as a refactoring to allow orders of size > 1 -- the LOB matching engine gets a bit more complicated. Then I had a need to extend it by adding additional more-realistic order types e.g. Fill-Or-Kill (FOK), Iceberg (ICE), etc. And along the way as BSE1 got used more and more as a platform for research there were various other bells and whistles that needed adding to make specific research use-cases easier

The one thing that I did not put any effort into in developing BSE2 was switching it to multi-threaded so that faster trader-agents have a realistic speed-advantage over ones that are more compute-intensive (and hence slower) but earlier this year my masters student Michael Rollins took an early pre-release version of BSE2 and made it threaded, and Michael and I used that to generate some interesting results that challenged the status-quo view of what the pecking-order (dominance hierarchy) among the various public-domain trading agents should be.

Rollins & Cliff paper published at EMSS in Sep20: [https://arxiv.org/abs/2009.06905] Cliff & Rollins aper published at CIFEr in Dec20: [https://arxiv.org/abs/2011.14346]

Hope that helps. Watch this space for BSE2, hopefully I'll do a commit in late Jan or early Feb.

eabase commented 3 years ago

Great and very interesting! Thank you so much for taking the time for the explanation. Just the clickable links for convenience.

So one last question. If I want to get into learning this, what would be the best entry point. At a first look at reading the papers above, I find that I am not al all familiar with most of the terminology. Is there any other basic course material available (outside UoB), that I could benefit from before delving into those papers?

PS. The paper in [2] remind me of this:

Fresh-Mint commented 2 years ago

Hi Prof. Dave,

I was wondering if there have been any updates on the release of BSE2?

davecliff commented 2 years ago

Hi Prof. Dave,

I was wondering if there have been any updates on the release of BSE2?

It's still coming someday soon. I have a very heavy teaching load Sep-Feb; I finished the last of my coursework marking/grading on Monday 14th Feb, so now I have a lot more free time in coming weeks to work on finishing off BSE2. I'd like to get it on here, with accompanying documentation, by end of March.

davecliff commented 2 years ago

So one last question. If I want to get into learning this, what would be the best entry point. At a first look at reading the papers above, I find that I am not al all familiar with most of the terminology. Is there any other basic course material available (outside UoB), that I could benefit from before delving into those papers?

[Sorry, only just realised I had not replied]

This long HP Labs tech report covers background economics etc, and explains ZIP from first principles: HPL-TechRep-ZIP

MyWay91 commented 1 year ago

Hi prof,

I see there have been multiple commits to BSE1 since this thread: did you decide to continue with that project or BSE2 is still scheduled at some point?

Thanks, Vittorio

davecliff commented 1 year ago

BSE2 is definitely still coming Real Soon Now™ -- delays caused simply by many other things getting in the way.

The multiple commits to BSE1 in recent months are a reflection of the fact that we still actively use BSE1 in our masters-level teaching at the University of Bristol, and every year we add a bit more to BSE1 so that we can vary/extend its use in teaching. When BSE2 is released we will keep BSE1 alive because BSE1 has a lot fewer moving parts than BSE2, and so BSE1 will probably remain our favoured intro-level platform for the forseeable future, acting as the gateway to usage of BSE2 for research-oriented work.