A simple Streamlit app to visualize how compounding affects trading results over time. This calculator simulates the growth of a trading account based on your strategy parameters, expectancy, and risk management rules.
Live demo: https://compounding-simulator.clocktrades.com/
Other streamlit demos:
- https://performance-visualizer.clocktrades.com/
- https://expectancy-and-kelly-calculator.clocktrades.com/
This tool is designed for traders who want to understand the power of compounding applied to their strategies:
- Adapted Formula: A = P × (1 + r/n)^(n×t)
- A: Ending balance
- P: Starting balance
- r: Expected return per period (based on expectancy)
- n: Number of compounding periods per cycle
- t: Number of cycles
- Trading context: We compound risk per trade (as % of balance), adjusted for wins, losses, taxes, and cash flows.
- Benefits:
- Quickly visualize long-term account growth.
- Experiment with different strategies & risk parameters.
- Learn how expectancy and Kelly Criterion influence outcomes.
- Backend: Streamlit
- Frontend: Streamlit
- Libraries: Pandas, Numpy, Matplotlip
- ✅ Interactive compound interest simulation for trading
- ✅ Adjustable starting balance, target balance, risk % per trade, and number of trades
- ✅ Displays Expectancy and Kelly Criterion values
- ✅ Interactive charts to visualize balance growth
- ✅ Simple, lightweight, no database required
| Input | Growth Simulation |
|---|---|
![]() |
![]() |
-
Clone the repository:
git clone <repo_url>
-
Create a virtual environment and install dependencies:
python -m venv venv source venv/bin/activate # on macOS/Linux venv\Scripts\activate # on Windows pip install -r requirements.txt
-
Run the application:
streamlit run app.py
-
Open in your browser:
http://localhost:8501
MIT

