BitMEX Marketmaker Bot

Screenshots

Image 1
Image 2
Image 3
Image 4

Description

BitMEX Marketmaker Bot - User Guide

Table of Contents

  1. Introduction
  2. Installation
  3. Getting Started
  4. Wallet Connection
  5. Symbol Selection
  6. Chart Features
  7. Trading Settings
  8. Starting and Stopping the Bot
  9. Order Management
  10. Settings Templates
  11. Troubleshooting
  12. Safety and Risk Warnings

Introduction

The BitMEX Marketmaker Bot is an automated trading system designed for grid trading strategies on BitMEX cryptocurrency futures. The bot uses a market-making approach, placing buy and sell orders around the current market price to profit from price volatility.

Key Features

  • Automated Grid Trading: Places buy and sell orders in a grid pattern around the current price
  • Multi-Symbol Support: Monitor and trade multiple trading pairs simultaneously
  • Real-Time Charting: Interactive candlestick charts with real-time price updates
  • Secure Wallet System: Encrypted storage for API keys or Web3 wallet integration
  • Order Management: View and manage active orders in real-time
  • Settings Templates: Save and load trading configurations
  • Dark Theme UI: Modern, easy-to-use PyQt5 interface

Supported Exchanges

  • BitMEX (Primary)
  • Additional exchanges planned for future releases

Installation

Option 1: Using the Executable (Recommended)

  1. Download the latest executable (trade.exe or BitmexMarketmakerBot.exe) from the releases
  2. Place the executable in a folder of your choice
  3. Double-click to run (no installation required)

Note: The first run will create a settings.json file in the same directory as the executable.


Getting Started

First Launch

When you first launch the application, you'll see the main window with several dockable panels:

  • Top Left: Chart panel (initially empty)
  • Bottom Left: Settings Templates panel
  • Right: Current Settings panel
  • Bottom: Orders panel

Initial Setup Steps

  1. Connect Your Wallet (see Wallet Connection)
  2. Select Trading Symbols (see Symbol Selection)
  3. Configure Trading Settings (see Trading Settings)
  4. Start the Bot (see Starting and Stopping the Bot)

Wallet Connection

The application supports two types of wallet connections for accessing BitMEX:

Local Wallet (API Keys)

This is the recommended method for BitMEX trading, as BitMEX uses API keys, not cryptocurrency wallets.

Creating a New Local Wallet

  1. Click the "Connect Wallet" button in the Current Settings panel
  2. Select "Local Wallet (API Keys)"
  3. Choose "Create New Wallet"
  4. Enter a strong master password (you'll need this to unlock your wallet)
  5. Enter your BitMEX API Key (Public Key)
  6. Enter your BitMEX Secret Key (Private Key)
  7. Click "Create Wallet"

Important:

  • Your API keys are encrypted and stored in wallet.dat in the application directory
  • Never share your master password or API keys
  • If you lose your master password, you cannot recover your API keys

Unlocking an Existing Local Wallet

  1. Click "Connect Wallet"
  2. Select "Local Wallet (API Keys)"
  3. Choose "Unlock Existing Wallet"
  4. Enter your master password
  5. Click "Unlock"

Getting BitMEX API Keys

  1. Log in to your BitMEX account
  2. Go to AccountAPI Keys
  3. Click "Create API Key"
  4. Set appropriate permissions (read-only for testing, trading for live use)
  5. Copy the API Key and Secret Key
  6. Important: The secret key is only shown once - save it securely

Web3 Wallet (Experimental)

For users who prefer Web3 wallet integration:

  1. Click "Connect Wallet"
  2. Select "Web3 Wallet"
  3. Enter your wallet address
  4. Select the network (Ethereum, Polygon, Arbitrum, Optimism, BSC, or Avalanche)
  5. Optionally enter a custom RPC URL
  6. Click "Connect"

Note: Web3 wallet connection is primarily for address verification. For BitMEX trading, you still need API keys through the Local Wallet system.

Disconnecting Your Wallet

Click "Disconnect Wallet" to disconnect. Your encrypted keys remain stored but are no longer active in the session.


Symbol Selection

The application supports trading multiple symbols simultaneously. You can monitor and trade different trading pairs on the same chart.

Selecting Symbols

  1. After connecting your wallet, click "Select Symbols" in the Current Settings panel
  2. A dialog will appear with available BitMEX trading pairs
  3. Check the boxes next to the symbols you want to trade
  4. Click "OK" to confirm

Default Symbol

  • XBTUSD is selected by default (Bitcoin perpetual swap)

Supported Symbols

Common BitMEX symbols include:

  • XBTUSD: Bitcoin Perpetual Swap
  • ETHUSD: Ethereum Perpetual Swap
  • ADAUSD: Cardano Perpetual Swap
  • And many more...

Multi-Symbol Charting

When multiple symbols are selected:

  • Each symbol appears on the chart with a different color
  • Real-time price updates are shown for all selected symbols
  • You can compare price movements across different trading pairs

Chart Features

The chart panel displays candlestick charts with real-time updates.

Chart Controls

  • Zoom: Scroll with mouse wheel or use zoom buttons
  • Pan: Click and drag to move the chart
  • Time Range: Automatically adjusts based on loaded data

Candlestick Colors

  • Green/Teal: Price increased (close > open)
  • Red: Price decreased (close < open)
  • Multi-Symbol: Each symbol has its own color scheme

Real-Time Updates

  • Kline Updates: New candles appear every minute
  • Trade Updates: Real-time price and volume updates for the current candle
  • Historical Data: Automatically loads when symbols are selected

Viewing Data

The chart automatically:

  • Loads historical candlestick data when symbols are selected
  • Updates in real-time as new trades occur
  • Displays multiple symbols simultaneously with different colors

Trading Settings

Configure your trading strategy in the Current Settings panel. The bot uses a grid trading strategy with the following parameters:

Key Settings

Orders Configuration

  • Orders Pairs: Number of buy/sell order pairs to place (e.g., 5 pairs = 10 total orders)
  • Orders Start Size: Initial order size in contracts
  • Order Step Size: Size increment for each order level
  • Interval: Time interval between grid updates (in seconds)

Risk Management

  • Min Spread: Minimum price spread between buy and sell orders (prevents unprofitable trades)
  • Stop Loss Fund: Maximum loss before the bot stops trading
  • Rebuild After Change: Percentage price change that triggers grid rebuild

Position Management

  • Adjust Grid By Position: Whether to adjust the grid based on current position
  • Min Position: Minimum position size (negative for short positions)
  • Max Position: Maximum position size (positive for long positions)

Setting Values

  1. Each setting has an input field in the Current Settings panel
  2. Enter your desired values
  3. Settings are automatically saved to settings.json
  4. Changes take effect when you start or restart the bot

Recommended Settings for Beginners

  • Orders Pairs: 3-5
  • Orders Start Size: 10-50 contracts
  • Order Step Size: 5-10 contracts
  • Min Spread: 0.5-1.0%
  • Interval: 60 seconds

Warning: These are example values. Always test with small amounts first!


Starting and Stopping the Bot

Starting the Bot

  1. Ensure your wallet is connected
  2. Select at least one trading symbol
  3. Configure your trading settings
  4. Click the "Start Bot" button in the Current Settings panel

The bot will:

  • Connect to BitMEX
  • Load current market data
  • Place initial grid orders
  • Begin monitoring and updating orders

Stopping the Bot

  1. Click the "Stop Bot" button
  2. The bot will cancel all active orders
  3. Your position and balance remain unchanged

Note: There is a known issue where the "Stop Bot" button may not immediately stop grid updates. If this occurs, close the application.

Bot Status

  • Running: Bot is actively trading
  • Stopped: Bot is not trading
  • Error: An error occurred (check the console for details)

Order Management

The Orders panel displays all active orders in real-time.

Viewing Orders

  • Order ID: Unique identifier for each order
  • Side: Buy or Sell
  • Price: Order price level
  • Size: Order size in contracts
  • Status: Order status (New, Partially Filled, Filled, Canceled)

Order Actions

  • Cancel Individual Order: Click the cancel button next to an order
  • Cancel All Orders: Use the "Cancel All" button in the Current Settings panel

Order Updates

Orders update automatically when:

  • An order is filled
  • An order is canceled
  • The grid is rebuilt
  • Market conditions change

Settings Templates

Save and load trading configurations for quick setup.

Saving a Template

  1. Configure your trading settings
  2. Enter a template name in the Settings Templates panel
  3. Click the save button (usually marked with "!")
  4. Your settings are saved with that name

Loading a Template

  1. In the Settings Templates panel, find your saved template
  2. Click the template name button
  3. Settings are automatically loaded into the Current Settings panel

Managing Templates

  • Templates are stored in settings.json
  • You can have multiple templates for different strategies
  • Templates can be deleted by removing them from settings.json (advanced users)

Troubleshooting

Common Issues

"FileNotFoundError: settings.json"

Solution: The application will create settings.json automatically. If the error persists:

  • Ensure you have write permissions in the application directory
  • Check that the executable is not in a read-only location

"Connection Error" or "API Key Invalid"

Solutions:

  • Verify your API keys are correct
  • Check your internet connection
  • Ensure your BitMEX API keys have trading permissions
  • Verify you're using the correct API keys (testnet vs. mainnet)

Chart Not Showing Data

Solutions:

  • Ensure at least one symbol is selected
  • Check your internet connection
  • Verify the wallet is connected
  • Wait a few seconds for data to load
  • Check the console for error messages

Bot Not Placing Orders

Solutions:

  • Verify your API keys have trading permissions
  • Check that you have sufficient balance
  • Ensure "Min Spread" is not too large
  • Verify your order sizes are within exchange limits
  • Check the console for error messages

Wallet Unlock Fails

Solutions:

  • Verify you're using the correct master password
  • Ensure wallet.dat exists in the application directory
  • If the wallet file is corrupted, you may need to create a new wallet

Getting Help

  1. Check the console output for error messages
  2. Review this user guide
  3. Check the GitHub issues page
  4. Verify your settings are within reasonable ranges

Best Practices

  1. Start Small: Begin with minimal order sizes and positions
  2. Monitor Regularly: Check your bot's performance frequently
  3. Set Limits: Use position limits and stop loss settings
  4. Test Settings: Test different configurations on paper trading or with small amounts
  5. Keep Updated: Update to the latest version for bug fixes
  6. Backup Settings: Keep backups of your settings.json and wallet.dat files
  7. Secure Storage: Store your master password and API keys securely

Recommended Testing Workflow

  1. Testnet: Test on BitMEX testnet first
  2. Small Amounts: Start with very small positions
  3. Monitor: Watch the bot for several hours/days
  4. Adjust: Fine-tune settings based on performance
  5. Scale: Gradually increase position sizes if results are positive

Additional Information

File Locations

When running from executable:

  • settings.json: Trading settings (next to executable)
  • wallet.dat: Encrypted API keys (next to executable)

When running from source:

  • settings.json: Trading settings (project root)
  • wallet.dat: Encrypted API keys (project root)

System Requirements

  • OS: Windows 10/11, Linux, macOS
  • RAM: 4GB minimum, 8GB recommended
  • Internet: Stable connection required
  • Disk Space: ~100MB for application files

Glossary

  • Grid Trading: A strategy that places buy and sell orders at regular price intervals
  • Market Making: Providing liquidity by placing both buy and sell orders
  • Perpetual Swap: A futures contract without an expiration date
  • API Key: Authentication credentials for programmatic access
  • Candlestick: A chart type showing open, high, low, and close prices
  • Position: Your current holdings (long = positive, short = negative)
  • Spread: The difference between buy and sell prices

Version: 1.0.0 Last Updated: 2025 License: MIT


Remember: Trading cryptocurrencies involves risk. Only trade with funds you can afford to lose.

BitMEX Marketmaker Bot

Versionv1.0.0
PlatformWindows
File Size77.97 MB
CategoryTrading Bot
1 USDT

Tags

trading