More like a python simulation of a market maker, rather than a market maker simulator
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
This is just a hobby project with me trying to simulate how a Market Making entity within a financial market environment might perform using order flow and taking advantage of the bid-ask spread on certain assets. The inspiration for this project came when I was watching 'Eat the Rich: The GameStop Saga' on Netflix. One of the episodes explains Citadel's involvement in the drama, where it acted as a market maker for Robinhood trading GME.
The trading strategy of the market maker is designed to facilitate the buying and selling of securities. When a "buy" order is received, the market maker checks if the order price is equal to or greater than their "ask" price (the minimum price they are willing to sell the securities for). If it meets this condition and they have enough cash to cover the purchase, they execute the order. The market maker then adds the purchased securities to their inventory and deducts the cost from their available cash.
On the other hand, when a "sell" order is received, the market maker checks if the order price is equal to or less than their "bid" price (the maximum price they are willing to pay to buy the securities). If it meets this condition and they have enough securities in their inventory, they execute the order. The market maker then deducts the sold securities from their inventory and adds the revenue from the sale to their available cash.
If the order conditions are not met (either for "buy" or "sell"), the market maker does not execute the order.
This strategy allows the market maker to profit from the difference between their buying and selling prices, known as the bid-ask spread. By adjusting their bid and ask prices, the market maker can control the spread and manage their profitability. The strategy focuses on quick execution of trades and maintaining an inventory of securities to facilitate trading for buyers and sellers in the market.
Unfortunately, as per this current version of the simulation, this is not a very good strategy as it likes to take heavy losses! (for now...)
Under development
Under development
Under development
-
Ensure you have Python installed: Before running the project, make sure you have Python installed on your system. You can download the latest version of Python from the official Python website (https://www.python.org/downloads/) and follow the installation instructions.
-
Set up the environment: It is recommended to create a virtual environment to manage project dependencies and isolate them from other Python projects. Open a terminal or command prompt in the project directory and create a new virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS and Linux:
source venv/bin/activate
- On Windows:
-
Install project dependencies: With the virtual environment activated, install the required project dependencies using pip:
pip install -r requirements.txt
. Make sure you have the requirements.txt file containing the list of required packages and their versions for the project. -
Run the main script: Once the environment is set up and dependencies are installed, you can execute the main script of the project by running:
python main.py
. The main.py file is the entry point of the project, and running this command will start the project's execution. -
Observe the output: Depending on the project's current state, this could be quite interesting or obscenely boring.
To deactivate the virtual environment: When you are finished with the project, you can deactivate the virtual
environment
by running: deactivate
For more examples, please refer to the Documentation which is currently a work in progress, if at all existent.
- Update the README
- Update the installation section
- Update the prerequisites section
- Update the Usage section
- Get a license
- Add license to the Readme
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community truly remarkable, as they foster learning, inspiration, and innovation. Your contributions are incredibly valuable and deeply appreciated.
If you have any suggestions to enhance this project, please consider forking the repository and creating a pull request. Alternatively, you can open an issue with the "enhancement" tag. Your input is highly valued.
And, of course, don't forget to give this project a star! Thank you once again for your support and contributions!
- Clone the Project locally
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Callum Alexander
Project Link: https://github.com/CallumAlexander/Market-Maker-Simulator
- 'Eat the Rich: The GameStop Saga' for inspiring this hobby project.