Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
First test- get price,moving average then plot

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

data = get_pricing('MSFT', start_date='2012-1-1', end_date='2015-6-1')
X = data['price']

MAVG = pd.rolling_mean(X, window=50)
plt.plot(X.index, X.values)
plt.plot(MAVG.index, MAVG.values)
plt.ylabel('Price')
plt.legend(['MSFT', '50-day MAVG']);**