This project is a web-based stock trading dashboard that implements a momentum trading strategy using technical indicators. It allows users to analyze stock data, visualize trading signals, and simulate portfolio performance.
- Fetch historical stock data for multiple tickers
- Calculate technical indicators (MACD, RSI)
- Generate buy/sell signals based on MACD crossovers
- Implement a simple trading strategy
- Visualize stock prices, indicators, and trading signals
- Simulate portfolio performance
- Backend: Python, Flask
- Frontend: HTML, JavaScript, CSS
- Data Analysis: pandas, numpy, yfinance, ta (Technical Analysis library)
- Visualization: matplotlib
- Clone the repository:
-
git clone https://github.com/varunbudati/MACD-Trading-Strategy-Visualizer.git -
cd MACD-Trading-Strategy-Visualizer - Install required Python packages: pip install flask pandas numpy yfinance ta matplotlib
- Run the Flask application: python app.py
- Open a web browser and navigate to
http://localhost:5000to access the dashboard.
- Select one or more stock tickers from the preset list or add custom tickers.
- Choose a date range for analysis.
- Click "Get Data" to fetch and analyze the stock data.
- View the generated charts showing stock prices, MACD indicators, and buy/sell signals.
- Analyze the simulated portfolio performance based on the implemented trading strategy.
app.py: Flask application serving as the backendTrading.py: Contains core functions for data processing and strategy implementationindex.html: Frontend HTML template for the dashboard
Contributions to improve the project are welcome. Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature-branch) - Make your changes and commit (
git commit -am 'Add some feature') - Push to the branch (
git push origin feature-branch) - Create a new Pull Request
This project is for educational purposes only. The implemented trading strategy is a basic example and should not be used for actual trading without thorough testing and risk management considerations.



