Skip to content

Effanuel/BitMEX-scaled-orders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Currently not being maintained

BitMEX trading tool

This project is a trading tool based on BitMEX API (Binance coming next). This project has a long way to go before becoming an actual usable tool. If you notice any bugs, open an issue.

Table of Contents

Current Features

  • Scaled orders:

    • Place up to 30 orders in a range at once (BitMEX limit)

    • Uniform, Normal, Positive or Negative order placing distributions; (see Distributions section);

    • (Optional) You can also add a stop-loss;

    • "Preview" displays your scaled order, average entry and possible risk if stop-loss is provided.

  • Shows current prices:

    • Based on the latest ask price;

    • Fetched via Websocket;

    • BTC, ETH and XRP (currently).

  • Market Order:

    • Place a sell or buy market order;
    • Faster over using the website.

  • Trailing Order:

    • Places a trailing limit order near market price;

    • The order is ammended automatically, so the order moves with the price if it doesn't get filled;

    • You can use it to get your fills without doing a market order and paying fees, or you can push markets with it.

  • Cross Market Order: (currently disabled)

    • Ability to add a cross order;
      • if you set a sell cross price below current price, it will trigger a market sell order as soon as the price crosses your cross order price;
      • if you set a buy cross price above current price, it will trigger a market buy order as soon as the price crosses your cross order price;
      • if you set a sell cross order price above current price, it will trigger a market sell order when the current price crosses up and then down of the set cross price;
      • if you set a buy cross order price below current price, it will trigger a market buy order when the current price crosses down and then up of the set cross price.
  • Open Orders:

    • See currently open orders;
    • Add profit targets for open orders (uses limit stop-loss orders to achieve that);
    • Cancel any open/profit order(s);

Built With

The Backend was built using Node + Express and the Frontend, React + Redux. Styled components were taken from Chakra UI

Getting Started

  • Create a BitMEX account;

    (If you are new to BitMEX, consider using my affiliate link to get 10% off the fees for 6 months. If you are someone who doesn't gets his orders filled with market orders, getting the 10% discount also reduces the money you get back for limit orders. So it is not recommended)

  • Get API keys:
    • Account > API keys > Create API key;
      • Key Permissions : Order;
      • Withdraw: Unchecked;

Prerequisites

Installation

  1. Clone the repo:
git clone https://github.com/Effanuel/Bitmex-scaled-orders.git
cd Bitmex-scaled-orders-master/
  1. Enter your API keys in .env (no quotes are needed):
REACT_APP___API_KEY =
REACT_APP___API_SECRET =
REACT_APP___TESTNET = false
REACT_APP___LOG_LEVEL = info
  1. Install NPM packages for client and server:
cd api/
npm run init:packages

Disclaimer: You need to set API keys before building the application. If you make a typo and only notice after a build, do
npm run clean and npm build

Disclaimer: If you set TESTNET to true, you need to create a Testnet account and set the API keys appropriately. Your main BitMEX account API won't work with TESTNET option set to true.

  1. Build the application:
npm run build

TLDR setup:

git clone https://github.com/Effanuel/Bitmex-scaled-orders.git
cd Bitmex-scaled-orders/
  • Put API keys in .env
cd api/
npm run init:packages
npm run build
npm run prod

Usage

After building you just need to run the application:
cd Bitmex-scaled-orders/api
npm run prod

Distributions

These are the available distributions to choose from:

Probability density function is used to calculate distributions:


Roadmap

  • Faster price update;

  • Stepping stop-loss;

  • Custom order/profit target placement;

  • Bitfinex/Binance API;

  • Easier API setup;

  • Multiple accounts for every platform;

  • Saving cache;

  • Settings for multiple ticker subscriptions;

License

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

Useful Material