This project effectively combines several key techniques in algorithmic trading:
- Data Collection: Utilizes yfinance for fetching historical stock prices.
- Data Manipulation: Implements custom calculations for technical indicators like RSI.
- Trading Logic: Defines clear rules for executing trades based on market conditions.
- Portfolio Management: Tracks capital changes throughout the trading process.
- Data Visualization: Provides insights into trading performance through graphical representation.
Trading Logic The program employs a set of trading rules based on RSI thresholds to determine when to buy, sell, short, or cover positions: Trading Conditions:
- Buy Condition: If the RSI falls below 35, a buy order is executed.
- Sell Condition: If the RSI rises above 55 while holding a position, shares are sold.
- Short Condition: If the RSI exceeds 75 and no position is held, a short position is initiated.
- Cover Condition: If the RSI drops below 55 while holding a short position, it is covered.