MCPcopy Index your code
hub / github.com/Effanuel/BitMEX-scaled-orders

github.com/Effanuel/BitMEX-scaled-orders @v2.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.5.0 ↗ · + Follow
273 symbols 725 edges 100 files 0 documented · 0% updated 3y agov2.5.0 · 2020-11-13★ 339 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Table of Contents

BitMEX trading tool

This project is a trading tool based on BitMEX API (It can also be used to overcome the overload feature on the website (although sometimes API's also get suspended due to high load)). This project has a long way to go before becoming an actual usable tool. If you notice any bugs, open an issue.

Current Features

  • Scaled orders:

  • Place up to 30 orders in a range at once (small order sizes will cause a spam warning);

  • 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 place push markets (more advanced).

  • Cross Market Order:

    • 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.

Built With

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

Getting Started

(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/client
  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/client
  • 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

Run tests: (not many at the moment)

cd Bitmex-scaled-orders/client
npm run unit

Distributions

These are the available distributions to choose from:

This is the formula used to calculate distributions:

formula

(Chart representations are symbolic)

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

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 127
Method 67
Interface 43
Class 28
Enum 8

Languages

TypeScript100%

Modules by API surface

client/src/tests/fuel/app-driver.ts22 symbols
client/src/redux/selectors/index.ts19 symbols
client/src/util/index.ts15 symbols
client/src/tests/fuel/drivers.tsx13 symbols
client/src/redux/helpers/apiHelpers.ts11 symbols
client/src/tests/responses.ts8 symbols
client/src/redux/modules/websocket/websocketModule.ts8 symbols
client/src/redux/modules/websocket/types.ts8 symbols
client/src/tests/mockData/orders.ts7 symbols
client/src/tests/configStore.ts6 symbols
client/src/components/MainContainer/MainContainer.spec.ts6 symbols
client/src/components/InputField/InputField.driver.ts6 symbols

For agents

$ claude mcp add BitMEX-scaled-orders \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page