CLI tool for creating and monitoring optimization sessions for Jesse Trading Bot trading strategies.
- π Create optimizations for multiple trading pairs and exchanges
- π Monitor optimization progress in real-time
- βοΈ Flexible configuration through files and command line arguments
- π Load coin and exchange lists from files
- π§ Override parameters through environment variables
Note: The
cpu_coresparameter does not affect optimization operation - the server ignores its value but requires its presence in the request.
- Python 3.8+
- uv for dependency management
# Install uv (if not installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install project dependencies
uv sync# Create default configuration files
python main.py --initThis will create the following files:
config.json- main configurationsymbols.txt- list of trading pairsexchanges.txt- list of exchanges
# Run with default configuration
python main.py
# Run with monitoring
python main.py --monitor
# Run single optimization
python main.py --single --symbol BTC-USDT --exchange "Bybit Spot"{
"base_url": "http://localhost:9000",
"auth_token": "your_auth_token_here",
"exchange": "Bybit Spot",
"strategy": "CloudScalper",
"timeframe": "15m",
"data_timeframes": ["4h", "6h"],
"training_start_date": "2023-03-29",
"training_finish_date": "2024-12-31",
"testing_start_date": "2025-01-01",
"testing_finish_date": "2025-09-01",
"trials": "200",
"optimal_total": 50,
"fast_mode": true,
"debug_mode": false,
"monitor_interval": 60,
"max_monitor_attempts": 100
}BTC-USDT
ETH-USDT
ADA-USDT
# Comments start with #
Bybit Spot
Binance Spot
KuCoin Spot
# Create configuration files
python main.py --init
# Run with configuration files
python main.py --config config.json --symbols-file symbols.txt --exchanges-file exchanges.txt
# Run with custom parameters
python main.py --symbols BTC-USDT ETH-USDT --exchanges "Bybit Spot" "Binance Spot"
# Run single optimization
python main.py --single --symbol BTC-USDT --exchange "Bybit Spot" --monitor
# Override parameters
python main.py --strategy CloudScalper2024 --timeframe 1h --trials 500You can override settings through environment variables:
export OPTIMIZATION_BASE_URL="http://your-server:9000"
export OPTIMIZATION_AUTH_TOKEN="your_token_here"
export OPTIMIZATION_STRATEGY="CloudScalper2024"
export OPTIMIZATION_TRIALS="500"
python main.py# Monitoring with 30 second interval
python main.py --monitor --monitor-interval 30
# Monitoring with maximum 200 attempts
python main.py --monitor --max-attempts 200optimization_cli/
βββ main.py # Main CLI script
βββ pyproject.toml # Project configuration and dependencies
βββ config.json # Configuration (created via --init)
βββ symbols.txt # List of trading pairs (created via --init)
βββ exchanges.txt # List of exchanges (created via --init)
βββ optimization_lib/ # Library
βββ __init__.py
βββ client.py # Client for creating optimizations
βββ api.py # API for monitoring
βββ config.py # Configuration management
# Create symbols.txt file with your trading pairs
echo "BTC-USDT
ETH-USDT
ADA-USDT
DOT-USDT" > symbols.txt
# Create exchanges.txt file with exchanges
echo "Bybit Spot
Binance Spot" > exchanges.txt
# Run optimization for all combinations
python main.py --monitor# Create custom config
python main.py --init
# Edit config.json
# Run with custom config
python main.py --config config.json --monitorfrom optimization_lib import OptimizationClient, OptimizationConfig
# Create client
client = OptimizationClient(
base_url="http://localhost:9000",
auth_token="your_token"
)
# Create optimization
result = client.create_optimization(
exchange="Bybit Spot",
symbol="BTC-USDT",
strategy="CloudScalper"
)
if result["success"]:
print(f"Optimization created: {result['optimization_id']}")# Install with development dependencies
uv sync --dev
# Run tests
uv run pytest
# Code formatting
uv run black .
uv run isort .
# Type checking
uv run mypy .# Add dependency
uv add requests
# Add dev dependency
uv add --dev pytest- Check the correctness of
base_urlin configuration - Make sure the server is accessible
- Check the authorization token
- Make sure
symbols.txtandexchanges.txtfiles exist - Check file format (one entry per line)
- Make sure files are not empty
- Increase
monitor_intervalto reduce load - Increase
max_monitor_attemptsfor long optimizations - Check server logs for errors
MIT License
For help, create an issue in the project repository.