Native Rust performance directly from your terminal. No compilation needed â just install via pip and run anywhere.
Pure Rust execution with minimal memory footprint. Direct binding to the core engine.
Pre-compiled for all major platforms. Installs instantly with `pip install`.
Design for automated pipelines. JSON in, JSON out.
Chain backtests in bash/zsh with standard process piping.
# The CLI is automatically installed with rlxbt
pip install rlxbt
# Verify installation
rlx-cli --helpAutomatic Integration The command-line tools are smart enough to find the native engine regardless of whether you installed from PyPI or are working in a local development environment.
Run backtest using JSON rules file â no pre-calculated signals needed.
rlx-cli rules-backtest \
--data data/BTCUSDT_1h_with_indicators.csv \
--rules strategies/rsi_strategy.json \
--capital 100000 \
--commission 0.001 \
--output results.json| Argument | Description | Default |
|---|---|---|
| --data | CSV file with OHLCV + indicators | Required |
| --rules | JSON rules file | Required |
| --capital | Initial capital | 100000 |
| --commission | Commission rate | 0.0 |
| --dashboard | Launch web dashboard | false |
| --output | Output JSON file | None |
Display information about a data file.
rlx-cli info --data data/BTCUSDT_1h.csv
# Output: bar count, time range, available columnsAdvanced graph-based pattern backtester. Directly execute complex flow-charts strategies with high precision.
rlx-graph --data data/BTCUSDT_1h_complex.csv --graph strategy.json{
"entry_long": "RSI_14 < 30",
"exit_long": "RSI_14 > 70",
"entry_short": "RSI_14 > 70",
"exit_short": "RSI_14 < 30"
} In RLX, signals are defined in the entry_rules array. Each rule specifies a condition, a signal name for reporting, and a trade direction (1 for Long, -1 for Short).
{
"entry_rules": [
{
// Condition: Multiple indicators + Account metrics
"condition": "RSI_14 < 25 && Stoch_K < 20 && total_pnl > 0",
"signal": "DeepOversoldLong",
"direction": 1
},
{
"condition": "close > EMA_12 && EMA_12 > EMA_26 && RSI_14 > 55",
"signal": "MomentumTrendLong",
"direction": 1
}
],
"exit_rules": [
{
"condition": "current_position_pnl / current_balance < -0.015",
"reason": "PositionRiskExit"
},
{
"condition": "bars_held > 30",
"reason": "TimeExit"
}
],
"stop_loss_pct": 0.005,
"take_profit_pct": 0.005
}$ rlx-cli rules-backtest --data data/BTCUSDT_1h.csv --rules rules/btc_rsi.json
RLX Backtester v1.0.0
âââââââââââââââââââââââââââââââââââââââââââââââââââ
đ Data: BTCUSDT_1h.csv (8,760 bars)
đ Strategy: btc_rsi.json
đ° Initial Capital: $10,000.00
Running backtest... ââââââââââââââââââââ 100% (0.02s)
âââââââââââââââââââââââââââââââââââââââââââââââââââ
RESULTS
âââââââââââââââââââââââââââââââââââââââââââââââââââ
Performance:
Total Return: +45.23%
Sharpe Ratio: 1.87
Sortino Ratio: 2.45
Max Drawdown: -12.34%
Calmar Ratio: 3.67
Trading:
Total Trades: 156
Win Rate: 62.18%
Profit Factor: 2.31
Avg Trade: +0.29%
Risk:
VaR (95%): -1.23%
CVaR (95%): -1.87%
Ulcer Index: 4.56
Time: 0.006s | 6,586,343 bars/sec