RiskSim is a Python-based tool designed for portfolio and risk simulation. It offers an intuitive interface to model risk-return dynamics and assess portfolio performance under various asset correlation scenarios, providing deep insights into risk management strategies and investment outcomes.
- Risk-Return Analysis: Simulate various risk-return scenarios using adjustable parameters like win rate, trades per year, risk per trade, and return per unit of risk (RPUR).
- Asset Correlation Simulator: Generate and visualize portfolio performance based on customizable asset correlation matrices, with options for single or random correlation ranges.
Asset Correlation Simulation Page
Asset Correlation Simulation Page
RiskSim/
│
├── pages/
│ ├── 1_🎯_risk_return_analysis.py # Main page for risk-return simulations
│ └── 2_📈_asset_correlation.py # Main page for asset correlation simulations
│
├── config/
│ ├── slider_configs.py # Configuration for slider inputs in the Streamlit UI
│ └── __init__.py # Init file for config
│
├── utils/
│ ├── risk_simulation.py # Core simulation logic for risk management and portfolio performance
│ └── style.py # Styling and layout helpers for Streamlit app
│
├── docs/images/ # Image assets for documentation and app UI
│ ├── header_image.jpg
│ ├── image.png
│ ├── image_1.png
│ ├── image_2.png
│ ├── image_3.png
│ └── image_4.png
│
├── venv/ # Python virtual environment (optional)
├── Welcome.py # Main entry point for the app
├── README.md # This file
├── LICENSE.txt # License information
├── .gitignore # Files and directories to be ignored by git
└── requirements.txt # Python dependencies
To get started with RiskSim, follow these steps:
Ensure you have Python 3.8+ installed. You'll also need pip
to install the required dependencies.
git clone https://github.com/your-username/RiskSim.git
cd RiskSim
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts�ctivate`
Install the required Python packages by running:
pip install -r requirements.txt
Start the application using Streamlit:
streamlit run Welcome.py
This will launch the RiskSim app in your browser.
- Navigate to the Risk-Return Analysis section to simulate various risk-return scenarios.
- You can adjust the number of trades per year, win rate, risk per trade, and RPUR.
- View detailed metrics such as expected drawdown, Sharpe ratio, and more.
- Use the Asset Correlation page to simulate portfolios with different asset correlations.
- Choose between fixed or random correlation settings.
- Visualize performance and compute portfolio metrics under various correlation regimes.
This project is licensed under the MIT License. See the LICENSE.txt file for details.
Made with ❤️ by Chris
- Streamlit
- Plotly
Contributions are welcome! Feel free to fork the repository, make improvements, and submit a pull request.