A comprehensive Streamlit web application for trading analysis and strategy backtesting. This dashboard integrates multiple powerful trading tools into a single, interactive platform.
https://tradingtools.streamlit.app/
- Stan Weinstein Strategy: Backtest Stan's 30-week moving average strategy
- SMA Backtesting: Test short vs long-term moving average crossover strategies
- Risk vs Reward Analysis: Analyse risk-return profiles of multiple stocks
- Correlation Heatmap: Visualise correlations between different stocks
- Real-time Data: Live stock data from Yahoo Finance
-
Clone the repository:
git clone https://github.com/theredplanetsings/Trading-Tools.git cd Trading-Tools -
Install dependencies:
pip install -r requirements.txt
-
Run the dashboard:
streamlit run trading_dashboard.py
-
Open your browser to
http://localhost:8501
Trading-Tools/
├── trading_dashboard.py # Main Streamlit dashboard application
├── StanWeinstein.py # Stan Weinstein strategy backtesting class
├── mySMAbacktesting.py # SMA crossover strategy backtesting class
├── riskvsreward.py # Risk vs reward analysis script
├── correlationHeatMap.py # Correlation heatmap generation script
├── requirements.txt # Python dependencies
├── README.md # this file
└── LICENCE # the licence
streamlit- Web app frameworkpandas- Data manipulationnumpy- Numerical computingyfinance- Stock dataplotly- Interactive chartsmatplotlib- Additional plottingseaborn- Statistical visualisation
- Object-Oriented Design: Modular backtesting classes for easy extension and maintenance
- Interactive Visualisations: Dynamic Plotly charts with zoom, pan, and hover functionality
- Statistical Analysis: Comprehensive performance metrics and correlation matrices
- Responsive Web Interface: Mobile-friendly Streamlit dashboard with intuitive navigation
- Scalable Architecture: Easily extensible codebase for adding new trading strategies
- Enter a stock symbol (e.g., AAPL, TSLA)
- Select your date range
- Click "Run Analysis" to see strategy performance vs buy & hold
- Enter stock symbol and moving average periods
- Choose date range
- View performance comparison and trading signals
- Enter multiple stock symbols (one per line)
- Set analysis period
- Explore risk-return scatter plot and statistics
- Input stock symbols for correlation analysis
- Adjust correlation threshold
- View heatmap for portfolio diversification insights
- Upload files to GitHub
- Connect repository to Streamlit Cloud
- Deploy automatically
trading_dashboard.py- Main application entry pointStanWeinstein.py- Stan Weinstein strategy implementationmySMAbacktesting.py- SMA backtesting functionalityrequirements.txt- Python dependenciesREADME.md- self-explanatory
riskvsreward.py- Standalone risk analysis scriptcorrelationHeatMap.py- Standalone correlation analysis script
The dashboard calculates key financial metrics:
- Total Returns: Strategy vs buy-and-hold comparison
- Volatility Analysis: Risk assessment through standard deviation
- Sharpe Ratios: Risk-adjusted return calculations
- Maximum Drawdown: Worst peak-to-trough decline analysis
- Win Rate: Percentage of profitable trades
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Creative Commons Zero v1.0 Universal (CC0) - Public domain dedication for maximum freedom
- GitHub: @theredplanetsings