This project is a program which displays BitMEX XBTUSD current price with Open-Interest
- No authentication required (since v2.2);
- Display XBTUSD price and Open Interest of XBTUSD every 5 seconds (Open Interest is updated every 5 seconds so it makes sense to also update the price at the same interval);
- Saves price and interest data to a file;
- Read price/interest data to display on a chart;
- Customise chart colors and saved chart time in
settings.py
file:
SAVE_CHART_IN_SECONDS = 1800 # Default saves 30 minutes of chart time
PRICE_LINE_COLOR = "green"
INTEREST_LINE_COLOR = "orange"
# To export data to new file, to read later
EXPORT_DATA_TO_FILE_AFTER_CHART_CLOSE = False
EXPORT_TO_FILE_NAME = 'data.csv'
# True or False // Currently doesnt work with live data
ENABLE_VERTICAL_LINES_ON_HOVER = True
ENABLE_HORIZONTAL_LINES_ON_HOVER = False
The majority of the code is taken from Sample-market-maker. In addition to that, the program uses matplotlib to chart the data from a websocket.
- Python
- Git (for cloning the repository)
- Virtualenv:
pip install virtualenv
- Clone the repo or download zip:
git clone https://github.com/Effanuel/BitMEX-Open-Interest-chart.git
cd Bitmex-Open-Interest-chart
- Init a virtual environment (highly recommended)
virtualenv open-interest
.\open-interest\Scripts\activate
2.1 Activate virtual environment:
.\open-interest\Scripts\activate
- Install dependencies for the virtual environment:
pip install -r requirements.txt
- Run live charting of Price and Open-Interest:
python main.py
- Read data from a csv file:
python main.py data.csv
git clone https://github.com/Effanuel/BitMEX-Open-Interest-chart.git
cd Bitmex-Open-Interest-chart
virtualenv open-interest
.\open-interest\Scripts\activate
pip install -r requirements.txt
python main.py
cd Bitmex-Open-Interest-chart
python main.py
- Specify current price and Open Interest more clearly;
Distributed under the MIT License. See LICENSE
for more information.