Quantopian notebook archive (about 500 notebooks)

I used ddg, bing and google to find notebooks on notebooks-preview.prd.pub.quantopian.com. I replaced a few files so it easier to view and still works in the future. Below you find all downloaded notebooks.


Archive

Title Link
Normalization and Classifiers quantopian_notebook_0.html
Building a Better Beta quantopian_notebook_1.html
Calculating Log Returns With Pipeline quantopian_notebook_2.html
Analyzing a Long/Short Equity Pipeline quantopian_notebook_3.html
Pipeline Example: Piotrosky Score quantopian_notebook_4.html
When Can Sharpe Ratio and Cumulative Returns Have Different Signs? quantopian_notebook_5.html
Using TA-Lib Functions in Pipelines quantopian_notebook_6.html
When Can Sharpe Ratio and Cumulative Returns Have Different Signs? quantopian_notebook_7.html
Sanity Check that Values Still Match quantopian_notebook_8.html
Introduction to the Quantopian Risk Model in Research quantopian_notebook_9.html
In [5]: from sqlalchemy import or_ fundamentals = init_fundamentals() sp_500 = get_fundamentals( query(fun quantopian_notebook_10.html
Zscore producing too many Nans? Am I doing something wrong? quantopian_notebook_11.html
In [1]: import numpy as np from quantopian.research import run_pipeline from quantopian.pipeline import Pipeline from quantopian_notebook_12.html
Quantopian Research quantopian_notebook_13.html
In [3]: bt = get_backtest('5a10aabd4ce931411f988252') 100% Time: 0:00:57|######################################### quantopian_notebook_14.html
In [1]: bt = get_backtest('58c7bf845126854761492bce') 100% Time: 0:01:03|######################################### quantopian_notebook_15.html
In [89]: from pytz import timezone import matplotlib.pyplot as plt import pandas as pd In [107]: # get minute bar quantopian_notebook_16.html
In [1]: bt = get_backtest('5a0f2f288b13eb440b93a10a') 100% Time: 0:00:43|######################################### quantopian_notebook_17.html
Performance Relative to Common Risk Factors quantopian_notebook_18.html
Enter your backtest ID. quantopian_notebook_19.html
In [1]: bt = get_backtest('57cb2d614f4c380ffbb18651') 100% Time: 0:38:22|######################################### quantopian_notebook_20.html
Enter your backtest ID. quantopian_notebook_21.html
In [1]: bt = get_backtest('58ac0dc57e45305dfebc72e0') 100% Time: 0:00:04|######################################### quantopian_notebook_22.html
References: https://www.quantopian.com/posts/research-platform-how-to-get-a-nice-heatmap https://www.quantopian.com/pos quantopian_notebook_23.html
In [1]: bt = get_backtest('5884a39bb07bf961362be5f6') 100% Time: 0:00:46|######################################### quantopian_notebook_24.html
In [1]: # From https://www.quantopian.com/posts/relevant-fundamental-factors#5b9563549ad4a0004e03850d # Working Capi quantopian_notebook_25.html
Performance Relative to Common Risk Factors quantopian_notebook_26.html
rudimentary stock screener - step through a list of symbols, analyze each one, and store the result quantopian_notebook_27.html
In [1]: bt = get_backtest('5815b5c45a1c550f21af2250') 100% Time: 0:01:27|######################################### quantopian_notebook_28.html
Enter your backtest ID. quantopian_notebook_29.html
In [7]: bt = get_backtest('5a2c2959cc0e384569a87c02') 100% Time: 0:00:50|######################################### quantopian_notebook_30.html
In [76]: from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline from quantopian.pipelin quantopian_notebook_31.html
In [1]: # https://www.quantopian.com/posts/long-short-pipeline-multi-factor backtest = get_backtest('5627b09e3dfd59112 quantopian_notebook_32.html
In [1]: bt = get_backtest('56a8157633749711029e987b') 100% Time: 0:00:45|######################################### quantopian_notebook_33.html
In [1]: bt = get_backtest('56a8157633749711029e987b') 100% Time: 0:00:45|######################################### quantopian_notebook_34.html
Alpha decay analyisis quantopian_notebook_35.html
Comparing Diversification Techniques to Hierarchical Risk Parity quantopian_notebook_36.html
An updated method to analyze alpha factors quantopian_notebook_37.html
Machine Learning inside of Pipline quantopian_notebook_38.html
Portfolio Analysis using pyfolio quantopian_notebook_39.html
In [1]: bt = get_backtest('568e8ab422d8fe1180543dae') bt.create_full_tear_sheet() 100% Time: 0:00:20|############# quantopian_notebook_40.html
A tutorial on Markowitz portfolio optimization in Python using cvxopt quantopian_notebook_41.html
The influence of COVID-19 cases on companies according to their geographic revenue quantopian_notebook_42.html
In [2]: bt = get_backtest('5a0b26f0e92c0f41c9d758d3') 100% Time: 0:01:18|######################################### quantopian_notebook_43.html
In [1]: # Get backtest object bt = get_backtest('55d5994eca36d10d86841047') # Create all tear sheets bt.create_full_te quantopian_notebook_44.html
Putting It All Together quantopian_notebook_45.html
In [17]: import statsmodels.api as sm import pandas as pd In [2]: data = get_pricing(['PEP', 'KO'], start_date='20 quantopian_notebook_46.html
Using the Kalman Filter in Algorithmic Tradin quantopian_notebook_47.html
In [138]: import numpy as np import pandas as pd from scipy import stats from pytz import timezone import matplotlib.p quantopian_notebook_48.html
Kalman Filters quantopian_notebook_49.html
In [56]: import numpy as np import pandas as pd from scipy import stats from pytz import timezone import matplotlib.py quantopian_notebook_50.html
In [186]: import pandas as pd from scipy import stats from pytz import timezone import matplotlib.pyplot as plt import quantopian_notebook_51.html
Performance Relative to Common Risk Factors quantopian_notebook_52.html
Performance Relative to Common Risk Factors quantopian_notebook_53.html
Performance Relative to Common Risk Factors quantopian_notebook_54.html
Performance Relative to Common Risk Factors quantopian_notebook_55.html
In [1]: import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns import empyrical quantopian_notebook_56.html
In [20]: from collections import deque In [5]: start = '2015-09-01' end = '2016-04-20' asset = get_pricing('MSFT', quantopian_notebook_57.html
In [20]: from collections import deque In [5]: start = '2015-09-01' end = '2016-04-20' asset = get_pricing('MSFT', quantopian_notebook_58.html
In [20]: from collections import deque In [5]: start = '2015-09-01' end = '2016-04-20' asset = get_pricing('MSFT', quantopian_notebook_59.html
Can Warren Buffett Also Predict Equity Market Downturns? quantopian_notebook_60.html
In [845]: import numpy as np import scipy as sp In [846]: days_in_quarter = 3 num_of_quarters=4 In [847]: x = quantopian_notebook_61.html
CHS Model (RISK OF FINANCIAL DISTRESS) quantopian_notebook_62.html
Using Alphalens to study if forward_earning_yield has predictive power over returns quantopian_notebook_63.html
In [90]: # Import a Kalman filter and other useful libraries from pykalman import KalmanFilter import numpy as np impo quantopian_notebook_64.html
The Capital Asset Pricing Model Revisited quantopian_notebook_65.html
Performance Relative to Common Risk Factors quantopian_notebook_66.html
Performance Relative to Common Risk Factors quantopian_notebook_67.html
Performance Relative to Common Risk Factors quantopian_notebook_68.html
Quantopian Risk Model quantopian_notebook_69.html
The CAPM Revisited II quantopian_notebook_70.html
In [86]: import numpy as np import pandas as pd import numbers # adopted from https://www.mathworks.com/matlabcentral/ quantopian_notebook_71.html
In [86]: import numpy as np import pandas as pd import numbers # adopted from https://www.mathworks.com/matlabcentral/ quantopian_notebook_72.html
FactSet Ownership - Aggregated Insider Transactions Overview quantopian_notebook_73.html
Heatmap Example quantopian_notebook_74.html
EventVestor: Dividend Announcements quantopian_notebook_75.html
In [1]: backtest = '56fecb03e199f10f401e380e' bt = get_backtest(backtest) 100% Time: 0:00:35|##################### quantopian_notebook_76.html
In [1]: bt = get_backtest('5798bcc8a634c01301e0fed8') 100% Time: 0:01:57|######################################### quantopian_notebook_77.html
Quantpedia Series: Reversal during Earnings Announcements quantopian_notebook_78.html
Factor Tearsheet quantopian_notebook_79.html
13D Filings Event Study quantopian_notebook_80.html
PsychSignal Series: Introduction quantopian_notebook_81.html
Estimize in Quantopian: Improving your Algos with Earnings Predictions quantopian_notebook_82.html
Event Study with EventVestor's Share Buybacks quantopian_notebook_83.html
PsychSignal Series: Research Design quantopian_notebook_84.html
You want to run a lot of backtests. I get it. quantopian_notebook_85.html
Zacks: Earnings Surprise quantopian_notebook_86.html
Before Proceeding: Click here to import necessary functions quantopian_notebook_87.html
Before Proceeding: Click here to import necessary functions quantopian_notebook_88.html
Before Proceeding: Click here to import necessary functions quantopian_notebook_89.html
Can we create and optimize a strategy using share buyback data? quantopian_notebook_90.html
Quantpedia Series: Predicting Earnings Following Buyback Announcements quantopian_notebook_91.html
Event Study quantopian_notebook_92.html
PsychSignal Series: Introduction quantopian_notebook_93.html
Load a backtest containing an in sample period through the live trading period quantopian_notebook_94.html
PsychSignal: StockTwits Trader Mood (All Fields) quantopian_notebook_95.html
In [2]: import numpy as np import pandas as pd from datetime import timedelta from datetime import date from quantopia quantopian_notebook_96.html
In [2]: import numpy as np import pandas as pd from datetime import timedelta from datetime import date from quantopia quantopian_notebook_97.html
Strategy Research on Quantopian quantopian_notebook_98.html
In [1]: from quantopian.pipeline import Pipeline from quantopian.pipeline import CustomFactor from quantopian.research quantopian_notebook_99.html
Performance Relative to Common Risk Factors quantopian_notebook_100.html
Hurst Exponent Approximation Factor quantopian_notebook_101.html
Common Risk Factor Performance quantopian_notebook_102.html
In [1]: # Get backtest object bt = get_backtest('5989bac564d2a359d3e420e6') 100% Time: 0:00:37|################### quantopian_notebook_103.html
Gaussian Copula Conditionals quantopian_notebook_104.html
Classical statistical arbitrage and maximum mean reversion quantopian_notebook_105.html
In [1]: # Get backtest object bt = get_backtest('59859055e3e8b44fbeddad93') 100% Time: 0:00:31|################### quantopian_notebook_106.html
Performance Relative to Common Risk Factors quantopian_notebook_107.html
In [3]: # Get backtest object bt = get_backtest('57bbdfdc1b2ff1100ff72694') # Create all tear sheets bt.create_full_te quantopian_notebook_108.html
In [1]: from quantopian.pipeline.data import Fundamentals from quantopian.pipeline.data import morningstar from quanto quantopian_notebook_109.html
In [16]: # Concise Checker # Replace string with your backtest URL tail end. bt = get_backtest('5ac354b804eeea42662c8c quantopian_notebook_110.html
In [3]: # 5 year run bt = get_backtest('560da18fb8cfd6109585fa92') 100% Time: 0:00:13|############################ quantopian_notebook_111.html
Portfolio Analysis using pyfolio quantopian_notebook_112.html
CIK In [1]: from quantopian.pipeline import Pipeline from quantopian.pipeline.data import Fundamentals import matpl quantopian_notebook_113.html
Getting Data quantopian_notebook_114.html
In [1]: from quantopian.research import run_pipeline from quantopian.pipeline import Pipeline from quantopian.pipeline quantopian_notebook_115.html
Beneish Model quantopian_notebook_116.html
Find ETF Bond funds that move counter to SPY In [359]: import pandas as pd import matplotlib.pyplot as pyplot import quantopian_notebook_117.html
Backtesting a Moving Average Crossover Strategy quantopian_notebook_118.html
Backtesting a Moving Average Crossover Strategy quantopian_notebook_119.html
Backtesting a Moving Average Crossover Strategy quantopian_notebook_120.html
Qgrid - An interactive grid for exploring pandas DataFrames quantopian_notebook_121.html
Qgrid - An interactive grid for exploring pandas DataFrames quantopian_notebook_122.html
In [17]: import pandas as pd import numpy as np import statsmodels from statsmodels.tsa.stattools import coint import quantopian_notebook_123.html
Characterizing Data - Skewness and Kurtosis quantopian_notebook_124.html
The Correlation Coefficient quantopian_notebook_125.html
In [6]: import matplotlib.pyplot as plt import pandas as pd import numpy as np In [2]: bt = get_backtest('57c13dc1 quantopian_notebook_126.html
Researching a Pairs Trading Strategy quantopian_notebook_127.html
Statistical Moments - Skewness and Kurtosis quantopian_notebook_128.html
The regression model quantopian_notebook_129.html
Linear Regression quantopian_notebook_130.html
Integration, Cointegration, and Stationarity quantopian_notebook_131.html
Regression Analysis quantopian_notebook_132.html
Model specification quantopian_notebook_133.html
Position Concentration Risk quantopian_notebook_134.html
Integration, Cointegration, and Stationarity quantopian_notebook_135.html
Measuring Momentum quantopian_notebook_136.html
In [1]: import pandas as pd import numpy as np import statsmodels from statsmodels.tsa.stattools import coint import m quantopian_notebook_137.html
Measuring monotonic relationships quantopian_notebook_138.html
Checking Factor Correlation and Risk Exposure quantopian_notebook_139.html
Portfolio Value at Risk and Conditional Value at Risk quantopian_notebook_140.html
Performance Relative to Common Risk Factors quantopian_notebook_141.html
Model Risk Exposure quantopian_notebook_142.html
Measuring monotonic relationships quantopian_notebook_143.html
Momentum Strategies quantopian_notebook_144.html
Researching a Pairs Trading Strategy quantopian_notebook_145.html
Researching a Pairs Trading Strategy quantopian_notebook_146.html
セクターが違う5つの銘柄を毎週ポジションを調整しながら保有し続ける quantopian_notebook_147.html
Alphalens Quickstart Template quantopian_notebook_148.html
In [6]: from quantopian.pipeline import Pipeline from quantopian.pipeline import CustomFactor from quantopian.research quantopian_notebook_149.html
Kalman Filters quantopian_notebook_150.html
Investing in Women-Led Companie quantopian_notebook_151.html
Portfolio Analysis using pyfolio quantopian_notebook_152.html
Constructing a Pipeline in Research quantopian_notebook_153.html
Investing In Women-led Fortune 1000 Companie quantopian_notebook_154.html
Investing in Women-Led Companie quantopian_notebook_155.html
Portfolio Analysis using pyfolio quantopian_notebook_156.html
In [1]: # coding=utf-8 import numpy as np import pandas as pd from numpy import abs from numpy import log from numpy i quantopian_notebook_157.html
In [1]: # Import Zipline, the open source backester, and a few other libraries that we will use import zipline from zi quantopian_notebook_158.html
Finding the Capital Market Line quantopian_notebook_159.html
Pairs Trading with Natural Language Processing quantopian_notebook_160.html
Pairs Trading with Machine Learning quantopian_notebook_161.html
In [64]: import pandas as pd import numpy as np from quantopian.pipeline import Pipeline from quantopian.pipeline impo quantopian_notebook_162.html
In [64]: import pandas as pd import numpy as np from quantopian.pipeline import Pipeline from quantopian.pipeline impo quantopian_notebook_163.html
In [64]: import pandas as pd import numpy as np from quantopian.pipeline import Pipeline from quantopian.pipeline impo quantopian_notebook_164.html
In [69]: vixx = local_csv('YAHOO-INDEX_VIX.csv', date_column = 'Date', use_date_column_as_index='True', timezone='UTC' quantopian_notebook_165.html
Alphalens + Quantopian | How To quantopian_notebook_166.html
Alphalens + Quantopian | How To quantopian_notebook_167.html
Alphalens boilerplate quantopian_notebook_168.html
In [1]: import numpy as np import pandas as pd from quantopian.research import run_pipeline from quantopian.pipeline i quantopian_notebook_169.html
Factor Tearsheet quantopian_notebook_170.html
In [6]: from quantopian.research.experimental import get_factor_returns f_returns = get_factor_returns(start="2005-01 quantopian_notebook_171.html
Alphalens + Quantopian | How To quantopian_notebook_172.html
Factor Tearsheet quantopian_notebook_173.html
Alphalens boilerplate quantopian_notebook_174.html
Hierarchical Clustering quantopian_notebook_175.html
In [1]: from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline from quantopian.pipeline quantopian_notebook_176.html
Alphalens boilerplate quantopian_notebook_177.html
Alphalens + Quantopian | How To quantopian_notebook_178.html
Visualizing the QTradableStocksUS quantopian_notebook_179.html
Factor Tearsheet quantopian_notebook_180.html
Performance Attribution quantopian_notebook_181.html
Step 1: Fail quantopian_notebook_182.html
May 14th Quantopian Hackathon 2016 quantopian_notebook_183.html
Alphalens - Open Source Factor Analysis quantopian_notebook_184.html
Algo Performance Analysis "Tearsheet" quantopian_notebook_185.html
In [6]: bt = get_backtest('560469497a01cb0e2456a606') 100% Time: 0:03:34|######################################### quantopian_notebook_186.html
In [2]: bt = get_backtest('5881a7241ee54f5e005ec083') bt.create_full_tear_sheet() 100% Time: 0:00:02|############# quantopian_notebook_187.html
In [1]: bt = get_backtest('594144cb0a059969efde1fc2') bt.create_full_tear_sheet() 100% Time: 0:00:06|############# quantopian_notebook_188.html
101 Alphas Project: Pipeline Factor Information Coefficent quantopian_notebook_189.html
Alpha Template quantopian_notebook_190.html
Empirical Algorithmic Implementation of Technical Analysis quantopian_notebook_191.html
RECREATING THE CNN FEAR AND GREED INDEX quantopian_notebook_192.html
In [2]: from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline from quantopian.pipeline quantopian_notebook_193.html
COVID-19 growth analysis quantopian_notebook_194.html
^^^ performance of strategy against individual stocks. quantopian_notebook_195.html
In [27]: import pyfolio as pf import matplotlib.pyplot as plt plot_TAANG, = plt.plot(pf.timeseries.cum_returns(get_bac quantopian_notebook_196.html
Portfolio Analysis using pyfolio quantopian_notebook_197.html
In [24]: from quantopian.pipeline import CustomFactor from quantopian.pipeline import Pipeline from quantopian.researc quantopian_notebook_198.html
Comparing OOS performance "long-term-buy-and-hold-on-margin" strategies quantopian_notebook_199.html
Performance Relative to Common Risk Factors quantopian_notebook_200.html
In [19]: import numpy as np import pandas as pd import talib import matplotlib.pyplot as plt In [20]: """This cell quantopian_notebook_201.html
Portfolio Analysis using pyfolio quantopian_notebook_202.html
A disqualified algo out of sample backtest 07/29/2016 - 08/14/2019 quantopian_notebook_203.html
In [9]: import numpy as np import pandas as pd from scipy import stats from pytz import timezone import datetime impor quantopian_notebook_204.html
Comparison "My all weather trio" with original constituents but different rebalance frequency (weekly,monthly,quarterly,half_year,yearly) quantopian_notebook_205.html
An updated method to analyze alpha factors quantopian_notebook_206.html
An updated method to analyze alpha factors quantopian_notebook_207.html
Run the cell below to create your tear sheet, or return to your algorithm. In [1]: bt = get_backtest('5a0b043672485d quantopian_notebook_208.html
Round trips Summary stats Alan quantopian_notebook_209.html
Portfolio Analysis using pyfolio quantopian_notebook_210.html
Load a backtest containing an in sample period through the live trading period quantopian_notebook_211.html
In [55]: from quantopian.pipeline.filters import QTradableStocksUS from quantopian.pipeline import Pipeline from quant quantopian_notebook_212.html
In [299]: # Author: Gael Varoquaux gael.varoquaux@normalesup.org # License: BSD 3 clause import datetime import numpy quantopian_notebook_213.html
Modified "How to Get an Allocation" to better suit Sentdex quantopian_notebook_214.html
Naive Bayes High Low Return Prediction Analysis based on Thomas Wiecki 's Post quantopian_notebook_215.html
What is the strategy? quantopian_notebook_216.html
Alphalens + Quantopian | How To quantopian_notebook_217.html
Simulating S&P 500, Russel 1000, Russell 3000 in Research quantopian_notebook_218.html
In [1]: from quantopian.research import run_pipeline from quantopian.pipeline import Pipeline from quantopian.pipeline quantopian_notebook_219.html
In [15]: import pyfolio as pf In [1]: pravin = get_backtest("578e3b0fbefbc00f975a5816") 100% Time: 0:01:53|### quantopian_notebook_220.html
================================================================ quantopian_notebook_221.html
Running Pipeline algorithm in research quantopian_notebook_222.html
In [9]: # Import Zipline, the open source backester, and a few other libraries that we will use import zipline from zi quantopian_notebook_223.html
Portfolio Analysis using pyfolio quantopian_notebook_224.html
Portfolio Analysis using pyfolio quantopian_notebook_225.html
Portfolio Analysis using pyfolio quantopian_notebook_226.html
Portfolio Analysis using pyfolio quantopian_notebook_227.html
New in Pipeline: Column Slices and New Factor Methods quantopian_notebook_228.html
Federal Reserve Sentiment and Macro-Tracking ETFs quantopian_notebook_229.html
In [131]: import matplotlib.pyplot as plt #import matplotlib.gridspec as gridspec import pyfolio as pf ############### quantopian_notebook_230.html
Running Pipeline algorithm in research quantopian_notebook_231.html
Example of using CEOChange in pipeline quantopian_notebook_232.html
In [78]: import pandas as pd import matplotlib.pyplot as plt small_avg = 30 large_avg = 60 start_date = '2014-01-03' e quantopian_notebook_233.html
In [2]: # - Will cause an error because I have not bought the Eventvestor data yet #from quantopian.interactive.data.e quantopian_notebook_234.html
The Bean Report quantopian_notebook_235.html
Making Fama French Visuals quantopian_notebook_236.html
In [1]: # - Will cause an error because I have not bought the Eventvestor data yet #from quantopian.interactive.data.e quantopian_notebook_237.html
During the "Quant Crash" of Aug 7-9, 2007, numerous fundamental factors, like value factors, performed extraordinarly p quantopian_notebook_238.html
Portfolio Analysis using pyfolio quantopian_notebook_239.html
In [1]: bt = get_backtest('56e2d18ac8b52b0f4e1506ba') # Create all tear sheets bt.create_full_tear_sheet() 100% Ti quantopian_notebook_240.html
In [1]: bt = get_backtest('56e2d18ac8b52b0f4e1506ba') # Create all tear sheets bt.create_full_tear_sheet() 100% Ti quantopian_notebook_241.html
Researching & Developing a Market Neutral Strategy quantopian_notebook_242.html
Domains quantopian_notebook_243.html
Part 1: Introduction to Research Environment quantopian_notebook_244.html
Futures API Introduction quantopian_notebook_245.html
In [1]: #Imports from quantopian.pipeline import CustomFactor, CustomFilter, Pipeline from quantopian.research import quantopian_notebook_246.html
Faster Fundamental Data - Overview & Performance Metrics quantopian_notebook_247.html
In [1]: from quantopian.research import prices In [6]: llex_prices = prices( symbols('LLEX'), '01-01-2014', quantopian_notebook_248.html
The best way to select a basket of ETFs is with the EquityMetadata dataset. In [1]: from quantopian.pipeline import quantopian_notebook_249.html
In [1]: import pandas as pd import numpy as np import matplotlib.cm as cm import matplotlib.pyplot as plt from datetim quantopian_notebook_250.html
RBICS Focus quantopian_notebook_251.html
Researching & Developing a Market Neutral Strategy quantopian_notebook_252.html
Enter your backtest ID. quantopian_notebook_253.html
FactSet Fundamentals Example quantopian_notebook_254.html
"Premium" Dataset quantopian_notebook_255.html
Japan challenge submission template quantopian_notebook_256.html
In [1]: import pandas as pd from datetime import datetime, timedelta import numpy as np import matplotlib.pyplot as pl quantopian_notebook_257.html
Equity Metadata quantopian_notebook_258.html
In [1]: from quantopian.research import get_pricing #from quantopian.pipeline.filters import Q1500US from quantopian.p quantopian_notebook_259.html
In [21]: import numpy as np import cvxopt as opt from cvxopt import blas, solvers import pandas as pd import matplotli quantopian_notebook_260.html
CHS Model (RISK OF FINANCIAL DISTRESS) quantopian_notebook_261.html
Testing different methods of EV/EBITDA quantopian_notebook_262.html
In [1]: # Get backtest object bt = get_backtest('5847c731c9cbc264e999216e') # Create all tear sheets bt.create_full_te quantopian_notebook_263.html
Alphalens Example Tear Sheet quantopian_notebook_264.html
Replication on Morningstar Financial Health Grade quantopian_notebook_265.html
Dynamic Efficient Asset Allocation Strategy quantopian_notebook_266.html
Dynamic Efficient Asset Allocation Strategy quantopian_notebook_267.html
In [1]: bt = get_backtest('58ac2a44d446705dfac76552') 100% Time: 0:00:04|######################################### quantopian_notebook_268.html
Engineered Momentum Strategy quantopian_notebook_269.html
In [3]: import pandas as pd import matplotlib.pyplot as plt def engineered_momentum(end, start, sp500, world_small, tr quantopian_notebook_270.html
In [4]: """ Rotate between S&P 500, mid-cap value, small cap international, emerging markets, and intermediate treasur quantopian_notebook_271.html
In [4]: """ Rotate between S&P 500, mid-cap value, small cap international, emerging markets, and intermediate treasur quantopian_notebook_272.html
Dataframe of patterns and outcomes: quantopian_notebook_273.html
In [9]: import talib import matplotlib.pyplot as pyplot import pandas as pd In [10]: # Get year-to-date closing p quantopian_notebook_274.html
Plotting quantopian_notebook_275.html
In [3]: # Step One: The Setup In [11]: """ This cell is going to create the basic framework of the algorithm """ quantopian_notebook_276.html
In [1]: bt = get_backtest('568dd8df0c1d760d2fa71dee') 100% Time: 0:00:12|######################################### quantopian_notebook_277.html
Import packages, data and modules In [77]: from quantopian.pipeline import Pipeline from quantopian.pipeline.data im quantopian_notebook_278.html
Performance Relative to Common Risk Factors quantopian_notebook_279.html
Performance Relative to Common Risk Factors quantopian_notebook_280.html
In [5]: bt = get_backtest('5967d9a6a1deeb5664209246') bt.create_full_tear_sheet() 100% Time: 0:00:01|############ quantopian_notebook_281.html
In [1]: import pandas as pd from pandas import Timedelta as td import numpy as np import scipy.stats as stats import m quantopian_notebook_282.html
.. 1) done quantopian_notebook_283.html
Machine Learning - Classifier comparison on close_price quantopian_notebook_284.html
Initial Screen quantopian_notebook_285.html
Dual Momentum quantopian_notebook_286.html
Predicting Volatility quantopian_notebook_287.html
Comparing Diversification Techniques to Hierarchical Risk Parity quantopian_notebook_288.html
In [30]: import pandas as pd import numpy as np import talib import matplotlib.pyplot as plt In [117]: dfPrices = quantopian_notebook_289.html
First Problem, the price doesn't match quantopian_notebook_290.html
Alpha research - Quality companies quantopian_notebook_291.html
Stochastics Foundations with Python quantopian_notebook_292.html
In [1]: # Thanh Duong 2018.02.07 # www.quantopian.com/posts/k-means-clustering-help # Nick Lupica 2018.02.07 # www.qua quantopian_notebook_293.html
Mean Reversion on Futures quantopian_notebook_294.html
Generalized Method of Moments with ARCH and GARCH Models quantopian_notebook_295.html
Exercises: Introduction to Pairs Trading - Answer Key quantopian_notebook_296.html
Exercises: Introduction to Pairs Trading - Answer Key quantopian_notebook_297.html
Common Risk Factor Performance quantopian_notebook_298.html
Ranking Universes by Factors quantopian_notebook_299.html
Kalman Filters quantopian_notebook_300.html
Enter your backtest ID. quantopian_notebook_301.html
Fundamental factor models quantopian_notebook_302.html
Hypothesis Testing quantopian_notebook_303.html
Factor Analysis quantopian_notebook_304.html
Multiple Linear Regression quantopian_notebook_305.html
Conclusion/How to Constrain Risk quantopian_notebook_306.html
Introduction to pandas quantopian_notebook_307.html
Factor Manipulation Using Numpy Arrays quantopian_notebook_308.html
In [13]: # import pipeline stuff from quantopian.pipeline import CustomFactor, Pipeline from quantopian.research impor quantopian_notebook_309.html
# Works but outputs do not correspond to my calculations of gaps. Figure out if the CustomFactor args are wrong # (e.g. quantopian_notebook_310.html
Pipeline Example Using Market Cap and Sentiment quantopian_notebook_311.html
Rolling mean with get_pricing example quantopian_notebook_312.html
Example returns factor quantopian_notebook_313.html
Getting Fundamentals Example quantopian_notebook_314.html
Run the cell below to create your tear sheet, or return to your algorithm. In [ ]: bt = get_backtest('5a2c4061605f5 quantopian_notebook_315.html
MaxHigh Custom Factor quantopian_notebook_316.html
CAGR Custom Factor quantopian_notebook_317.html
Price correlation vs return correlation quantopian_notebook_318.html
Rank of Last Close Price vs Previous Prices quantopian_notebook_319.html
Fundamental Check Example quantopian_notebook_320.html
Import packages, data and modules In [10]: from quantopian.pipeline import Pipeline from quantopian.pipeline.data i quantopian_notebook_321.html
Last EWMA Crossover Custom Factor quantopian_notebook_322.html
Get Industry Codes Using Pipeline quantopian_notebook_323.html
In [1]: from quantopian.pipeline import Pipeline, CustomFilter from quantopian.research import run_pipeline from quant quantopian_notebook_324.html
Plot XIV 'bars to fill'Â quantopian_notebook_325.html
get_pricing data example quantopian_notebook_326.html
N Days Ago Custom Factor quantopian_notebook_327.html
Output Universe quantopian_notebook_328.html
get_pricing for specific minutes example quantopian_notebook_329.html
get_pricing vs data.history methods quantopian_notebook_330.html
Run the cell below to create your tear sheet, or return to your algorithm. In [1]: bt = get_backtest('5a2c43c9cc0e3 quantopian_notebook_331.html
Getting Fundamentals Example quantopian_notebook_332.html
Getting Fundamentals Example quantopian_notebook_333.html
In [1]: from quantopian.research import run_pipeline from quantopian.pipeline import Pipeline from quantopian.pipeline quantopian_notebook_334.html
In [1]: # def initialize(context): from quantopian.pipeline import Pipeline from quantopian.pipeline.data.builtin impo quantopian_notebook_335.html
Fundamental Basic EPS Example quantopian_notebook_336.html
Fundamental sector example quantopian_notebook_337.html
Factor Tearsheet quantopian_notebook_338.html
Performance Relative to Common Risk Factors quantopian_notebook_339.html
Performance Relative to Common Risk Factors quantopian_notebook_340.html
In [1]: bt = get_backtest('57d171e81cf5bc102ae5cc7a') bt.create_full_tear_sheet() 100% Time: 0:00:18|############# quantopian_notebook_341.html
Searching for a signal in CEO change and news sentiment data quantopian_notebook_342.html
Alpha Library quantopian_notebook_343.html
The Q500US and Q1500US quantopian_notebook_344.html
TradeableUS Methodology quantopian_notebook_345.html
Q500US and Q1500US Market Cap Breakdown quantopian_notebook_346.html
FORECASTING STOCK RETURNS WITH BIG DATA AND MACHINE LEARNING quantopian_notebook_347.html
Constructing a Pipeline in Research quantopian_notebook_348.html
Run the cell below to create your tear sheet. In [ ]: bt = get_backtest('5b05ccc356f61742c42b04a8') bt.create_full_ quantopian_notebook_349.html
In [1]: from quantopian.pipeline import Pipeline from quantopian.pipeline.data.factset import Fundamentals, EquityMet quantopian_notebook_350.html
Portfolio Analysis using pyfolio quantopian_notebook_351.html
In [6]: # bt = get_backtest('').create_perf_attrib_tear_sheet() bt = get_backtest('').create_perf_attrib_tear_sheet() quantopian_notebook_352.html
Behavioral Arbitrage - Design Strategies That Time Market Mistakes quantopian_notebook_353.html
$Alpha_{5}$ : $(rank((open - (sum(vwap, 10) / 10))) * (-1 * abs(rank((close - vwap)))))$ quantopian_notebook_354.html
Performance Relative to Common Risk Factors quantopian_notebook_355.html
In [75]: import numpy as np import pandas as pd from quantopian.research import run_pipeline from quantopian.pipeline quantopian_notebook_356.html
In [1]: from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline from quantopian.pipeline quantopian_notebook_357.html
How much does it hurt, when it hurts to hurt? quantopian_notebook_358.html
In [3]: from quantopian.pipeline.data import Fundamentals from quantopian.pipeline.data import morningstar from quanto quantopian_notebook_359.html
plot_candles: Candlestick Charts for Quantopian quantopian_notebook_360.html
Factor Combination Theory and Tools quantopian_notebook_361.html
QTradeableStocksUS quantopian_notebook_362.html
101 Alphas #2 with Parameter Optimization quantopian_notebook_363.html
Volume Based Activity Bars Construction quantopian_notebook_364.html
This is my first notebook. My initial aims for this notebook is to import the last one years stock data for AAPL and pl quantopian_notebook_365.html
In [1]: from quantopian.research import run_pipeline from quantopian.pipeline import Pipeline from quantopian.pipeline quantopian_notebook_366.html
In [10]: import pandas as pd import numpy as np import alphalens from quantopian.research import run_pipeline, local_c quantopian_notebook_367.html
Bottom with Dynamic Exit quantopian_notebook_368.html
Building the Foundations for Hypothesis Testing quantopian_notebook_369.html
Quantpedia Trading Strategy Series: An Analysis on Cross-Sectional Mean Reversion Strategies quantopian_notebook_370.html
In [1]: bt = get_backtest('581246405459b5124126d07d') bt.create_full_tear_sheet() 100% Time: 0:00:14|############# quantopian_notebook_371.html
In [58]: stock = 'SPY' prices_daily = get_pricing( stock, # fields='close_price', start_date="2020-05-01", end_ quantopian_notebook_372.html
Example Alpha Factors with Cointegrated Pairs quantopian_notebook_373.html
Alphalens + Quantopian | How To quantopian_notebook_374.html
In [1]: from quantopian.pipeline.data import factset from quantopian.pipeline import Pipeline from quantopian.research quantopian_notebook_375.html
Main Project quantopian_notebook_376.html
Risk Management quantopian_notebook_377.html
In [1]: from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline from quantopian.pipeline quantopian_notebook_378.html
Alpha Vertex Precog 500 Alpha Testing quantopian_notebook_379.html
Using the Kalman Filter in Algorithmic Tradin quantopian_notebook_380.html
In [13]: from quantopian.pipeline.factors import CustomFactor from quantopian.pipeline.filters import StaticAssets fro quantopian_notebook_381.html
Psychsignal - StockTwits Trader Mood & Optimize API (Long/Short)Â quantopian_notebook_382.html
The Estimize Signal quantopian_notebook_383.html
Weekly security movement prediction using Machine Learning and Google Trends/Alternative Data quantopian_notebook_384.html
Market Regime detetection using Hidden Markov Model or Anomaly Detection (OneClassSVM) quantopian_notebook_385.html
Run the cell below to create your tear sheet, or return to your algorithm. In [1]: bt = get_backtest('59c2936403ac71 quantopian_notebook_386.html
Implementation quantopian_notebook_387.html
Applying Alpha Vertext Machine Learning to a Mean-Reversion Strategy quantopian_notebook_388.html
Strategy quantopian_notebook_389.html
In [3]: # Get backtest object bt = get_backtest('588e7fe79c134c5e1ad0369c') # Create all tear sheets bt.create_full_te quantopian_notebook_390.html
In [15]: # Import statements from quantopian.research import run_pipeline from quantopian.pipeline import CustomFactor quantopian_notebook_391.html
In [7]: from quantopian.pipeline import Pipeline from quantopian.pipeline.data import EquityPricing, factset from qu quantopian_notebook_392.html
BENCHMARK: MARKET PERFORMANCE quantopian_notebook_393.html
BENCHMARK: MARKET PERFORMANCE quantopian_notebook_394.html
In [6]: import pyfolio as pf import matplotlib.pyplot as plt plotAlgo, = plt.plot(pf.timeseries.cum_returns(get_backte quantopian_notebook_395.html
In [20]: from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline,symbols from quantopian quantopian_notebook_396.html
In [1]: from quantopian.pipeline import CustomFactor, Pipeline from quantopian.research import run_pipeline from quant quantopian_notebook_397.html
In [107]: # def initialize(context): from quantopian.pipeline import Pipeline from quantopian.pipeline.data.builtin im quantopian_notebook_398.html
Alpha Vertex Precog 500 Alpha Testing quantopian_notebook_399.html
Import all of the needed classes into code In [28]: from quantopian.research import run_pipeline, returns from quan quantopian_notebook_400.html
In [5]: import numpy, datetime from quantopian.research import run_pipeline from quantopian.pipeline import Pipeline, quantopian_notebook_401.html
Exercises: Introduction to Pairs Trading quantopian_notebook_402.html
Introduction to Pairs Trading quantopian_notebook_403.html
Run the cell below to create your tear sheet, or return to your algorithm. In [ ]: bt = get_backtest('5a0b95c9eedb1b quantopian_notebook_404.html
1. Quantopian and Alphalens Processing quantopian_notebook_405.html
1. Quantopian and Alphalens Processing quantopian_notebook_406.html
Run the cell below to create your tear sheet. In [1]: import numpy as np import matplotlib.pyplot as plt import pand quantopian_notebook_407.html
In [21]: from random import SystemRandom class RingBuffer: def __init__(self, size): self.data = [None for i in quantopian_notebook_408.html
Alphalens + Quantopian | How To quantopian_notebook_409.html
In [21]: from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline from quantopian.pipelin quantopian_notebook_410.html
In [1]: from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline from quantopian.pipeline quantopian_notebook_411.html
Exploring Market Trends: Seasonality quantopian_notebook_412.html
In [8]: import pandas as pd from zipline import TradingAlgorithm from zipline.api import order, sid import matplotlib. quantopian_notebook_413.html
Load backtests quantopian_notebook_414.html
Performance Relative to Common Risk Factors quantopian_notebook_415.html
Performance Relative to Common Risk Factors quantopian_notebook_416.html
Performance Relative to Common Risk Factors quantopian_notebook_417.html
An updated method to analyze alpha factors quantopian_notebook_418.html
Performance Relative to Common Risk Factors quantopian_notebook_419.html
Null Hypothesis: If short-term interest rates increase, then stock market returns will be unchanged or less volatile. quantopian_notebook_420.html
Performance Relative to Common Risk Factors quantopian_notebook_421.html
Performance Relative to Common Risk Factors quantopian_notebook_422.html
Performance Attribution quantopian_notebook_423.html
In [1]: import numpy as np import pandas as pd from quantopian.research import run_pipeline from quantopian.pipeline i quantopian_notebook_424.html
In [23]: from quantopian.pipeline.factors import AverageDollarVolume, RSI, SimpleMovingAverage, CustomFactor, Bollinge quantopian_notebook_425.html
Performance Relative to Common Risk Factors quantopian_notebook_426.html
Performance Relative to Common Risk Factors quantopian_notebook_427.html
In [1]: bt=get_backtest("59a46e3dee59a9510a4a6179") 100% Time: 0:00:00|########################################### quantopian_notebook_428.html
Linear Regression quantopian_notebook_429.html
Tackling overfitting via cross-validation over quarters quantopian_notebook_430.html
Performance Relative to Common Risk Factors quantopian_notebook_431.html
In [20]: from sklearn.preprocessing import MinMaxScaler import numpy as np import pandas as pd from quantopian.pipelin quantopian_notebook_432.html
Analyzing a Signal and Creating a Contest Algorithm with Self-Serve Data quantopian_notebook_433.html
In [64]: from quantopian.research import run_pipeline from quantopian.pipeline import Pipeline from quantopian.pipelin quantopian_notebook_434.html
Performance Relative to Common Risk Factors quantopian_notebook_435.html
In [63]: from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline from quantopian.pipelin quantopian_notebook_436.html
In [20]: import numpy as np from quantopian.pipeline import Pipeline from quantopian.pipeline import CustomFactor from quantopian_notebook_437.html
In [1]: from quantopian.pipeline.data import Fundamentals from quantopian.pipeline.data import morningstar from quanto quantopian_notebook_438.html
In [82]: from quantopian.pipeline import Pipeline from quantopian.pipeline.data.alpha_vertex import ( # Top 100 Secu quantopian_notebook_439.html
Factor Risk Exposure quantopian_notebook_440.html
An updated method to analyze alpha factors quantopian_notebook_441.html
In [6]: from quantopian.pipeline import Pipeline from quantopian.pipeline.data.factset.ownership import Form3Aggregate quantopian_notebook_442.html
In [6]: import quantopian.optimize as opt from quantopian.research import run_pipeline from quantopian.pipeline import quantopian_notebook_443.html
In [132]: from time import time from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline quantopian_notebook_444.html
Model Misspecification quantopian_notebook_445.html
Self-Serve Data - How does it work? quantopian_notebook_446.html
In [1]: from quantopian.interactive.data.quandl import fred_gdp as dataset from quantopian.interactive.data.quandl imp quantopian_notebook_447.html
Introduction to Self-Serve Data quantopian_notebook_448.html
EMA Weekly Calculations quantopian_notebook_449.html
In [9]: # Imports import numpy as np import pandas as pd import matplotlib.pyplot as plt from quantopian.pipeline impo quantopian_notebook_450.html
Comparing Diversification Techniques to Hierarchical Risk Parity quantopian_notebook_451.html
quantopian_notebook_452.html
In [2]: from quantopian.pipeline import Pipeline, CustomFactor from quantopian.research import run_pipeline from quant quantopian_notebook_453.html
In [5]: from quantopian.pipeline.data import Fundamentals from quantopian.pipeline import Pipeline from quantopian.res quantopian_notebook_454.html
Performance Relative to Common Risk Factors quantopian_notebook_455.html
In [2]: import pandas as pd import numpy as np import matplotlib.pyplot as plt from pykalman import KalmanFilter from quantopian_notebook_456.html
In [1]: from quantopian.pipeline import Pipeline from quantopian.pipeline.data import USEquityPricing from quantopian. quantopian_notebook_457.html
In [1]: from quantopian.pipeline import Pipeline from quantopian.pipeline.data import USEquityPricing from quantopian. quantopian_notebook_458.html
In [1]: from quantopian.pipeline import Pipeline from quantopian.pipeline.data import USEquityPricing from quantopian. quantopian_notebook_459.html
In [1]: from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline from quantopian.pipeline quantopian_notebook_460.html
In [ ]: from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline from quantopian.pipeline quantopian_notebook_461.html
In [1]: from quantopian.pipeline import Pipeline In [2]: from quantopian.pipeline.data.builtin import USEquityPri quantopian_notebook_462.html
Test Strategy quantopian_notebook_463.html
In [11]: from quantopian.pipeline import Pipeline, CustomFactor from quantopian.research import run_pipeline from quan quantopian_notebook_464.html
International Factor Research - Alphalens Example quantopian_notebook_465.html
In [1]: import pandas as pd import numpy as np from quantopian.pipeline import Pipeline, CustomFactor from quantopian. quantopian_notebook_466.html
Notebook to plot the price and drawdown of a particular stock quantopian_notebook_467.html
In [1]: from quantopian.research.experimental import continuous_future, history from quantopian.pipeline import Pipeli quantopian_notebook_468.html
In [43]: from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline from quantopian.pipelin quantopian_notebook_469.html
In [1]: from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline from quantopian.pipeline quantopian_notebook_470.html
1. Get Data from Data Upload quantopian_notebook_471.html
In [2]: import pandas as pd In [1]: bt = get_backtest('<your_backtest_id_here>') orders = bt.orders 100% Time: quantopian_notebook_472.html
Analyzing Alpha in 10-Ks and 10-Qs (Alphalens Study) quantopian_notebook_473.html
Scraping 10-Ks and 10-Qs for Alpha (Data Cleaning) quantopian_notebook_474.html
1. Easy-to-understand example quantopian_notebook_475.html
2. Similar idea, cleaner code quantopian_notebook_476.html
2: Financial Data Structures quantopian_notebook_477.html
2: Financial Data Structures quantopian_notebook_478.html
Labeling Data for Financial Machine Learning quantopian_notebook_479.html
In [7]: from quantopian.pipeline import Pipeline,CustomFactor from quantopian.research import run_pipeline from quanto quantopian_notebook_480.html
Exercise 2.1 quantopian_notebook_481.html
In [ ]: """ This is an algorithm.... copy past the code to a new algorithm to test it.... """ import quantopian.algori quantopian_notebook_482.html
In [ ]: # This is a simple trading algorithm that buy low sell high # Algorithm: # 1. Use 27 stock context # 2. For quantopian_notebook_483.html
In [8]: from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline from quantopian.pipeline quantopian_notebook_484.html
Performance Relative to Common Risk Factors quantopian_notebook_485.html
Performance Relative to Common Risk Factors quantopian_notebook_486.html
In [345]: import alphalens Z = W[:-1].copy() # W are the factors Z /= np.tile(np.sum(np.abs(Z), axis=1), (Z.shape[1], quantopian_notebook_487.html
In [2]: from quantopian.pipeline import Pipeline, CustomFactor from quantopian.pipeline.data import EquityPricing, fac quantopian_notebook_488.html
Smooth PCA quantopian_notebook_489.html
In [7]: from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline from quantopian.pipeline quantopian_notebook_490.html
Define Helper Functions quantopian_notebook_491.html
International Factor Research - Alphalens Example quantopian_notebook_492.html
International Factor Research - Alphalens Example quantopian_notebook_493.html
In [39]: import pandas as pd import numpy as np from quantopian.pipeline import Pipeline, CustomFactor from quantopian quantopian_notebook_494.html
Topics Course Homework 2 - Overnight Returns quantopian_notebook_495.html
In [1]: from quantopian.research import prices, symbols from quantopian.pipeline.filters import Q1500US import numpy a quantopian_notebook_496.html
Performance Relative to Common Risk Factors quantopian_notebook_497.html
In [1]: # Import Pipeline from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline # Impo quantopian_notebook_498.html
In [23]: # Imports the pipeline which will let us filter down our universe of potential stocks. from quantopian.pipeli quantopian_notebook_499.html
Get a list of symbols quantopian_notebook_500.html
In [1]: import numpy as np import pandas as pd import time from quantopian.pipeline import Pipeline import quantopian. quantopian_notebook_501.html
In [97]: import numpy as np import pandas as pd import time from quantopian.pipeline import Pipeline import quantopian quantopian_notebook_502.html
In [17]: from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline, volumes, prices from q quantopian_notebook_503.html
In [ ]: pip install arch In [ ]: pip install -U statsmodels In [ ]: pip install datapackage In [ ]: pip in quantopian_notebook_504.html
Lesson3-Pipeline API quantopian_notebook_505.html
"Infographics Challenge, Economic Implications of COVID-19" First submission notebook Lucas BL In [136]: import pand quantopian_notebook_506.html
In [66]: import numpy as np from matplotlib import pyplot as plt import pandas as pd In [67]: df = get_pricing(sym quantopian_notebook_507.html
In [1]: from quantopian.interactive.data.sentdex import sentiment In [2]: from quantopian.pipeline.filters.mornin quantopian_notebook_508.html
21 day returns of a given factor quantopian_notebook_509.html
Fundamentals exchange_id test quantopian_notebook_510.html
Notice that pipeline returns a multi-index dataframe. quantopian_notebook_511.html
Last close above SMA for n consecutive days quantopian_notebook_512.html
CloseOnN Custom Factor quantopian_notebook_513.html
Plotting quantopian_notebook_514.html
Lesson3-Pipeline API quantopian_notebook_515.html
Talib example quantopian_notebook_516.html
International Factor Research - Alphalens Example quantopian_notebook_517.html
Results for timestamp 1 - Min Max Scaled quantopian_notebook_518.html
Example of a custom factor using fundamental data quantopian_notebook_519.html
TTM Custom Factor Test quantopian_notebook_520.html
Recursive factors - Three ways to do EWMA quantopian_notebook_521.html
In [1]: from quantopian.pipeline.data import Fundamentals from quantopian.pipeline import Pipeline from quantopian.res quantopian_notebook_522.html
Those are the basics to plotting pandas dataframes. quantopian_notebook_523.html
Non-US Factor Example quantopian_notebook_524.html
Get a stock symbol from an asset quantopian_notebook_525.html
In [20]: # Import modules needed for pipeline from quantopian.research import run_pipeline from quantopian.pipeline im quantopian_notebook_526.html
Getting the linear regression terms including R Squared quantopian_notebook_527.html
Notebook to plot the price and drawdown of a particular stock quantopian_notebook_528.html
In [60]: import pandas as pd In [61]: hp = pd.DataFrame(data=[['1-1-2020', 1, 'one'], ['2-1-2020', 2, quantopian_notebook_529.html
Scoring based upon multiple conditions quantopian_notebook_530.html
Example Pipeline and Slicing by Dates quantopian_notebook_531.html
In [ ]: # Define a stock we want to look at along with some dates stock = 'AAPL' start_date = '1-1-2020' end_date = '1 quantopian_notebook_532.html
In [1]: from quantopian.pipeline.data import factset from quantopian.pipeline import Pipeline from quantopian.research quantopian_notebook_533.html
In [1]: # Import Pipeline from quantopian.pipeline import Pipeline from quantopian.research import run_pipeline # Impo quantopian_notebook_534.html
Performance Relative to Common Risk Factors quantopian_notebook_535.html
In this notebook, we make use of the peer_count Classifier method to identify Factset RBICS Focus subsectors with low a quantopian_notebook_536.html
ADX - Custom factor for pipeline (WIP) In [1]: from quantopian.pipeline import Pipeline from quantopian.pipeline.dat quantopian_notebook_537.html
In [4]: spy = get_pricing('spy', start_date='2019-01-02', end_date='2019-09-25', frequency='daily') iwm = get_pricing( quantopian_notebook_538.html
wti oil In [1]: from quantopian.research.experimental import history import pandas as pd import matplotlib.pyplot as quantopian_notebook_539.html
In [187]: import numpy as np import pandas as pd import statsmodels.api as sm from statsmodels import regression impor quantopian_notebook_540.html
In [ ]: import numpy as np from pandas.tseries.offsets import CustomBusinessDay from scipy.stats import mode def compu quantopian_notebook_541.html
Factor Analysis quantopian_notebook_542.html
In [3]: from quantopian.pipeline import Pipeline from quantopian.pipeline.data.morningstar import Fundamentals from qu quantopian_notebook_543.html
In [71]: #Custom factor for Sector PE from quantopian.pipeline import CustomFactor class SectorPE(CustomFactor): # D quantopian_notebook_544.html
In [67]: import numpy as np import pandas as pd import matplotlib.pyplot as plt from quantopian.research import prices quantopian_notebook_545.html
In [39]: import numpy as np import pandas as pd from quantopian.research import run_pipeline from quantopian.pipeline quantopian_notebook_546.html
In [1]: import numpy as np import matplotlib.pyplot as plt import pandas as pd from statsmodels.stats.stattools import quantopian_notebook_547.html
In [2]: import pandas as pd import numpy as np # Pipeline imports from quantopian.pipeline import CustomFactor, Custom quantopian_notebook_548.html
In [1]: import pandas as pd import numpy as np # Pipeline imports from quantopian.pipeline import CustomFactor, Custom quantopian_notebook_549.html
Define Helper Functions quantopian_notebook_550.html
Fundamentals quantopian_notebook_551.html
Sentiment trading strategy quantopian_notebook_552.html
In [15]: from quantopian.pipeline import CustomFactor from quantopian.pipeline import Pipeline from quantopian.pipelin quantopian_notebook_553.html
In [10]: #Important Python Modules import numpy as np import pandas as pd from scipy import stats # Pipeline essentia quantopian_notebook_554.html
Creating Tear Sheets With Alphalens quantopian_notebook_555.html
In [9]: # Research environment pipeline imports from quantopian.pipeline import Pipeline from quantopian.research impo quantopian_notebook_556.html
In [1]: from quantopian.interactive.data.sentdex import sentiment In [2]: from quantopian.pipeline.filters.morning quantopian_notebook_557.html
In [9]: from quantopian.pipeline import Pipeline from quantopian.pipeline.data import EquityPricing, factset from qu quantopian_notebook_558.html
In [1]: from quantopian.pipeline.factors import Returns from quantopian.pipeline import Pipeline, CustomFactor from qu quantopian_notebook_559.html
In [ ]: # From: https://www.quantopian.com/posts/long-only-non-day-trading-algorithm-for-live # PYLIVETRADER # from qu quantopian_notebook_560.html
In [3]: from quantopian.pipeline import Pipeline In [4]: from quantopian.research import run_pipeline In [5]: quantopian_notebook_561.html