Skip to content

Effanuel/BitMEX-Open-Interest-chart

Repository files navigation

BitMEX-Open-Interest-chart

Table of Contents

BitMEX-Open-Interest-chart

This project is a program which displays BitMEX XBTUSD current price with Open-Interest

Current Features

  • 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

Built With

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.

Prerequisites

Installation

  1. Clone the repo or download zip:
git clone https://github.com/Effanuel/BitMEX-Open-Interest-chart.git
cd Bitmex-Open-Interest-chart
  1. Init a virtual environment (highly recommended)
virtualenv open-interest
.\open-interest\Scripts\activate

2.1 Activate virtual environment:

.\open-interest\Scripts\activate
  1. Install dependencies for the virtual environment:
pip install -r requirements.txt
  1. Run live charting of Price and Open-Interest:
python main.py
  1. Read data from a csv file:
python main.py data.csv

TLDR setup:

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

Usage

Run application:
cd Bitmex-Open-Interest-chart
python main.py

Roadmap

  • Specify current price and Open Interest more clearly;

License

Distributed under the MIT License. See LICENSE for more information.

Useful Material