🏠 होम
बेंचमार्क
📊 सभी बेंचमार्क 🦖 डायनासोर v1 🦖 डायनासोर v2 ✅ टू-डू लिस्ट ऐप्स 🎨 रचनात्मक फ्री पेज 🎯 FSACB - अल्टीमेट शोकेस 🌍 अनुवाद बेंचमार्क
मॉडल
🏆 टॉप 10 मॉडल 🆓 मुफ्त मॉडल 📋 सभी मॉडल ⚙️ किलो कोड
संसाधन
💬 प्रॉम्प्ट लाइब्रेरी 📖 एआई शब्दावली 🔗 उपयोगी लिंक
Advanced

Python Stock Analysis

#coding #python #trading

Write a Python script to calculate technical indicators for stock data.

Act as a Quantitative Analyst. Write a Python script using the 'yfinance' and 'pandas' libraries. The script should fetch historical data for Apple (AAPL) over the last year and calculate the 20-day and 50-day Simple Moving Averages (SMA). Add a column to the DataFrame that generates a 'Buy' signal when the short-term SMA crosses above the long-term SMA.