June 2015
Beginner
348 pages
8h 44m
English
Often we are more interested in the trend of a data sample than in detrending it. We can still get the trend back easily after detrending. Let's do that for one year of price data for QQQ.
today = date.today()
start = (today.year - 1, today.month, today.day)
quotes = quotes_historical_yahoo("QQQ", start, today)
quotes = np.array(quotes)
dates = quotes.T[0]
qqq = quotes.T[4]y = signal.detrend(qqq)
alldays = DayLocator() months = MonthLocator()
month_formatter = DateFormatter("%b %Y")Read now
Unlock full access