A sophisticated cryptocurrency futures risk management system built with Flask, successfully integrated with BitUnix trading platform. The application provides real-time portfolio monitoring, risk assessment, and emergency stop mechanisms for cryptocurrency trading with an emphasis on conservative trading strategies and capital preservation.
- Real-time BitUnix API connection with proper double SHA-256 authentication
- Live balance monitoring - Displays actual account balance ($197.97) updated every 5 seconds
- Position detection - Automatically detects active positions and margin usage
- Real-time P&L tracking - Live unrealized/realized profit and loss monitoring
- 1.5% stop loss and 3% take profit for optimal 2:1 risk-reward ratio
- Maximum 5x leverage limit for capital protection
- Daily loss limits (3%) with automatic emergency stop
- Conservative position sizing recommendations
- 15-25 signals per minute across 200+ cryptocurrencies
- Multiple categories: AI tokens, meme coins, DeFi, gaming, Layer 2s, infrastructure
- High confidence filtering - Only signals with 75%+ confidence
- Trade duration recommendations based on volatility and market conditions
- Real-time portfolio overview with live balance and position updates
- Risk metrics visualization including portfolio exposure and margin ratios
- Trading signals feed with entry/exit recommendations
- Emergency stop system with multiple trigger conditions
- Backtesting capabilities for strategy validation
- Backend: Flask (Python)
- Frontend: Bootstrap 5 Dark Theme, Chart.js
- API Integration: BitUnix Futures API
- Real-time Updates: APScheduler for background tasks
- Technical Analysis: Pandas, NumPy for indicator calculations
- Authentication: Double SHA-256 signature method
- Python 3.8+
- BitUnix API credentials (API key and secret)
- Required Python packages (see
pyproject.toml)
-
Clone the repository
git clone https://github.com/devomil/Bitunix.git cd Bitunix -
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
export BITUNIX_API_KEY="your_api_key_here" export BITUNIX_SECRET_KEY="your_secret_key_here" export SESSION_SECRET="your_session_secret_here"
-
Run the application
python main.py
-
Access the dashboard Open your browser to
http://localhost:5000
- Create a BitUnix account and enable futures trading
- Generate API credentials in your account settings
- Ensure your API key has futures trading permissions
- Set the environment variables as shown above
The system uses BitUnix's required double SHA-256 signature method:
digest_input = nonce + timestamp + api_key + query_params + body
digest = SHA256(digest_input)
signature = SHA256(digest + secret_key)
- Total Balance: Real-time account balance
- Active Positions: Number of open futures positions
- Total Risk: Portfolio risk exposure percentage
- Daily P&L: Unrealized and realized profit/loss
- Symbol: Cryptocurrency pair (e.g., BTC/USDT)
- Direction: Long or short recommendation
- Confidence: Signal confidence percentage (75-95%)
- Leverage: Suggested leverage (1-3x conservative)
- Entry Price: Recommended entry point
- Stop Loss: Conservative 1.5% risk limit
- Take Profit: 3% target for 2:1 risk-reward
- Duration: Recommended trade holding period
- Emergency Stop: Automatic halt on 3% daily loss
- Position Limits: Maximum position size controls
- Leverage Caps: Conservative leverage restrictions
- Real-time Monitoring: Continuous risk assessment
This system prioritizes capital preservation over aggressive gains:
- Risk-First Approach: All signals include predefined stop losses
- Conservative Leverage: Maximum 5x leverage, typically 1-3x recommended
- High Confidence: Only signals with 75%+ confidence are displayed
- Diversification: Signals across multiple cryptocurrency categories
- Emergency Protection: Automatic trading halt mechanisms
BTC, ETH, SOL, ADA, AVAX, DOT, ATOM, NEAR, FTM, etc.
FET, AGIX, OCEAN, RNDR, GRT, TAO, NMR, etc.
DOGE, SHIB, PEPE, FLOKI, BONK, WIF, etc.
UNI, AAVE, COMP, MKR, SNX, CRV, YFI, etc.
AXS, SAND, MANA, ENJ, GALA, etc.
MATIC, ARB, OP, LRC, IMX, etc.
- Portfolio data: Updates every 30 seconds
- Trading signals: Generated every 60 seconds
- Dashboard refresh: Live updates every 5 seconds
- API connectivity: Continuous monitoring
This software is for educational and informational purposes only. Cryptocurrency trading involves substantial risk of loss. Past performance does not guarantee future results. Always conduct your own research and consider your risk tolerance before trading.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or support:
- Create an issue in this repository
- Check the BitUnix API documentation
- Review the risk management guidelines
conservative-crypto-risk-manager/
βββ main.py # Application entry point
βββ app.py # Flask application and routes
βββ api_client.py # BitUnix API integration
βββ risk_manager.py # Risk management logic
βββ portfolio.py # Portfolio monitoring
βββ signals.py # Signal generation
βββ indicators.py # Technical indicators
βββ backtesting.py # Strategy backtesting
βββ emergency_stop.py # Emergency stop system
βββ templates/ # HTML templates
β βββ dashboard.html # Main dashboard
βββ static/ # CSS, JS, and assets
β βββ style.css # Custom styling
β βββ dashboard.js # Frontend logic
βββ README.md # This file
Built with β€οΈ for conservative crypto traders who value capital preservation over risky speculation.