Code Monkey home page Code Monkey logo

Comments (9)

davecliff avatar davecliff commented on July 24, 2024 1

Aha, just checked: it was 2014. Here is the hints-and-tips doc that I made after some students said they were struggling with creating a market-maker. ..

HintsTipsCourseworkOptionB.pdf

from bristolstockexchange.

davecliff avatar davecliff commented on July 24, 2024

That would be a problem in principle, but the rest of the code is written in such a way that it is never intended to happen.

Look at the wider context for that line in ZIC:

    else:
        minprice = lob['bids']['worst']
        maxprice = lob['asks']['worst']
        qid = lob['QID']
        limit = self.orders[0].price
        otype = self.orders[0].otype
        if otype == 'Bid':
            quoteprice = random.randint(minprice, limit)
        else:
            quoteprice = random.randint(limit, maxprice)

When quoteprice = random.randint(minprice, limit) executes, the value of minprice has just (6 lines of code earlier) been set to lob['bids']['worst'], the worst possible bid price (i.e., no bid can ever be lower than that) and that was previously set to bse_sys_minprice when the lob is initialised.

The only way you'd get an error thrown in this bit of code would be if the limit price was lower than the worst price the system allows, which would make it a zero or negative multiple of the tick-size, which would not make much sense from the perspective of the kind of market economics that it's been built to explore -- this code is intended to be used with the various parameters set to reasonable values; it's not intended to be bomb-proof against parameter value set wildly out of expectation.

from bristolstockexchange.

vd1 avatar vd1 commented on July 24, 2024

I see. I thought lob['bids']['worst'] was returning the current lowest bid. Which means I have misunderstood ZIC itself!

from bristolstockexchange.

davecliff avatar davecliff commented on July 24, 2024

Aha, no worries.

Last week I put a paper on Arxiv that might help: [https://arxiv.org/pdf/2103.11341.pdf]

from bristolstockexchange.

vd1 avatar vd1 commented on July 24, 2024

Just read the PRZI paper, it is great! Thanks.

from bristolstockexchange.

davecliff avatar davecliff commented on July 24, 2024

Thank you! Glad you enjoyed it. PRZI is in BSE.py -- it was updated a few days ago.

from bristolstockexchange.

vd1 avatar vd1 commented on July 24, 2024

BSE seems directed primarily at modelling intermediaries relaying a flow of exogenous orders and trying to sell/buy a bit above/below to pocket the difference. What about other classes of agents: 1) directional traders who originate their own orders, 2) market-makers who put offers on both sides and cycle their inventory, 3) other agent types that trade to increase liquidity under a budget. Do you think one can use BSE to run those as well. For 1) the agent code should make a decision about the price with no external input (other than the lob): I guess one could start random and then try to follow the price process. For 2) a market making agent should adjust his/her offers on both sides (at every match?) in relation to its inventory so when the simulator calls the respond() method. It is like a double-sided agent.

from bristolstockexchange.

davecliff avatar davecliff commented on July 24, 2024

BSE seems directed primarily at modelling intermediaries relaying a flow of exogenous orders and trying to sell/buy a bit above/below to pocket the difference.

Yep, exactly that. That approach is commonplace in Experimental Economics research, which is what BSE started out as a tool for the teaching of.

At UoB we've used BSE in classes of 70-120 students where the programming coursework has been something very close to create an agent that is in what you refer to as your classes (1) to (3). Fundamentally the exchange side of BSE allows any kind of trader-agent to send it orders, so the question then is just down to how sophisticated you want the trader-agents to be. One year (2012? 2013? I can't remember) we got students to do exactly (2), i.e. build a market-maker.; and we repeated pretty-much the same assessment when we ran the course again this year -- setting that particular problem once every seven or eight years seems safe enough.

from bristolstockexchange.

vd1 avatar vd1 commented on July 24, 2024

Splendid!

from bristolstockexchange.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.