Built by MoonDev | YouTube Channel
A professional cryptocurrency trading bot for Hibachi Exchange with real-time price feeds, limit order execution, and automated P&L management.
- Real-time Price Feeds - Lightning-fast price updates for optimal entry/exit
- Interactive Menu System - Simple number-based controls for all trading operations
- Smart Order Management - Limit orders with automatic fill checking and size adjustment
- P&L Monitoring - Automated take profit and stop loss with real-time tracking
- Position Management - Long and short positions with precise entry/exit loops
- Automated Flow - After opening a position, automatically starts P&L monitoring
- Manual Trade Support - P&L monitor works with positions opened manually too
- Up to 15x Leverage - Control leverage through position size (see leverage notes below)
- [0] Close Position - Exit current position using limit orders
- [1] Open Long - Buy at bid price (maker order)
- [2] Open Short - Sell at ask price (maker order)
- [3] P&L Monitor - Auto-close at take profit/stop loss
- [Q] Quit - Exit the bot
- Clone this repository:
git clone https://github.com/yourusername/Hibachi-Crypto-Exchange-Trading-Python-Examples.git
cd Hibachi-Crypto-Exchange-Trading-Python-Examples- Install dependencies:
pip install -r requirements.txt- Set up your environment variables:
cp .env.example .env- Edit
.envwith your Hibachi Exchange credentials
# Required - Get these from Hibachi Exchange
HIBACHI_API_KEY=your_api_key_here
HIBACHI_ACCOUNT_ID=your_account_id_here
HIBACHI_PRIVATE_KEY=your_private_key_here
# Optional - Defaults shown
HIBACHI_SYMBOL=BTC/USDT-PEdit these constants at the top of trading_bot.py:
POSITION_SIZE_USD = 100 # Position size in USD (will be leveraged)
TAKE_PROFIT = 2.0 # Take profit at 2% gain
STOP_LOSS = -1.0 # Stop loss at 1% loss
LOOP_SLEEP = 2 # Sleep between loops (seconds)Run the bot:
python trading_bot.pyRun these scripts to test various functionalities:
- Test API connection:
python 0_test_keys.py- Check account balances:
python 1_get_balances.py- Get current prices:
python 2_get_prices.py- Place a test order:
python 3_place_order.py-
Entry: Choose [1] for Long or [2] for Short
- Places limit orders at bid (long) or ask (short)
- Loops until filled
- Automatically flows into P&L monitoring after entry!
-
Automated Risk Management: After position opens
- P&L monitor starts automatically
- Continuously tracks your position
- Auto-closes at take profit (2% default)
- Auto-closes at stop loss (-1% default)
- Shows real-time P&L updates
-
Manual Trading Support:
- Open positions manually on the exchange
- Run option [3] to monitor and auto-close them
- Perfect for traders transitioning to automation!
The Flow: Enter → Auto-Monitor → Auto-Close at TP/SL → Back to Menu
trading_bot.py- Main bot with interactive menunice_funks.py- Hibachi Exchange API wrapper0_test_keys.py- Test API connection1_get_balances.py- Get account balances2_get_prices.py- Get current market prices3_place_order.py- Place and manage orders.env.example- Environment variable templaterequirements.txt- Python dependencies
- Limit orders only (no market slippage)
- Position size validation
- Automatic order cancellation on errors
- Real-time position tracking
- Partial fill handling
Hibachi has a unique leverage system that's different from other exchanges:
- There's NO leverage slider or setting on Hibachi
- Your account automatically has up to 15x leverage available on BTC
- You control leverage by the position size you enter
If you have $100 in your account:
- You can trade up to $1,500 worth of BTC (15x max)
- To trade with 2x leverage: Enter a $200 position
- To trade with 5x leverage: Enter a $500 position
- To trade with 10x leverage: Enter a $1,000 position
# Configuration at top of main.py
POSITION_SIZE_USD = 100 # Your margin (your actual money)
LEVERAGE = 2 # Your desired leverage
# The bot calculates: $100 × 2 = $200 positionSo if you want different leverage, just change the LEVERAGE value:
LEVERAGE = 1→ $100 position (no leverage, just your capital)LEVERAGE = 2→ $200 positionLEVERAGE = 5→ $500 positionLEVERAGE = 10→ $1,000 positionLEVERAGE = 15→ $1,500 position (max for BTC)
Remember: Hibachi doesn't have a leverage setting - you control it through position size!
For tutorials and updates:
- 🎥 MoonDev YouTube
- 📺 Watch the build process and live trading sessions
Error: "Insufficient balance"
- This means your Hibachi Exchange account has zero balance or insufficient funds
- Add USDT to your account to resolve this
- The bot code is working correctly - this is an account-level restriction
This bot is for educational purposes. Trading cryptocurrency carries significant risk. Only trade with funds you can afford to lose. Always test on testnet first.
MIT License - See LICENSE file for details
Built with 🌙 by MoonDev