Python Assignment
Python Assignment
You are tasked with building a Stock Portfolio Tracker and Trade Analyzer. The program should simulate
portfolio management, analyze stock trading opportunities, and provide insights based on real-world data.
1. Simulate a Portfolio:
o Create a sample portfolio where the user owns specific quantities of stocks (e.g., AAPL: 10
shares, TSLA: 5 shares).
o Calculate and display the current value of the portfolio using real-time data.
2. Performance Tracking:
o Compare the current portfolio value with its value at the start of the historical data period.
o Calculate the percentage gain/loss for each stock and the portfolio as a whole.
1. Error Handling:
o Handle potential errors, such as:
API rate limits.
Missing data for certain dates.
Negative portfolio balance (ensure simulation doesn’t allow overspending).
2. Logging:
o Log each trade, including the date, stock symbol, action (BUY/SELL), quantity, price, and
portfolio balance.
1. Data Visualization:
o Plot the stock prices over time for all symbols.
o Highlight buy and sell signals on the graph.
2. Custom Strategy:
o Allow the user to define custom thresholds for the moving average periods and test the
performance.
Deliverables
Please email the completed assignment (as a zip file) to [Your Email Address].
Use the subject line: [Your Name] – Python Developer Assignment.
Deadline: [Insert Date and Time].
Evaluation Criteria
_______________