Skip to content

katiapek/compounding-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compound Interest Calculator

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.


🚀 Demo

Live demo: https://compounding-simulator.clocktrades.com/

Other streamlit demos:


🎯 Why this project

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:
    1. Quickly visualize long-term account growth.
    2. Experiment with different strategies & risk parameters.
    3. Learn how expectancy and Kelly Criterion influence outcomes.

🛠 Tech Stack

  • Backend: Streamlit
  • Frontend: Streamlit
  • Libraries: Pandas, Numpy, Matplotlip

✨ Features

  • ✅ 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
Posts Post

⚡ Getting Started (Local)

  1. Clone the repository:

    git clone <repo_url>
  2. 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
  3. Run the application:

      streamlit run app.py    
  4. Open in your browser:

    http://localhost:8501

📜 License

MIT


About

Interactive simulator for long-term compounding growth and drawdown analysis.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors