Skip to content

About

Leverage ETF Time-back TEST

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

🚀 LeverageBack

Python Version License: Apache Update Log

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.


🎯 Key Features

  • 📈 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.

🛠️ Tech Stack

  • 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.

📊 Quantitative Logic

LeverageBack calculates the daily leveraged return ($R_{lev}$) by factoring in the leverage ratio ($L$), borrowing costs ($C_b$), and expense ratios ($E$):

$$R_{lev, t} = (R_{base, t} \times L) - [(L - 1) \times \frac{C_b}{365}] - \frac{E}{365}$$

The model explicitly accounts for the Volatility Decay inherent in daily rebalanced leveraged ETFs, providing a realistic view of long-term "slippage."


🚀 Quick Start

1. Installation

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

About

Leverage ETF Time-back TEST

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages