<jupyter_start><jupyter_text>Create a simple moving average with a 30-day window<jupyter_code>df['30 MA'] = df['Adj Close'].rolling(window=30).mean()
df['100 MA'] = df['Adj Close'].rolling(window=100).mean()

df['100 MA'].plot()
plt.figure(figsize=(12, 8))
plt.plot(df['Adj Close'], label='Adj. close')
plt.plot(df['30 MA'], label='30 MA')
plt.plot(df['100 MA'], label='100 MA')

plt.title('Adj Close, 30 MA and 100 MA')
plt.xlabel('Date')
plt.ylabel('Adj. Close ($)')
plt.legend(loc=0)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2239089184060721, 'fraction_numerical': 0.06451612903225806, 'mean_word_length': 7.0, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '598389', 'license': 'MIT', 'n_tokens_mistral': 241, 'n_tokens_neox': 207, 'n_words': 44, 'path': 'algorithmic_trading/Moving_Average.ipynb', 'repo_name': 'linusqzdeng/pyfinance', 'size': '527'}