LeverageBack is a high-performance quantitative backtesting suite designed to simulate leveraged investment strategies. It transforms historical market data into actionable risk-adjusted insights, featuring an AI-powered advisory layer to help investors navigate the complexities of leveraged volatility.
- 📈 Leveraged Simulation Engine: Accurately simulate daily-resetting leverage (e.g., 2x, 3x) and observe the effects of volatility decay and compounding.
- 🤖 AI Advisor: Integrated intelligence that analyzes backtest results to provide strategic commentary and risk warnings.
- 📊 Advanced Visualization: Interactive charts powered by Plotly, including drawdown analysis, equity curves, and rolling volatility.
- ⚙️ Flexible Parameterization: Customize management fees, borrow costs, leverage ratios, and rebalancing frequencies.
- 📉 Risk Metrics Suite: Instant calculation of Sharpe Ratio, Sortino Ratio, Maximum Drawdown (MDD), and Calmar Ratio.
- Frontend: Streamlit – For a sleek, responsive analytical dashboard.
- Data Engine: Pandas & NumPy – High-speed vectorization for financial time-series.
- Graphics: Plotly – Interactive financial charting.
- Market Data: yfinance – Reliable end-of-day market data.
LeverageBack calculates the daily leveraged return (
The model explicitly accounts for the Volatility Decay inherent in daily rebalanced leveraged ETFs, providing a realistic view of long-term "slippage."
Clone the repository and install the dependencies:
git clone [https://github.com/Seanyim/LeverageBack.git](https://github.com/Seanyim/LeverageBack.git)
cd LeverageBack
pip install -r requirements.txt