| import yfinance as yf | |
| def analyze_market(): | |
| try: | |
| nifty = yf.download("^NSEI", period="1mo") | |
| last = nifty.iloc[-1] | |
| ma20 = nifty["Close"].rolling(20).mean().iloc[-1] | |
| score = 0 | |
| if last["Close"] > ma20: | |
| score += 1 | |
| return score | |
| except: | |
| return 0 |
| import yfinance as yf | |
| def analyze_market(): | |
| try: | |
| nifty = yf.download("^NSEI", period="1mo") | |
| last = nifty.iloc[-1] | |
| ma20 = nifty["Close"].rolling(20).mean().iloc[-1] | |
| score = 0 | |
| if last["Close"] > ma20: | |
| score += 1 | |
| return score | |
| except: | |
| return 0 |