davecliff / bristolstockexchange Goto Github PK
View Code? Open in Web Editor NEWBSE is a simple minimal simulation of a limit order book financial exchange
License: Other
BSE is a simple minimal simulation of a limit order book financial exchange
License: Other
When I import trader_aa into BSE I expect it to run and do some trading. Instead I get this crash trace:
Traceback (most recent call last):
File "BSE.py", line 1196, in <module>
order_sched, tdump, False)
File "BSE.py", line 1076, in market_session
traders[t].respond(time, lob, trade, respond_verbose)
File "/Users/sam/dev/bristol/shiny-robot/bristol_stock_exchange/Trader_AA.py", line 284, in respond
elif bid_improved and (self.target <= price): self.aggressiveness_buy = self.updateAgg(True, True, self.prev_best_bid_p)
AttributeError: 'Trader_AA' object has no attribute 'target'
It also doesn't subclass Trader
, and as far as I can tell has no add_order
method.
Trying to get this running because we've been having trouble with implementations out of the papers.
import: unable to read X window image '. import: missing an image filename
random'.
./BSE.py: line 53: bse_sys_minprice: command not found
./BSE.py: line 54: bse_sys_maxprice: command not found
./BSE.py: line 55: ticksize: command not found
./BSE.py: line 60: class: command not found
./BSE.py: line 62: syntax error near unexpected token (' ./BSE.py: line 62:
def init(self, tid, otype, price, qty, time):'
When landscape-mapper is set to True, the trader is not assigned an optimiser. As a result, the check on line 1090 will never pass and the mapping will never terminate or write to file.
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.
If I understand correctly this line
quoteprice = random.randint(minprice, limit)
the ZIC agent will place a new bid uniformly at random between the current minimum bid and the limit bid.
But what if the limit is < min-price? (NB: such an order makes sense if the trader expects the price to go down)
randint will throw an error in this case.
Hi @davecliff
8a180df deletes the BSEguide.pdf
file. I would have brought it back but the commit message implies that changes were made to the file. Can we have the file back please ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.