├── .gitignore ├── 00 Home └── 01 Home │ └── 01 Home.html ├── 01 API Tutorials ├── 00 Introduction │ └── 00 Introduction.html ├── 01 Consolidating Data to Build Bars │ └── 01 Consolidating Data to Build Bars.html ├── 02 Scheduled Events │ └── 02 Scheduled Events.html ├── 03 Tracking and Managing Orders │ ├── 01 Overview.html │ ├── 02 Updating Orders.html │ └── 03 Full Python Example.html └── 04 Using Options in QuantConnect │ ├── 01 Introduction.html │ ├── 02 Add Options.html │ ├── 03 Filter Contracts.html │ ├── 04 Select Contracts.html │ ├── 05 Algorithm.html │ └── 06 Summary.html ├── 02 Tutorial Series ├── 00 Introduction │ └── Introduction.html ├── 01 Introduction to Financial Python │ ├── 00 About.html │ ├── 01 What Will I learn %3F.html │ └── 02 Tutorials.html ├── 02 Introduction to Options │ ├── 00 About.html │ ├── 01 What Will I learn %3F.html │ └── 02 Tutorials.html └── 03 Applied Options │ ├── 00 About.html │ ├── 01 What Will I learn %3F.html │ └── 02 Tutorials.html ├── 03 Open Source ├── 00 Introduction │ └── Introduction.html ├── 01 Debugging Python │ ├── 00.html │ ├── 01 Introduction.html │ ├── 02 Installing LEAN with Python.html │ ├── 03 Method 1 - PTVSD.html │ ├── 04 Method 2 - PDB.html │ ├── 05 Method 3 - VisualStudio Debugger.html │ ├── 06 Limitations.html │ └── 07 Summary.html ├── 03 Using the API File Provider │ └── 02 How do I use the API File Provider.html ├── 04 Lean Report Creator │ ├── 00.html │ ├── 01 Introduction.html │ ├── 02 Creating a Report.html │ ├── 03 Source Backtest.html │ ├── 04 Customizing Report Contents.html │ └── 05 Interpreting Report Charts.html ├── 05 Brokerage Development Guide │ ├── 00.html │ ├── 01 Introduction.html │ ├── 02 Guide Contents.html │ ├── 03 Step 1%3A Laying a Foundation.html │ ├── 04 Step 2%3A Creating the Brokerage.html │ ├── 05 Step 3%3A Translating Symbol Conventions.html │ ├── 06 Step 4%3A Describe Brokerage Limitations.html │ ├── 07 Step 5%3A Enable Live Data Streaming.html │ ├── 08 Step 6%3A Enable Serving Historical Data.html │ ├── 09 Step 7%3A Downloading Data.html │ ├── 10 Step 8%3A Brokerage Fee Structures.html │ └── 11 Step 9%3A Updating Algorithm API.html └── 06 Generating Random Backtest Data │ ├── 00.html │ ├── 01 Introduction.html │ ├── 02 Using the Random Data Generator.html │ ├── 03 Command Parameters.html │ ├── 04 Supported Assets and Resolutions.html │ └── 05 Final Notes.html ├── 04 Strategy Library ├── 00 Strategy Library │ └── 01 Strategy Library.php ├── 01 CAPM Alpha Ranking Strategy on Dow 30 Companies │ ├── 01 Introduction.html │ ├── 01 简介.cn.html │ ├── 02 CAPM Theory.html │ ├── 02 资本资产定价模型(CAPM)理论.cn.html │ ├── 03 Method.html │ ├── 03 方法.cn.html │ ├── 04 Summary.html │ ├── 04 总结.cn.html │ ├── 05 Algorithm.html │ ├── 05 算法.cn.html │ ├── 06 References.html │ └── 06 参考文献.cn.html ├── 02 Combining Mean Reversion and Momentum in Forex Market │ ├── 01 Abstract.html │ ├── 02 Introduction.html │ ├── 03 Method.html │ ├── 04 Results.html │ ├── 05 Summary.html │ ├── 06 Algorithm.html │ └── 07 References.html ├── 03 Pairs Trading-Copula vs Cointegration │ ├── 01 Abstract.html │ ├── 01 摘要.cn.html │ ├── 02 Framework of Copula.html │ ├── 02 联系框架.cn.html │ ├── 03 Part I - Copula Method.html │ ├── 03 第I部分 – 联系法.cn.html │ ├── 04 Part II - Cointegration Method.html │ ├── 04 第II部分 – 协整法.cn.html │ ├── 05 Summary.html │ ├── 05 总结.cn.html │ ├── 06 Algorithm.html │ ├── 06 算法.cn.html │ ├── 07 References.html │ └── 07 参考文献.cn.html ├── 04 The Dynamic Breakout II Strategy │ ├── 01 Abstract.html │ ├── 02 Method.html │ ├── 03 Conclusion.html │ ├── 04 Algorithm.html │ └── 05 References.html ├── 05 Dual Thrust Trading Algorithm │ ├── 01 Abstract.html │ ├── 02 Method.html │ ├── 03 Conclusion.html │ ├── 04 Algorithm.html │ └── 05 References.html ├── 06 Can Crude Oil Predict Equity Returns │ ├── 01 Abstract.html │ ├── 02 Background.html │ ├── 03 Method.html │ ├── 04 Summary.html │ ├── 05 Algorithm.html │ └── 06 References.html ├── 07 Intraday Dynamic Pairs Trading using Correlation and Cointegration Approach │ ├── 01 Abstract.html │ ├── 01 摘要.cn.html │ ├── 02 Introduction.html │ ├── 02 简介.cn.html │ ├── 03 Method.html │ ├── 03 方法.cn.html │ ├── 04 Result.html │ ├── 04 结果.cn.html │ ├── 05 Summary.html │ ├── 05 总结.cn.html │ ├── 06 Algorithm.html │ ├── 06 算法.cn.html │ ├── 07 References.html │ └── 07 参考文献.cn.html ├── 08 The Momentum Strategy Based on the Low Frequency Component of Forex Market │ ├── 01 Abstract.html │ ├── 02 Introduction.html │ ├── 03 Method.html │ ├── 04 Summary.html │ ├── 05 Algorithm.html │ └── 06 References.html ├── 09 Stock Selection Strategy Based on Fundamental Factors │ ├── 01 Abstract.html │ ├── 01 摘要.cn.html │ ├── 02 Factor Selection.html │ ├── 02 要素选择.cn.html │ ├── 03 Stock Selection.html │ ├── 03 股票选择.cn.html │ ├── 04 Algorithm.html │ ├── 04 算法.cn.html │ ├── 05 References.html │ └── 05 参考文献.cn.html ├── 10 Short-Term Reversal Strategy in Stocks │ ├── 01 Abstract.html │ ├── 02 Method.html │ ├── 04 Algorithm.html │ ├── 05 Relative Performance.html │ ├── 07 Market & Competition Qualification.html │ ├── 08 Conclusion.html │ └── 09 References.html ├── 100 Trading with WTI BRENT Spread │ ├── 01 Introduction.html │ ├── 01 简介.cn.html │ ├── 02 Method.html │ ├── 02 方法.cn.html │ ├── 03 Algorithm.html │ ├── 03 算法.cn.html │ ├── 04 Source.html │ └── 04 来源.cn.html ├── 102 Option Expiration Week Effect │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 1023 Intraday Arbitrage Between Index ETFs │ ├── 01 Abstract.html │ ├── 02 Background.html │ ├── 03 Method.html │ ├── 04 Algorithm.html │ ├── 05 Relative Performance.html │ ├── 06 Market & Competition Qualification.html │ ├── 07 Conclusion.html │ └── 08 References.html ├── 1024 Forecasting Stock Prices using a Temporal CNN Model │ ├── 01 Abstract.html │ ├── 02 Introduction.html │ ├── 03 Method.html │ ├── 04 Algorithm.html │ ├── 05 Results.html │ └── 06 References.html ├── 1025 Leveraged ETFs with Systematic Risk Management │ ├── 01 Abstract.html │ ├── 02 Introduction.html │ ├── 03 Method.html │ ├── 04 Algorithm.html │ ├── 05 Results.html │ └── 06 References.html ├── 1026 Intraday ETF Momentum │ ├── 01 Abstract.html │ ├── 02 Background.html │ ├── 03 Method.html │ ├── 04 Algorithm.html │ ├── 05 Conclusion.html │ └── 06 References.html ├── 1027 Using News Sentiment to Predict Price Direction of Drug Manufacturers │ ├── 01 Abstract.html │ ├── 02 Background.html │ ├── 03 Method.html │ ├── 04 Algorithm.html │ ├── 05 Conclusion.html │ └── 06 References.html ├── 1028 Ichimoku Clouds in the Energy Sector │ ├── 01 Abstract.html │ ├── 02 Introduction.html │ ├── 03 Method.html │ ├── 04 Algorithm.html │ ├── 05 Relative Performance.html │ ├── 06 Market & Competition Qualification.html │ ├── 07 Conclusion.html │ └── 08 References.html ├── 1029 Optimal Pairs Trading │ ├── 01 Abstract.html │ ├── 02 Introduction.html │ ├── 03 Method.html │ ├── 04 Algorithm.html │ ├── 05 Video Walkthrough.html │ ├── 06 Results.html │ └── 07 References.html ├── 1030 G-Score Investing │ ├── 01 Abstract.html │ ├── 02 Introduction.html │ ├── 03 Method.html │ ├── 04 Algorithm.html │ ├── 05 Results.html │ └── 06 References.html ├── 1031 SVM Wavelet Forecasting │ ├── 01 Abstract.html │ ├── 02 Introduction.html │ ├── 03 Method.html │ ├── 04 Algorithm.html │ ├── 05 Results.html │ └── 06 References.html ├── 1033 Gradient Boosting Model │ ├── 01 Abstract.html │ ├── 02 Background.html │ ├── 03 Method.html │ ├── 04 Algorithm.html │ ├── 05 Relative Performance.html │ ├── 06 Market & Competition Qualification.html │ ├── 07 Conclusion.html │ └── 08 References.html ├── 1036 Gaussian Naive Bayes Model │ ├── 01 Abstract.html │ ├── 02 Background.html │ ├── 03 Video Walkthrough.html │ ├── 04 Method.html │ ├── 05 Algorithm.html │ ├── 06 Relative Performance.html │ ├── 07 Market & Competition Qualification.html │ ├── 08 Conclusion.html │ └── 09 References.html ├── 11 Fundamental Factor Long Short Strategy │ ├── 01 Introduction.html │ ├── 02 Implementation.html │ ├── 03 Summary.html │ ├── 04 Algorithm.html │ └── 05 References.html ├── 113 January Barometer │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 114 January Effect in Stocks │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 118 Time Series Momentum Effect │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 12 Asset Class Trend Following │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 125 12 Month Cycle in Cross-Section of Stocks Returns │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 13 Asset Class Momentum │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 136 Residual Momentum │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 References.html ├── 14 Sector Momentum │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 15 Short Term Reversal │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 152 Momentum Effect in REITs │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 155 Momentum and Reversal Combined with Volatility Effect in Stocks │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 16 Overnight Anomaly │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 162 Momentum Effect in Stocks in Small Portfolios │ ├── 01 Introduction.html │ ├── 01 简介.cn.html │ ├── 02 Method.html │ ├── 02 方法.cn.html │ ├── 03 Algorithm.html │ ├── 03 算法.cn.html │ ├── 04 Source.html │ └── 04 来源.cn.html ├── 17 Forex Momentum │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 18 Volatility Effect in Stocks │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 19 Pairs Trading with Stocks │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 198 Exploiting Term Structure of VIX Futures │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 199 ROA Effect within Stocks │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 20 Forex Carry Trade │ ├── 01 Introduction.html │ ├── 01 简介.cn.html │ ├── 02 Method.html │ ├── 02 方法.cn.html │ ├── 03 Algorithm.html │ ├── 03 算法.cn.html │ ├── 04 Source.html │ └── 04 来源.cn.html ├── 207 Value Effect within Countries │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 21 Momentum Effect in Stocks │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 211 Mean-Reversion Statistical Arbitrage Strategy in Stocks │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Results.html │ ├── 04 Algorithm.html │ └── 05 Reference.html ├── 22 Momentum Effect in Country Equity Indexes │ ├── 01 Introduction.html │ ├── 01 简介.cn.html │ ├── 02 Method.html │ ├── 02 方法.cn.html │ ├── 03 Conclusion.html │ ├── 03 结论.cn.html │ ├── 04 Algorithm.html │ ├── 04 算法.cn.html │ ├── 05 Source.html │ └── 05 来源.cn.html ├── 229 Earnings Quality Factor │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 23 Mean Reversion Effect in Country Equity Indexes │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 24 Liquidity Effect in Stocks │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 25 Volatility Risk Premium Effect │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 26 Quantpedia │ └── 02 Quantpedia.php ├── 269 Seasonality Effect based on Same-Calendar Month Returns │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Results.html │ ├── 04 Algorithm.html │ └── 05 Reference.html ├── 27 Momentum Effect in Commodities Futures │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 270 Risk Premia in Forex Markets │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Results.html │ ├── 04 Algorithm.html │ └── 05 Reference.html ├── 271 Price and Earning Momentum │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Results.html │ ├── 04 Algorithm.html │ └── 05 Reference.html ├── 28 Small Capitalization Stocks Premium Anomaly │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 29 Term Structure Effect in Commodities │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ ├── 04 References.html │ └── 05 Source.html ├── 30 Momentum Effect Combined with Term Structure in Commodities │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 31 Book-to-Market Value Anomaly │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ ├── 04 Summary.html │ └── 05 Source.html ├── 32 Gold Market Timing │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 33 Paired Switching │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 34 Momentum-Short Term Reversal Strategy │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 35 Turn of the Month in Equity Indexes │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 353 Fama French Five Factors │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Results.html │ ├── 04 Algorithm.html │ └── 05 References.html ├── 354 Expected Idiosyncratic Skewness │ ├── 01 Abstract.html │ ├── 02 Theory.html │ ├── 03 Data Description.html │ ├── 04 Method.html │ ├── 05 Conclusion and Future Work.html │ ├── 06 Algorithm.html │ ├── 07 References.html │ └── F-F_Research_Data_Factors_daily.CSV ├── 355 Standardized Unexpected Earnings │ ├── 01 Abstract.html │ ├── 02 Theory.html │ ├── 03 Method.html │ ├── 04 Conclusion and Future Work.html │ ├── 05 Algorithm.html │ └── 06 References.html ├── 356 Improved Momentum Strategy on Commodities Futures │ ├── 01 Abstract.html │ ├── 02 Introduction.html │ ├── 03 TSMOM-CF Theory.html │ ├── 04 Method.html │ ├── 05 Summary.html │ ├── 06 Algorithm.html │ └── 07 References.html ├── 357 Commodities Futures Trend Following │ ├── 01 Abstract.html │ ├── 02 Introduction.html │ ├── 03 Method.html │ ├── 04 Summary.html │ ├── 05 Algorithm.html │ └── 06 References.html ├── 36 Sentiment and Style Rotation Effect in Stocks │ ├── 01 Introduction.html │ ├── 01 简介.cn.html │ ├── 02 Method.html │ ├── 02 方法.cn.html │ ├── 03 Algorithm.html │ ├── 03 算法.cn.html │ ├── 04 Source.html │ └── 04 来源.cn.html ├── 37 Momentum and State of Market Filters │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 38 Accrual Anomaly │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 39 Asset Growth Effect │ ├── 01 Introduction.html │ ├── 01 简介.cn.html │ ├── 02 Method.html │ ├── 02 方法.cn.html │ ├── 03 Algorithm.html │ ├── 03 算法.cn.html │ ├── 04 Source.html │ └── 04 来源.cn.html ├── 40 Pairs Trading with Country ETFs │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 58 VIX Predicts Stock Index Returns │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 61 Lunar Cycle in Equity Market │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 66 Combining Momentum Effect with Volume │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 71 Short Term Reversal with Futures │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 77 Beta Factors in Stocks │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 78 Beta Factor in Country Equity Indexes │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 83 Pre-Holiday Effect │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html ├── 85 Momentum in Mutual Fund Returns │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ ├── 04 Relative Performance.html │ ├── 05 Market & Competition Qualification.html │ ├── 06 Conclusion.html │ └── 07 References.html ├── 91 Momentum and Style Rotation Effect │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ └── 04 Source.html └── 92 Price Earnings Anomaly │ ├── 01 Introduction.html │ ├── 02 Method.html │ ├── 03 Algorithm.html │ ├── 04 Summary.html │ └── 05 References.html ├── 05 Introduction to Financial Python[] ├── 01 Data Types and Data Structures │ ├── 01 Data Types and Data Structures.ipynb │ ├── 01 Introduction.html │ ├── 02 Basic Variable Types.html │ ├── 03 Basic Math Operations.html │ ├── 04 Data Collections.html │ ├── 05 Common String Operations.html │ └── 06 Summary.html ├── 02 Logical Operations and Loops │ ├── 01 Introduction.html │ ├── 02 Logical Operations and Loops.ipynb │ ├── 02 Logical Operations.html │ ├── 03 If Statement.html │ ├── 04 Loop Structure.html │ ├── 05 List Comprehension.html │ └── 06 Summary.html ├── 03 Functions and Objective-Oriented Programming │ ├── 01 Introduction.html │ ├── 02 Functions.html │ ├── 03 Built-in Function.html │ ├── 03 Functions and Objective-Oriented Programming.ipynb │ ├── 04 Object-Oriented Programming.html │ └── 05 Summary.html ├── 04 NumPy and Basic Pandas │ ├── 01 Introduction.html │ ├── 02 NumPy.html │ ├── 03 Pandas.html │ ├── 04 NumPy and Basic Pandas.ipynb │ └── 04 Summary.html ├── 05 Pandas-Resampling and DataFrame │ ├── 01 Introduction.html │ ├── 02 Fetching Data.html │ ├── 03 Resampling.html │ ├── 04 DataFrame.html │ ├── 05 Pandas-Resampling and DataFrame.ipynb │ └── 05 Summary.html ├── 06 Rate of Return, Mean and Variance │ ├── 01 Introduction.html │ ├── 02 Rate of Return.html │ ├── 03 Mean.html │ ├── 04 Variance and Standard Deviation.html │ ├── 05 Summary.html │ └── 06 Rate of Return, Mean and Variance.ipynb ├── 07 Random Variables and Distributions │ ├── 01 Introduction.html │ ├── 02 Random Variables.html │ ├── 03 Distributions.html │ ├── 04 Normal Distribution.html │ ├── 05 Summary.html │ └── 07 Random Variable and Distributions.ipynb ├── 08 Confidence Interval and Hypothesis Testing │ ├── 01 Introduction.html │ ├── 02 Confidence Interval.html │ ├── 03 Hypothesis testing.html │ ├── 04 Summary.html │ └── 08 Confidence Interval and Hypothesis Testing.ipynb ├── 09 Simple Linear Regression │ ├── 01 Introduction.html │ ├── 02 Slope and Intercept.html │ ├── 03 Python Implementation.html │ ├── 04 Parameter Significance.html │ ├── 05 Model Significance.html │ ├── 06 Summary.html │ └── 09 Simple Linear Regression.ipynb ├── 10 Multiple Linear Regression │ ├── 01 Introduction.html │ ├── 02 Python Implementation.html │ ├── 03 Model Significance Test.html │ ├── 04 Residual Analysis.html │ ├── 05 Summary.html │ ├── 06 References.html │ └── 10 Multiple Linear Regression.ipynb ├── 11 Linear Algebra │ ├── 01 Introduction.html │ ├── 02 Vectors.html │ ├── 03 Matrices.html │ ├── 04 Matrix Multiplication.html │ ├── 05 Inverse.html │ ├── 06 Linear Equations.html │ ├── 07 Summary.html │ └── 11 Linear Algebra.ipynb ├── 12 Modern Portfolio Theory │ ├── 01 Introduction.html │ ├── 02 Risk Aversion.html │ ├── 03 Portfolio.html │ ├── 04 Mean-Variance Analysis.html │ ├── 05 Summary.html │ ├── 06 Algorithm.html │ └── 12 Modern Portfolio Theory.ipynb ├── 13 Market Risk │ ├── 01 Introduction.html │ ├── 02 Capital Asset Pricing Model.html │ ├── 03 Computing beta in Practice.html │ ├── 04 Market-Neutral.html │ ├── 05 Summary.html │ ├── 06 Algorithm.html │ └── 13 Market Risk.ipynb └── 14 Fama-French Multi-Factor Models │ ├── 01 Introduction.html │ ├── 02 Fama-French Three-Factor Model.html │ ├── 03 Model Test.html │ ├── 04 Factor Returns.html │ ├── 05 Summary.html │ ├── 06 Algorithm.html │ ├── 07 References.html │ └── 14 Fama-French Multi-Factor Models.ipynb ├── 06 Introduction to Options[] ├── 01 General Features of Options │ ├── 01 Introduction.html │ ├── 02 Definition.html │ ├── 03 Options Contract.html │ ├── 04 The Value of Options.html │ ├── 05 Options Moneyness.html │ ├── 06 Exercise and Assignment.html │ └── 07 Summary.html ├── 02 QuantConnect Options API │ ├── 01 Introduction.html │ ├── 02 Add Options.html │ ├── 03 Filter Contracts.html │ ├── 04 Select Contracts.html │ ├── 05 Algorithm.html │ └── 06 Summary.html ├── 03 Put-Call Parity and Arbitrage Strategies │ ├── 01 Introduction.html │ ├── 02 Option Payoff.html │ ├── 02 Put-Call Parity and Arbitrage Strategies.ipynb │ ├── 03 Put-Call Parity.html │ ├── 04 Synthetic Positions.html │ ├── 05 Algorithm.html │ ├── 06 Summary.html │ └── 07 References.html ├── 04 Stochastic Processes and Monte Carlo Method │ ├── 01 Introduction.html │ ├── 02 Brownian motion.html │ ├── 03 Modeling Stock Price as a Stochastic Process.html │ ├── 04 Monte Carlo Simulation of Stock Price.html │ ├── 04 Stochastic Processes and Monte Carlo Method.ipynb │ ├── 05 Monte Carlo Simulation of European Options.html │ ├── 06 Summary.html │ └── 07 References.html ├── 05 Options Pricing Black Scholes Merton Model │ ├── 01 Introduction.html │ ├── 02 Determinants of Option Price.html │ ├── 03 Factors in BSM model.html │ ├── 04 Model Assumptions.html │ ├── 05 Model Equations.html │ ├── 05 Option Pricing Black Scholes Merton Model.ipynb │ └── 06 Summary.html ├── 06 The Greek Letters │ ├── 01 Introduction.html │ ├── 02 Delta.html │ ├── 03 gamma.html │ ├── 04 vega.html │ ├── 05 Theta.html │ ├── 06 Rho.html │ ├── 06 The Greek Letters.ipynb │ ├── 07 Delta, Gamma and Vega Hedging.html │ └── 08 Summary.html ├── 07 Historical Volatility and Implied Volatility │ ├── 01 Introduction.html │ ├── 02 Historical Volatility.html │ ├── 03 Implied Volatility.html │ ├── 04 Volatility Skew.html │ ├── 05 Volatility Surface.html │ ├── 06 The Reason for Volatility Skew.html │ ├── 07 Historical Volatility and Implied Volatility.ipynb │ ├── 07 Summary.html │ └── 08 References.html └── 08 Local Volatility and Stochastic Volatility │ ├── 01 Introduction.html │ ├── 02 Motivation.html │ ├── 03 Local Volatility.html │ ├── 04 Stochastic Volatility.html │ ├── 05 Summary.html │ ├── 06 References.html │ └── 08 Local Volatility and Stochastic Volatility.ipynb ├── 07 Applied Options[] ├── 01 Covered Call │ ├── 01 Definition.html │ ├── 02 Implementation.html │ ├── 03 Summary.html │ └── 04 Algorithm.html ├── 02 Bull Call Spread │ ├── 01 Definition.html │ ├── 02 Implementation.html │ ├── 03 Summary.html │ └── 04 Algorithm.html ├── 03 Long Straddle │ ├── 01 Definition.html │ ├── 02 Implementation.html │ ├── 03 Summary.html │ └── 04 Algorithm.html ├── 04 Long Strangle │ ├── 01 Definition.html │ ├── 02 Implementation.html │ ├── 03 Summary.html │ └── 04 Algorithm.html ├── 05 Butterfly Spread │ ├── 01 Definition.html │ ├── 02 Implementation.html │ ├── 03 Summary.html │ └── 04 Algorithm.html ├── 06 Iron Condor │ ├── 01 Definition.html │ ├── 02 Implementation.html │ ├── 03 Summary.html │ └── 04 Algorithm.html ├── 07 Iron Butterfly │ ├── 01 Definition.html │ ├── 02 Implementation.html │ ├── 03 Summary.html │ └── 04 Algorithm.html └── 08 Protective Collar │ ├── 01 Definition.html │ ├── 02 Implementation.html │ ├── 03 Summary.html │ └── 04 Algorithm.html ├── 08 Meta └── 01 Creating BootCamp Tutorials │ ├── 00.html │ ├── 01 Introduction.html │ ├── 02 Requirements.html │ ├── 03 Compensation.html │ ├── 04 Content Structure.html │ ├── 05 Planning Your Lesson.html │ ├── 06 Writing a Lesson.html │ ├── 07 Building Code Validators.html │ ├── 08 Style Guide.html │ ├── 09 Submitting Lesson for Review.html │ └── 10 Summary.html ├── Data ├── F-F_Research_Data_5_Factors_2x3.CSV ├── F-F_Research_Data_5_Factors_2x3_daily.CSV ├── F-F_Research_Data_Factors.CSV ├── F-F_Research_Data_Factors_daily.CSV └── F-F_Research_Data_Factors_weekly.CSV ├── LICENSE ├── README.md └── quantpedia.json /.gitignore: -------------------------------------------------------------------------------- 1 | */.ipynb_checkpoints/* 2 | .idea/ 3 | -------------------------------------------------------------------------------- /01 API Tutorials/04 Using Options in QuantConnect/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | QuantConnect provides US options trade and quotes price data for approximately 4000 symbols, each of which has roughly 10 strikes on average. Data is available starting January 1st, 2008. In this tutorial, we will discuss how to use QuantConnect to start your options trading algorithm. 3 |

4 | -------------------------------------------------------------------------------- /01 API Tutorials/04 Using Options in QuantConnect/05 Algorithm.html: -------------------------------------------------------------------------------- 1 |

2 | This simple example demonstrates how you can inspect the option chain to pick a specific option contract to trade. 3 |

4 |
5 |
6 |
7 |
8 | 9 |
10 |
11 | -------------------------------------------------------------------------------- /01 API Tutorials/04 Using Options in QuantConnect/06 Summary.html: -------------------------------------------------------------------------------- 1 |

2 | After mastering the basic knowledge of options market, this tutorial we take a close at how to use Quantconnect to customize your own options trading. For example, how you can access an option chain, how to view the details of the contract as a Python data frame, and the most important how to trade the specific option contract. 3 |

4 | -------------------------------------------------------------------------------- /02 Tutorial Series/01 Introduction to Financial Python/01 What Will I learn %3F.html: -------------------------------------------------------------------------------- 1 |
2 |
Python
3 |
Statistics
4 |
Linear Algebra
5 |
Modern Portfolio Theory
6 |
Multi-factor Models
7 |
8 | -------------------------------------------------------------------------------- /02 Tutorial Series/03 Applied Options/01 What Will I learn %3F.html: -------------------------------------------------------------------------------- 1 |
2 |
Common Options Strategies
3 |
Using Options API
4 |
Payoff Analysis
5 |
Risk Profile of Options Trading
6 |
-------------------------------------------------------------------------------- /03 Open Source/01 Debugging Python/00.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03 Open Source/01 Debugging Python/01 Introduction.html: -------------------------------------------------------------------------------- 1 | 4 | 5 |

6 | In this tutorial, for those algorithm developers who opt to work offline, we will explore the different methods to debug a python algorithm. 7 |

-------------------------------------------------------------------------------- /03 Open Source/01 Debugging Python/06 Limitations.html: -------------------------------------------------------------------------------- 1 |

Unfortunately, this debugging scenario entails some limitations.

2 |

It is not possible to concurrently debug the python algorithm and Lean (C# code). That means that the debugger will not stop at breakpoints in Lean nor we can step into methods defined in Lean (e.g., SetHoldings).

3 |

Method 1 ptvsd will always stop after ptvsd.break_into_debugger() call and it not possible to untoggled it. However, we can use conditional statements to prevent its call and avoid unnecessary breaks. In order to resume the algorithm execution without breakpoints, we need to detach the process (Debug -> Detach All).

4 | -------------------------------------------------------------------------------- /03 Open Source/01 Debugging Python/07 Summary.html: -------------------------------------------------------------------------------- 1 |

2 | In this tutorial, we have learned how to debug python algorithms in Visual Studio. It is not quite as smooth as native python yet, but knowing how to debug python algorithms in LEAN can give you a new level of understanding of how they work and allow for easier debugging of your strategy. 3 |

4 | -------------------------------------------------------------------------------- /03 Open Source/04 Lean Report Creator/00.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03 Open Source/05 Brokerage Development Guide/05 Step 3%3A Translating Symbol Conventions.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuantConnect/Tutorials/67580984b715b02d829840831b8bc487f29c7213/03 Open Source/05 Brokerage Development Guide/05 Step 3%3A Translating Symbol Conventions.html -------------------------------------------------------------------------------- /03 Open Source/05 Brokerage Development Guide/06 Step 4%3A Describe Brokerage Limitations.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuantConnect/Tutorials/67580984b715b02d829840831b8bc487f29c7213/03 Open Source/05 Brokerage Development Guide/06 Step 4%3A Describe Brokerage Limitations.html -------------------------------------------------------------------------------- /03 Open Source/05 Brokerage Development Guide/07 Step 5%3A Enable Live Data Streaming.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuantConnect/Tutorials/67580984b715b02d829840831b8bc487f29c7213/03 Open Source/05 Brokerage Development Guide/07 Step 5%3A Enable Live Data Streaming.html -------------------------------------------------------------------------------- /03 Open Source/05 Brokerage Development Guide/08 Step 6%3A Enable Serving Historical Data.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuantConnect/Tutorials/67580984b715b02d829840831b8bc487f29c7213/03 Open Source/05 Brokerage Development Guide/08 Step 6%3A Enable Serving Historical Data.html -------------------------------------------------------------------------------- /03 Open Source/05 Brokerage Development Guide/09 Step 7%3A Downloading Data.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuantConnect/Tutorials/67580984b715b02d829840831b8bc487f29c7213/03 Open Source/05 Brokerage Development Guide/09 Step 7%3A Downloading Data.html -------------------------------------------------------------------------------- /03 Open Source/05 Brokerage Development Guide/10 Step 8%3A Brokerage Fee Structures.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuantConnect/Tutorials/67580984b715b02d829840831b8bc487f29c7213/03 Open Source/05 Brokerage Development Guide/10 Step 8%3A Brokerage Fee Structures.html -------------------------------------------------------------------------------- /03 Open Source/05 Brokerage Development Guide/11 Step 9%3A Updating Algorithm API.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuantConnect/Tutorials/67580984b715b02d829840831b8bc487f29c7213/03 Open Source/05 Brokerage Development Guide/11 Step 9%3A Updating Algorithm API.html -------------------------------------------------------------------------------- /03 Open Source/06 Generating Random Backtest Data/00.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /03 Open Source/06 Generating Random Backtest Data/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

Real market data is often expensive and governed by difficult redistribution licenses. QuantConnect wanted to give the LEAN users a way to design and test their algorithms, without needing to download and buy real financial data. The RandomDataGenerator seeks to address that by randomly generating data in the LEAN format, for the various asset types we support.

2 | 3 | -------------------------------------------------------------------------------- /03 Open Source/06 Generating Random Backtest Data/05 Final Notes.html: -------------------------------------------------------------------------------- 1 |

2 | The Random Data Generator uses Brownian motion to generate the data prices. You can see how these prices and ticker strings 3 | are generated in the 4 | RandomValueGenerator class. 5 |

6 | 7 |

8 | If you'd like to use a different system for providing the randomness you can implement your own IRandomValueGenerator or 9 | extend the RandomValueGenerator class. 10 |

11 | -------------------------------------------------------------------------------- /04 Strategy Library/01 CAPM Alpha Ranking Strategy on Dow 30 Companies/01 简介.cn.html: -------------------------------------------------------------------------------- 1 |

2 | 本教程执行一个简单的线性回归来构建资本资产定价模型(CAPM),这是由William F. Sharpe和Harry Markowitz开发的一个经典模型。该模型对各资产都会产生alpha和beta值,并通过做多alpha值最高的股票进行交易。本教程将演示以下内容: 3 |

4 | 5 | 11 | 12 |

13 | 该策略的实施表明,在上个月跑赢大盘的股票很可能在接下来的一个月里再次跑赢大盘。该算法在市场平稳时性能良好。然而,当市场波动性增加时,模型未能捕捉到alpha值,且表现不佳。我们从中了解到,市场波动降低了线性回归系数的显著性水平,特别是当我们使用日收益率来拟合模型时。 14 |

15 | -------------------------------------------------------------------------------- /04 Strategy Library/01 CAPM Alpha Ranking Strategy on Dow 30 Companies/04 总结.cn.html: -------------------------------------------------------------------------------- 1 |

2 | 我们已经证明,在一个平稳的市场中,上个月跑赢大盘的股票很可能在接下来的一个月里再次跑赢大盘。当市场波动时,线性回归的显著性水平降低,模型性能下降。我们可以通过观察资产(x)和基准(y)的协方差来理解这一点。当协方差减小到零时,beta将会减小。 3 |

4 | 5 | \[\hat{\beta} = \frac{Cov[x,y]}{\sum (x_i - \beta{x})^2}\] 6 | 7 |

8 | 作为实验,我们根据2015年的市场数据对算法进行了测试。对市场来说,这是一个极不稳定的时期,波动回到了接近于零的平均值,并在当年8月18日至8月25日期间下跌了近10%。该算法在今年的表现很差,收益率为-11.58%。与这一策略相关的风险包括大幅削减、缺乏对冲和止损。由于我们使用杠杆,风险增加了,因此在1月份有追加保证金的通知。我们可以通过应用以下技术来提高性能: 9 |

10 | 11 | 15 | -------------------------------------------------------------------------------- /04 Strategy Library/01 CAPM Alpha Ranking Strategy on Dow 30 Companies/05 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
-------------------------------------------------------------------------------- /04 Strategy Library/01 CAPM Alpha Ranking Strategy on Dow 30 Companies/05 算法.cn.html: -------------------------------------------------------------------------------- 1 |

2 | 使用OptionChainProvider进行回溯测试。 3 |

4 |
5 |
6 |
7 | 8 |
9 |
10 | -------------------------------------------------------------------------------- /04 Strategy Library/01 CAPM Alpha Ranking Strategy on Dow 30 Companies/06 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | https://en.wikipedia.org/wiki/Dow_Jones_Industrial_Average 4 |
  2. 5 |
  3. 6 | Sharpe, William, 1990 http://www.nobelprize.org/nobel_prizes/economic-sciences/laureates/1990/sharpe-lecture.pdf 7 |
  4. 8 |
9 | -------------------------------------------------------------------------------- /04 Strategy Library/01 CAPM Alpha Ranking Strategy on Dow 30 Companies/06 参考文献.cn.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | https://en.wikipedia.org/wiki/Dow_Jones_Industrial_Average 4 |
  2. 5 |
  3. 6 | Sharpe, William, 1990 http://www.nobelprize.org/nobel_prizes/economic-sciences/laureates/1990/sharpe-lecture.pdf 7 |
  4. 8 |
9 | -------------------------------------------------------------------------------- /04 Strategy Library/02 Combining Mean Reversion and Momentum in Forex Market/05 Summary.html: -------------------------------------------------------------------------------- 1 |

2 | The paper demonstrates there are inefficiencies in the UIP which can be exploited with a hybrid momentum and mean reversion strategy. Although the sample size of the paper is much larger than ours the parameter and significance level of the two models are very close. The strategies we discussed above keep \(\rho \) fixed and only allow \(\mu \) to change by country. If we let \(\rho \) change by lag the significance level of the model might increase, but this could potentially make modeling more difficult by introducing multicollinearity. To test this we wrote this implementation in the algorithm and commented out the lines. If you are interested in exploring this extension to the model you can change these lines to test your strategy. 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/02 Combining Mean Reversion and Momentum in Forex Market/06 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/03 Pairs Trading-Copula vs Cointegration/01 摘要.cn.html: -------------------------------------------------------------------------------- 1 |

2 | 在本研究中,我们研究了两种配对交易方法,并对结果进行了比较。配对交易涉及到对两种高度相关资产之间依附结构的研究。在假定会出现平均值回复的情况下,当出现价格差异时,多头或空头头寸将反向入市。一般情况下,资产价格分布是采用收益率序列高斯分布来建模的,但联合正态分布可能无法捕捉到股票对价格依赖性的一些关键特征(如尾部相关性)。我们的研究使用了联系理论来识别这些交易机会。 3 |

4 | 5 |

6 | 我们将从数学的角度讨论联系的基本框架,并解释如何在配对交易中应用这一方法。算法的实现基于Stander Y, Marais D, BothaI(2013)的论文带有联系函数的交易策略。根据Hanson T A,Hall J R.(2012)的论文统计套利交易策略和高频交易,我们将联系配对交易策略的性能与协整配对交易方法进行了比较。协整法假设配对股票之间存在协整关系,可以识别有利可图的交易机会。实证结果表明,与传统的配对交易策略相比,基于联系的策略更容易获益。 7 |

8 | -------------------------------------------------------------------------------- /04 Strategy Library/04 The Dynamic Breakout II Strategy/05 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | George Pruitt, John R. Hill, Michael Russak (September 2012). Building Winning Trading Systems, page 126,  Online Copy 4 |
  2. 5 |
  3. 6 | Robert C. Miner(October 20, 2008). High Probability Trading Strategies: Entry to Exit Tactics for the Forex, Futures, and Stock Markets, page 37,  Online Copy 7 |
  4. 8 |
  5. 9 |
10 | -------------------------------------------------------------------------------- /04 Strategy Library/05 Dual Thrust Trading Algorithm/03 Conclusion.html: -------------------------------------------------------------------------------- 1 |

2 | We tested this strategy on the S&P 500 ETF SPY from 2004 to 2017. During the backtesting period, SPY resulted in a Sharpe Ratio of -0.37 and the drawdown is 65.7%. This is just a basic implementation and the parameters K1 and K2 are fixed. The strategy can be further extended to Futures and Forex markets. When K1 is smaller than K2, buy signals are prone to trigger and vice versa. To improve the model we can apply technical indicators to judge the trend of price and adjust the value of two parameters dynamically and apply risk control in the position sizing. 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/05 Dual Thrust Trading Algorithm/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |

2 | Backtest result for ETF: SPY from 2004 to 2017 3 |

4 |
5 |
6 |
7 | 8 |
9 |
10 | -------------------------------------------------------------------------------- /04 Strategy Library/05 Dual Thrust Trading Algorithm/05 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | Gang Wei(May 2012). Dual Thrust Intraday Strategy,  Online Copy 4 |
  2. 5 |
6 | -------------------------------------------------------------------------------- /04 Strategy Library/06 Can Crude Oil Predict Equity Returns/02 Background.html: -------------------------------------------------------------------------------- 1 |

2 | We assume the predicted return of the stock is proportional to the return of oil. This can be represented by the regression equation: 3 |

4 | 5 | \[r^{stock}_t=a_0+a_1r^{oil}_{t-1}+e_t\] 6 | 7 |

8 | with 9 |

10 | 11 | \[e_t=r^{stock}_t-E_{t-1}[r^{stock}_t]\]. 12 | 13 |

14 | The independent variable is the return of the oil and the dependent variable is the return of the stock. We use the monthly returns over a regression period of 2 years, giving us 22 observations to regress.?Every month regression analysis is conducted, and we use the estimated coefficient from the regression to compute the expected stock return with the given return of oil. 15 |

16 | -------------------------------------------------------------------------------- /04 Strategy Library/06 Can Crude Oil Predict Equity Returns/05 Algorithm.html: -------------------------------------------------------------------------------- 1 |

2 | Strategy code, as well as backtesting result, is attached below. We also put other choices of implementation in the comments. 3 |

4 |
5 |
6 |
7 | 8 |
9 |
10 | -------------------------------------------------------------------------------- /04 Strategy Library/06 Can Crude Oil Predict Equity Returns/06 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | Gerben, Driesprong (2007). Striking Oil: Another Puzzle? page 1, Online Copy 4 |
  2. 5 |
6 | -------------------------------------------------------------------------------- /04 Strategy Library/07 Intraday Dynamic Pairs Trading using Correlation and Cointegration Approach/01 摘要.cn.html: -------------------------------------------------------------------------------- 1 |

2 | 在本教程中,我们使用两阶段关联法和协整法,基于市场中性统计套利策略实施了高频动态配对交易策略。这种策略基于George J. Miao的研究。我们将这一交易策略应用于美国银行板块股票,使用2012年至2013年的10分钟股票数据对这一策略进行了回溯测试。我们交易策略所产生的复合年回报率高达29.4%,夏普指数为0.968。 3 |

4 | 5 |

6 | 当市场表现不佳时,这种策略尤其有利可图。利润来自于错误定价,当市场下跌或波动性增加时,很可能会发生错误定价。 7 |

8 | 9 |

10 | 为了进一步探讨这种策略,我们将策略设计得更为灵活。我们可以通过简单地更改参数,将数据分辨率更改为5分钟、10分钟甚至30分钟。选择最优的进入、结束和止损阈值也是非常重要的。每个人都可以有自己的策略。 11 |

12 | -------------------------------------------------------------------------------- /04 Strategy Library/07 Intraday Dynamic Pairs Trading using Correlation and Cointegration Approach/05 总结.cn.html: -------------------------------------------------------------------------------- 1 |

2 | 该策略被认为是市场中性策略,因为它是一种对价格趋同进行押注的多/空策略。回溯测试beta为-0.112,在我们的预期范围内。从理论上讲,我们使用的分辨率越高,获胜的几率就越高,因为一方面,更高的分辨率会增加我们训练期间的数据点数量,这将使我们更难通过两阶段测试;另一方面,高分辨率的数据可以让我们更准确地捕捉微小的利润。然而,在性能和回测时间之间存在权衡。较高的分辨率将导致回溯测试时间急剧增加。初始化步骤中股票的数量也会影响我们的性能。理论上,我们拥有的股票越多,我们可能选择的股票配对就越好。但过多的股票也会耗费时间,值得一提的是,每个行业的优化参数是不同的。这取决于特定行业价格模式的特点。绘制出配对价格和观察残差是调整阈值的较好选择。 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/07 Intraday Dynamic Pairs Trading using Correlation and Cointegration Approach/06 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/07 Intraday Dynamic Pairs Trading using Correlation and Cointegration Approach/06 算法.cn.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/08 The Momentum Strategy Based on the Low Frequency Component of Forex Market/05 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/08 The Momentum Strategy Based on the Low Frequency Component of Forex Market/06 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | Harris R D F, Yilmaz F. A momentum trading strategy based on the low-frequency component of the exchange rate[J]. Journal of Banking & Finance, 2009, 33(9): 1575-1585. online copy 4 |
  2. 5 |
  3. 6 | Dao T L. Momentum Strategies with L1 Filter[J]. Browser Download This Paper, 2014. online copy 7 |
  4. 8 |
9 | -------------------------------------------------------------------------------- /04 Strategy Library/09 Stock Selection Strategy Based on Fundamental Factors/01 Abstract.html: -------------------------------------------------------------------------------- 1 |

2 | In recent years, factor investing gained significant popularity among global institutional investors. In this tutorial, we first developed a factor selection model to test if factors have the ability to differentiate potential winners and losers in the stock market. Then we use those  preselected factors to implement the factor ranking stock selection algorithm based on Factor Based Stock Selection Model for Turkish Equities, 2015,  Ayhan Yüksel. 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/09 Stock Selection Strategy Based on Fundamental Factors/01 摘要.cn.html: -------------------------------------------------------------------------------- 1 |

2 | 近年来,投资要素在全球机构投资者中非常受欢迎。在本教程中,我们首先开发了一个要素选择模型,用于测试要素是否具有区分股市中潜在赢家和输家的能力。然后,根据2015年基于要素的土耳其股票选择模型,我们利用这些预先选择要素,实现了要素排序选股算法,Ayhan Yüksel。 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/09 Stock Selection Strategy Based on Fundamental Factors/03 股票选择.cn.html: -------------------------------------------------------------------------------- 1 | 接下来我们将选择股票。 2 |

步骤1:按照要素值对股票排序

3 |

4 | 首先,我们删除没有基础数据或要素值为零的股票。对于每种预先选择的因素,我们根据这些因素值对股票进行排序。当要素相关性为负时,顺序递减;要素相关性为正时,顺序递增。 5 |

6 | 7 |

步骤2:计算平均加权综合要素得分

8 |

9 | 第二步是使用不同的选择要素变量来计算每支股票的平均加权综合要素得分。 10 |

11 | 12 | 18 | -------------------------------------------------------------------------------- /04 Strategy Library/09 Stock Selection Strategy Based on Fundamental Factors/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/09 Stock Selection Strategy Based on Fundamental Factors/04 算法.cn.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/09 Stock Selection Strategy Based on Fundamental Factors/05 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | Factor Based Stock Selection Model for Turkish Equities, 2015, Ayhan Yüksel Online Copy 4 |
  2. 5 |
6 | -------------------------------------------------------------------------------- /04 Strategy Library/09 Stock Selection Strategy Based on Fundamental Factors/05 参考文献.cn.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | Factor Based Stock Selection Model for Turkish Equities, 2015, Ayhan Yüksel Online Copy 4 |
  2. 5 |
6 | -------------------------------------------------------------------------------- /04 Strategy Library/10 Short-Term Reversal Strategy in Stocks/01 Abstract.html: -------------------------------------------------------------------------------- 1 |

2 | In this tutorial, we implement a version of the short-term reversal strategy published by De Groot, Huij, & Zhou 3 | (2012). The strategy works by observing the returns of each security in the universe over the previous month. Every 4 | week, the algorithm longs the worst performers and shorts the top performers. The original strategy outlined in the 5 | literature considers the entire universe of stocks when trading. To reduce trading costs, we limit our universe to 6 | the most liquid large cap stocks. Our analysis shows the strategy underperforms the S&P 500 index during all our 7 | backtest periods except the 2020 market crash. 8 |

9 | -------------------------------------------------------------------------------- /04 Strategy Library/10 Short-Term Reversal Strategy in Stocks/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/10 Short-Term Reversal Strategy in Stocks/07 Market & Competition Qualification.html: -------------------------------------------------------------------------------- 1 |

2 | Although this strategy passes several of the 3 | metrics required for Alpha Streams 4 | and the Quant League competition, it requires further work to pass the following requirements: 5 |

6 | 7 | 14 | -------------------------------------------------------------------------------- /04 Strategy Library/10 Short-Term Reversal Strategy in Stocks/09 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | de Groot, Wilma and Huij, Joop and Zhou, Weili, Another Look at Trading Costs and Short-Term Reversal 4 | Profits (July 1, 2011). Online copy 5 |
  2. 6 |
-------------------------------------------------------------------------------- /04 Strategy Library/100 Trading with WTI BRENT Spread/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | The WTI-Brent spread is the difference between the prices of two types of crude oil: West Texas Intermediate (WTI) on the long side and Brent Crude (Brent) on the short side. 3 | For years, the price difference between the two has only been a few dollars on average. As both oils are very similar, their spread shows signs of strong predictability and usually oscillates around some average value. 4 | Therefore, it is possible to use deviations from the fair spread value to bet on convergence back to fair value. Here we present a trading strategy based on the price deviations of the spread. 5 |

6 | -------------------------------------------------------------------------------- /04 Strategy Library/100 Trading with WTI BRENT Spread/01 简介.cn.html: -------------------------------------------------------------------------------- 1 |

2 | WTI-Brent价差指的是两种原油价格之间的差异:即多头的西德克萨斯中质原油(WTI)和空头布伦特原油(Brent)。多年来,两者之间的价格差距平均只有几美元。由于这两种原油非常相似,它们的价差显示出很强的可预测性,通常在某个平均值附近波动。因此,有可能使用偏离公允价差的值来押注回复到公允价值。本文提出了一种基于价差价格差异的交易策略。 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/100 Trading with WTI BRENT Spread/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/100 Trading with WTI BRENT Spread/03 算法.cn.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/100 Trading with WTI BRENT Spread/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/100 Trading with WTI BRENT Spread/04 来源.cn.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/102 Option Expiration Week Effect/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/102 Option Expiration Week Effect/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/1023 Intraday Arbitrage Between Index ETFs/01 Abstract.html: -------------------------------------------------------------------------------- 1 |

2 | In this tutorial, we implement an intraday arbitrage strategy that capitalizes on deviations between two closely correlated 3 | index ETFs. Even though at times both ETFs may hold different constituents and different weights of securities while tracking 4 | the index, they are both highly correlated and extremely liquid. Researchers have shown these two properties are essential to 5 | an arbitrage system's success. The algorithm we implement here is inspired by the work of Kakushadze and Serur (2018) and 6 | Marshall, Nguyen, and Visaltanachoti (2010). 7 |

8 | -------------------------------------------------------------------------------- /04 Strategy Library/1023 Intraday Arbitrage Between Index ETFs/02 Background.html: -------------------------------------------------------------------------------- 1 |

2 | Marshall et al (2010) define an arbitrage opportunity as when the bid price of ETF A (B) diverts high enough away from the ask 3 | price of ETF B (A) such that their quotient reaches a threshold. In their paper, an arbitrage opportunity is only acted upon 4 | when the threshold is satisfied for 15 seconds. When these criteria are met, the algorithm enters the arbitrage trade by going 5 | long ETF B (A) and short ETF A (B). When the spread reverts back to where the bid of ETF B (A) >= the ask of ETF A (B) for 15 6 | seconds, the positions are liquidated. An overview of the trade process is illustrated in the image below. 7 |

8 | 9 | Tutorial1023-intraday-arbitrage-1 -------------------------------------------------------------------------------- /04 Strategy Library/1023 Intraday Arbitrage Between Index ETFs/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
-------------------------------------------------------------------------------- /04 Strategy Library/1023 Intraday Arbitrage Between Index ETFs/08 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | Marshall, Ben R. and Nguyen, Nhut (Nick) Hoang and Visaltanachoti, Nuttawat, ETF Arbitrage: Intraday Evidence (November 16, 2010). Online copy 4 |
  2. 5 |
  3. 6 | Kakushadze, Zura and Serur, Juan Andrés, 151 Trading Strategies (August 17, 2018). Z. Kakushadze and J.A. Serur. 151 Trading Strategies. Cham, Switzerland: Palgrave Macmillan, an imprint of Springer Nature, 1st Edition (2018), XX, 480 pp; ISBN 978-3-030-02791-9. Online copy 7 |
  4. 8 |
-------------------------------------------------------------------------------- /04 Strategy Library/1024 Forecasting Stock Prices using a Temporal CNN Model/01 Abstract.html: -------------------------------------------------------------------------------- 1 |

2 | In this tutorial, we apply Deep Learning Classification in an attempt to forecast the movement of future stock prices. 3 |

4 |

5 | Key Concepts: Convolutional Neural Network, Deep Learning, Time-series Forecasting, Classification, Trading 6 |

-------------------------------------------------------------------------------- /04 Strategy Library/1024 Forecasting Stock Prices using a Temporal CNN Model/02 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Various time series forecasting models (SMA, EMA, etc.) have been applied to stocks to forecast price movements. 3 | More recently, with the advent of Neural Networks, which have seen applications in several fields, ranging from 4 | medicine to fraud detection, researchers have tried to apply Neural Networks to the markets in an attempt to forecast price 5 | movements. Convolutional Neural Networks (CNNs) are a class of Neural Networks most widely known for their use in 6 | image classification, and now, researchers are applying CNNs to extract patterns, also known as features, from times-series 7 | data to forecast future stock prices. 8 |

9 | -------------------------------------------------------------------------------- /04 Strategy Library/1024 Forecasting Stock Prices using a Temporal CNN Model/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/1024 Forecasting Stock Prices using a Temporal CNN Model/05 Results.html: -------------------------------------------------------------------------------- 1 |

2 | Since our algorithm is non-deterministic, users should expect to see different results in repeated backtests. From 3 | running our algorithm ten times, we achieved Sharpe Ratios with an average of .211, a maximum of 0.917, and minimum 4 | of -0.312, and a standard deviation of 0.327. As we traded three technology stocks, we compare our results to QQQ. 5 | Comparing our algorithm to QQQ, our average Sharpe of .211 is significantly lower than the 0.967 Sharpe of QQQ. 6 |

-------------------------------------------------------------------------------- /04 Strategy Library/1024 Forecasting Stock Prices using a Temporal CNN Model/06 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | Nikolaos Passalis, Anastasios Tefas, Juho Kanniainen, Moncef Gabbouj, Alexandros Iosifidis: 4 | "Temporal Logistic Neural Bag-of-Features for Financial Time series Forecasting leveraging Limit Order Book Data", 2019; 5 | https://arxiv.org/pdf/1901.08280.pdf. 6 |
  2. 7 |
-------------------------------------------------------------------------------- /04 Strategy Library/1025 Leveraged ETFs with Systematic Risk Management/01 Abstract.html: -------------------------------------------------------------------------------- 1 |

2 | In this tutorial, we attempt to beat the returns of the S&P500 Index using leverage and systematic risk management. 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/1025 Leveraged ETFs with Systematic Risk Management/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/1025 Leveraged ETFs with Systematic Risk Management/05 Results.html: -------------------------------------------------------------------------------- 1 |

2 | We use the S&P 500 as our benchmark, which we track by using the SPY ETF. Our strategy yielded a Sharpe Ratio of .732 3 | over the past five years, while buying and holding SPY for the same period yielded a Sharpe Ratio of .572. 4 |

-------------------------------------------------------------------------------- /04 Strategy Library/1025 Leveraged ETFs with Systematic Risk Management/06 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | Gayed, Michael and Bilello, Charles, Leverage for the Long Run - A Systematic Approach to Managing Risk and 4 | Magnifying Returns in Stocks (March 3, 2016). 2016 Charles H. Dow Award. 5 | Online Copy. 6 |
  2. 7 |
-------------------------------------------------------------------------------- /04 Strategy Library/1026 Intraday ETF Momentum/01 Abstract.html: -------------------------------------------------------------------------------- 1 |

2 | In this tutorial, we implement an intraday momentum strategy that trades some of the most actively traded ETFs. 3 | Specifically, we observe the return generated from the first half-hour of the trading day to predict the sign of 4 | the trading day's last half-hour return. Researchers have shown that this momentum pattern is statistically and 5 | economically significant, even after accounting for trading fees. The algorithm we design here is a recreation of 6 | the research completed by Gao, Han, Li, and Zhou (2017). 7 |

8 | -------------------------------------------------------------------------------- /04 Strategy Library/1026 Intraday ETF Momentum/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
-------------------------------------------------------------------------------- /04 Strategy Library/1026 Intraday ETF Momentum/06 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | Gao, Lei and Han, Yufeng and Li, Sophia Zhengzi and Zhou, Guofu, Market Intraday Momentum (June 19, 2017). 4 | Online copy 5 |
  2. 6 |
-------------------------------------------------------------------------------- /04 Strategy Library/1027 Using News Sentiment to Predict Price Direction of Drug Manufacturers/01 Abstract.html: -------------------------------------------------------------------------------- 1 |

2 | Several studies have found that press releases and other media can impact the perspective of investors. In this 3 | tutorial, we implement an intraday strategy to capitalize on the upward drift in the stock prices of drug 4 | manufacturers following positive news releases. Our findings show that when combining the effect with the 5 | day-of-the-week anomaly documented by Berument & Kiymaz (2001), there is enough directional accuracy for the 6 | trading system to remain profitable throughout the 2020 stock market crash. However, the algorithm 7 | underperforms the S&P 500 market index ETF, SPY, over the same time period. The algorithm we design here is 8 | inspired by the work of Isah, Shah, & Zulkernine (2018). 9 |

10 | -------------------------------------------------------------------------------- /04 Strategy Library/1027 Using News Sentiment to Predict Price Direction of Drug Manufacturers/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
-------------------------------------------------------------------------------- /04 Strategy Library/1027 Using News Sentiment to Predict Price Direction of Drug Manufacturers/06 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | Shah, Dev, Haruna Isah, and Farhana Zulkernine. “Predicting the Effects of News Sentiments on the Stock Market.” 4 | 2018 IEEE International Conference on Big Data (Big Data) (2018). 5 | Online copy 6 |
  2. 7 |
  3. 8 | Berument, Hakan and Kiymaz, Halil, The Day of the Week Effect on Stock Market Volatility (2001). Journal of 9 | Economics and Finance, Vol.25, No.2, pp. 181-193. Online copy 10 |
  4. 11 |
-------------------------------------------------------------------------------- /04 Strategy Library/1028 Ichimoku Clouds in the Energy Sector/01 Abstract.html: -------------------------------------------------------------------------------- 1 |

2 | Gurrib (2020) is the first published research paper to analyze the predictive power of Ichimoku Clouds for the 3 | largest 10 stocks in the US energy sector. In this tutorial, we implement a similar strategy while reducing the 4 | effect of look-ahead bias integrated into the original study. Our findings show that while the strategy has an 5 | impressive 176 Sharpe ratio during the downfall of the 2020 oil price war, the strategy has worse performance than 6 | found by Gurrib (2020). We discover that throughout a 5 year backtest, the strategy fails to beat the benchmark of 7 | a popular energy sector ETF. 8 |

9 | -------------------------------------------------------------------------------- /04 Strategy Library/1028 Ichimoku Clouds in the Energy Sector/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
-------------------------------------------------------------------------------- /04 Strategy Library/1028 Ichimoku Clouds in the Energy Sector/06 Market & Competition Qualification.html: -------------------------------------------------------------------------------- 1 |

2 | Although this strategy passes several of the 3 | metrics required for Alpha Streams 4 | and the Quant League competition, it requires further work to pass the following requirements: 5 |

6 | 7 | -------------------------------------------------------------------------------- /04 Strategy Library/1028 Ichimoku Clouds in the Energy Sector/08 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | Gurrib, Ikhlaas, Can the Leading Us Energy Stock Prices Be Predicted Using Ichimoku Clouds? (January 16, 2020). 4 | Online Copy 5 |
  2. 6 |
-------------------------------------------------------------------------------- /04 Strategy Library/1029 Optimal Pairs Trading/01 Abstract.html: -------------------------------------------------------------------------------- 1 |

2 | In this tutorial, we apply Ornstein-Uhlenbeck model to a Pairs Trading process and derive the Optimal Entry and Liquidation 3 | levels. 4 |

5 | -------------------------------------------------------------------------------- /04 Strategy Library/1029 Optimal Pairs Trading/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/1029 Optimal Pairs Trading/05 Video Walkthrough.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04 Strategy Library/1029 Optimal Pairs Trading/06 Results.html: -------------------------------------------------------------------------------- 1 |

2 | Our algorithm yielded a Sharpe ratio of 0.898 over a five year period, while holding SPY over the same period 3 | yielded a Sharpe ratio of 0.667. However it should be noted, due to the fact the algorithm had to wait periods 4 | of time before our optimal entry and liquidation levels were reached, our algorithm only made twelve trades over the 5 | entire backtest duration. To increase the number of trades, we can add additional pairs, such as GLD-GDX. We encourage 6 | our users to clone this algorithm and and to experiment with different ideas for pairs and to play with the parameters 7 | of the algorithm. 8 |

-------------------------------------------------------------------------------- /04 Strategy Library/1029 Optimal Pairs Trading/07 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | Leung, Tim and Li, Xin, Optimal Mean Reversion Trading with Transaction Costs and Stop-Loss Exit (April 26, 2015). 4 | International Journal of Theoretical and Applied Finance, Vol. 18, No. 3, 2015. 5 | Online Copy. 6 |
  2. 7 |
-------------------------------------------------------------------------------- /04 Strategy Library/1030 G-Score Investing/01 Abstract.html: -------------------------------------------------------------------------------- 1 |

2 | In this tutorial, we apply G-Score Investing to choose a Universe of stocks to invest in. 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/1030 G-Score Investing/02 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Analyzing a company’s fundamentals is a method of trading that doesn’t 3 | rely purely on price and volume data. We will apply the use of computers to automate 4 | the analysis of this data, and we will do so using a method of 5 | Factor Investing, 6 | the process of using different attributes, in this case, fundamental data, to choose 7 | stocks to purchase. More specifically, we will use G-Score investing, and evaluate companies 8 | on seven factors that we will detail later. We specifically choose companies with Book-to-Market 9 | due to abnormal returns as a result of the Risk Premium Effect. 10 |

11 | -------------------------------------------------------------------------------- /04 Strategy Library/1030 G-Score Investing/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/1030 G-Score Investing/05 Results.html: -------------------------------------------------------------------------------- 1 |

2 | Since we use Technology as the industry, we decided to use Nasdaq-100, or ^NDX, as the benchmark, which we track 3 | using the QQQ ETF. Our algorithm achieves a Sharpe Ratio of 0.778 from April 2016 to September 2020, and so it is 4 | outperformed by simply holding QQQ, which yielded a Sharpe Ratio of 1.22 over the same period. 5 |

-------------------------------------------------------------------------------- /04 Strategy Library/1030 G-Score Investing/06 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | Mohanram, Partha S., Separating Winners from Losers Among Low Book-to-Market Stocks Using Financial Statement 4 | nalysis (April 2004). Online Copy. 5 |
  2. 6 |
-------------------------------------------------------------------------------- /04 Strategy Library/1031 SVM Wavelet Forecasting/01 Abstract.html: -------------------------------------------------------------------------------- 1 |

2 | In this tutorial, we apply an SVM Wavelet model in an attempt to forecast EURJPY prices. 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/1031 SVM Wavelet Forecasting/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/1031 SVM Wavelet Forecasting/05 Results.html: -------------------------------------------------------------------------------- 1 |

The performance of the algorithm was decent. Over the past five years, the algorithm achieved a Sharpe Ratio of 0.252, 2 | while buying and holding SPY over the same period would have achieved a Sharpe Ratio of 0.713. Some ideas for improvement include:

3 | 8 |

If a user comes across any interesting results with modifications of this algorithm, we’d love to hear about it in the Community Forum.

-------------------------------------------------------------------------------- /04 Strategy Library/1031 SVM Wavelet Forecasting/06 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | M. S. Raimundo and J. Okamoto, "SVR-wavelet adaptive model for forecasting financial time series," 2018 International Conference on Information and Computer Technologies (ICICT), DeKalb, IL, 2018, pp. 111-114, doi: 10.1109/INFOCT.2018.8356851. Online Copy. 4 |
  2. 5 |
-------------------------------------------------------------------------------- /04 Strategy Library/1033 Gradient Boosting Model/01 Abstract.html: -------------------------------------------------------------------------------- 1 |

2 | In this tutorial, we train a Gradient Boosting Model (GBM) to forecast the intraday price movements of the SPY ETF using a 3 | collection of technical indicators. The implementation is based on the research produced by Zhou et al (2013), where a GBM 4 | was found to produce an annualized Sharpe ratio greater than 20. Our research shows that throughout a 5 year backtest, the 5 | model underperforms the SPY with its current parameter set. However, we finish the tutorial with highlighting potential 6 | areas of further research to improve the model’s performance. 7 |

8 | -------------------------------------------------------------------------------- /04 Strategy Library/1033 Gradient Boosting Model/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
-------------------------------------------------------------------------------- /04 Strategy Library/1033 Gradient Boosting Model/06 Market & Competition Qualification.html: -------------------------------------------------------------------------------- 1 |

2 | Although this strategy passes several of the 3 | metrics required for Alpha Streams 4 | and the Quant League competition, it requires further work to pass the following requirements: 5 |

6 | 7 | 8 | 14 | -------------------------------------------------------------------------------- /04 Strategy Library/1033 Gradient Boosting Model/08 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | Zhou, Nan and Cheng, Wen and Qin, Yichen and Yin, Zongcheng, Evolution of High Frequency Systematic Trading: A Performance-Driven Gradient Boosting Model (September 10, 2013). Online copy 4 |
  2. 5 |
-------------------------------------------------------------------------------- /04 Strategy Library/1036 Gaussian Naive Bayes Model/01 Abstract.html: -------------------------------------------------------------------------------- 1 |

2 | Naïve Bayes models have become popular for their success in spam email filtering. In this tutorial, we train 3 | Gaussian Naïve Bayes (GNB) classifiers to forecast the daily returns of stocks in the technology sector given the 4 | historical returns of the sector. Our implementation shows the strategy has a greater Sharpe and lower variance 5 | than the SPY ETF over a 5 year backtest and during the 2020 stock market crash. The algorithm we build here follows 6 | the research done by Lu (2016) and Imandoust & Bolandraftar (2014). 7 |

8 | -------------------------------------------------------------------------------- /04 Strategy Library/1036 Gaussian Naive Bayes Model/03 Video Walkthrough.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04 Strategy Library/1036 Gaussian Naive Bayes Model/05 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
-------------------------------------------------------------------------------- /04 Strategy Library/1036 Gaussian Naive Bayes Model/07 Market & Competition Qualification.html: -------------------------------------------------------------------------------- 1 |

2 | Although this strategy passes several of the 3 | metrics required for Alpha Streams 4 | and the Quant League competition, it requires further work to pass the following requirements: 5 |

6 | 7 | 13 | -------------------------------------------------------------------------------- /04 Strategy Library/1036 Gaussian Naive Bayes Model/08 Conclusion.html: -------------------------------------------------------------------------------- 1 |

2 | The GNB model strategy implemented in this tutorial produced a greater Sharpe ratio and lower annual variance than 3 | buying and holding the S&P 500 index ETF benchmark over the backtesting period. In addition to outperforming during 4 | the entire backtest, the strategy also outperformed during the 2020 stock market crash. 5 |

6 | 7 |

8 | To continue the development of this strategy, future areas of research include: 9 |

10 | 11 | -------------------------------------------------------------------------------- /04 Strategy Library/1036 Gaussian Naive Bayes Model/09 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | Imandoust, S. B., & Mohammad, B. (2014). Forecasting the direction of stock market index movement using three 4 | data mining techniques: the case of Tehran Stock Exchange. Journal of Engineering Research and Applications, 5 | 6(2), 106-117. 6 | Online copy 7 |
  2. 8 |
  3. 9 | Lu, N. (2016). A Machine Learning Approach to Automated Trading. 10 | Online copy 11 |
  4. 12 |
-------------------------------------------------------------------------------- /04 Strategy Library/11 Fundamental Factor Long Short Strategy/03 Summary.html: -------------------------------------------------------------------------------- 1 |

2 | The strategy was backtest at a 60-year timespan. It's persistent, systematic and intuitive. Although our version is very different from the paper one, the logic and intuition behind are the same. It has a better performance than the paper strategy because we added short positions. 3 | For further development, we can try to rank a large number of stocks, and do some portfolio optimization instead of holding stocks equally. 4 |

5 | -------------------------------------------------------------------------------- /04 Strategy Library/11 Fundamental Factor Long Short Strategy/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/11 Fundamental Factor Long Short Strategy/05 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | A New Core Equity ParadigmOnline Copy 4 |
  2. 5 |
6 | -------------------------------------------------------------------------------- /04 Strategy Library/113 January Barometer/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | January barometer is a calendar anomaly saying that the January performance of equity index could foretell February to December returns on equity index - a strong January shows strong rest of the year and otherwise. 3 | This algorithm is going to explore the estimation effect of the January barometer in equity index market. 4 |

5 | -------------------------------------------------------------------------------- /04 Strategy Library/113 January Barometer/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/113 January Barometer/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/114 January Effect in Stocks/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | The January effect is a calendar anomaly saying that small-cap stocks returns in January are especially strong. 3 | The most common explanation of this phenomenon is that individual investors, who are income tax-sensitive and who disproportionately hold small stocks, sell stocks for tax reasons at year end and reinvest during the first month of the year. 4 | In this algorithm, we will explore the January effect in the stock market. 5 |

6 | -------------------------------------------------------------------------------- /04 Strategy Library/114 January Effect in Stocks/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/114 January Effect in Stocks/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/118 Time Series Momentum Effect/03 Algorithm.html: -------------------------------------------------------------------------------- 1 | div class="qc-embed-frame" style="display: inline-block; position: relative; width: 100%; min-height: 100px; min-width: 300px;"> 2 |
3 |
4 | 6 |
7 | 8 | -------------------------------------------------------------------------------- /04 Strategy Library/118 Time Series Momentum Effect/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/12 Asset Class Trend Following/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Asset class trend following is a strategy that tries to exploit a momentum anomaly between various assets. It uses various moving averages or momentum filters to gain an exposure to an asset class only at the time when there is a higher probability for outperformance with less risk. 3 | The basic logic behind the trend following is finding a method to detect the trend of price movement and buy an asset when its price trend goes up, and sell when its trend goes down. 4 |

5 | -------------------------------------------------------------------------------- /04 Strategy Library/12 Asset Class Trend Following/02 Method.html: -------------------------------------------------------------------------------- 1 |

2 | This algorithm applies to trend following ideas to 5 ETFs in different asset classes like stocks, bonds, and commodities. The simple moving average is used to detect the trend. When the closing price is over its ten-month simple moving average, 3 | we give equal allocation to those ETFs, otherwise stay in cash. 4 | SMA(symbol, period, resolution) is used to generate the moving average value In LEAN implementation. A warm-up period of ten months is set to prime the data and initialize the indicator so the SMA is ready to use when the algorithm starts. 5 |

6 | -------------------------------------------------------------------------------- /04 Strategy Library/12 Asset Class Trend Following/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/12 Asset Class Trend Following/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/125 12 Month Cycle in Cross-Section of Stocks Returns/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | January effect in stocks market says that stocks perform especially well in the first month of the year. This seasonal effect might lead us to think 3 | that stocks performed well in the last year's January will perform well in this year's January. In this tutorial, we're going to implement a strategy based 4 | on this yearly seasonal effect. 5 |

6 | -------------------------------------------------------------------------------- /04 Strategy Library/125 12 Month Cycle in Cross-Section of Stocks Returns/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/125 12 Month Cycle in Cross-Section of Stocks Returns/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/13 Asset Class Momentum/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | This trend following algorithm finds its entry points using the momentum effect. The momentum anomaly says that what was strongly going up in the past will probably continue to go up in the near future.  3 | The calculation performed uses the rate of change in price movements for a particular asset. 4 |

5 | -------------------------------------------------------------------------------- /04 Strategy Library/13 Asset Class Momentum/02 Method.html: -------------------------------------------------------------------------------- 1 |

2 | The portfolio of this algorithm contains 5 ETFs in different asset classes. LEAN has the momentum indicator MOM(symbol, period). The period is 12 months. After obtaining the most recent momentum value, we pick 3 ETFs with the strongest 12-month momentum into the portfolio and weight them equally. Hold for 1 month and then rebalance the portfolio with new momentum. Unlike asset class trend following strategy which combines asset classes into one portfolio, this rotational momentum system compares the performance of asset classes and picks only the best-performing assets from investment universe into investor's portfolio. The portfolio is rebalanced every month and portfolio's holdings are rotated so that only the best-performing assets are held. 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/13 Asset Class Momentum/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/13 Asset Class Momentum/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/136 Residual Momentum/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Residual momentum is the phenomenon that stocks with greater monthly residual returns (normalized by the volatility of the 3 | residual returns) tend to outperform those with less. Research has shown the strategy experiences less exposure to the dynamic 4 | Fama-French factors, produces greater sharpe ratios, and is more robust out-of-sample than a total return momentum strategy. 5 | This strategy is claimed to be more stable throughout the business cycle than a total return momentum strategy. It tends to underperform during trending regimes and outperform during reverting regimes. Additionally, this strategy is less concentrated is small-cap stocks than a total return strategy can sometimes be, leading to less trading costs and reducing the effect of tax-loss selling. 6 |

7 | -------------------------------------------------------------------------------- /04 Strategy Library/136 Residual Momentum/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
-------------------------------------------------------------------------------- /04 Strategy Library/136 Residual Momentum/04 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | Blitz, David and Huij, Joop and Martens, Martin P.E., Residual Momentum (August 1, 2009) 4 |
  2. 5 |
  3. 6 | Huij, Joop and Lansdorp, Simon, Residual Momentum and Reversal Strategies Revisited (March 8, 2017) 7 |
  4. 8 |
-------------------------------------------------------------------------------- /04 Strategy Library/14 Sector Momentum/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Sector rotation is a popular strategy with which capital is actively reallocated from one sector to another based upon changing market conditions. 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/14 Sector Momentum/02 Method.html: -------------------------------------------------------------------------------- 1 |

2 | This algorithm is an adaptation of asset class momentum. Instead of rotating ETFs in different asset classes, 3 | the sector momentum algorithm picks 10 sector ETFs and pick 3 ETFs with the strongest 12-month momentum into 4 | the portfolio and weight them equally. The portfolio is rebalanced at the start of each month. 5 |

6 | -------------------------------------------------------------------------------- /04 Strategy Library/14 Sector Momentum/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/14 Sector Momentum/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/15 Short Term Reversal/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | The short-term reversal is the phenomenon that stocks with relatively low returns over the past month or week earn positive abnormal returns in the following month or week, and stocks with high returns earn negative abnormal returns. 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/15 Short Term Reversal/02 Method.html: -------------------------------------------------------------------------------- 1 |

2 | To apply short-term reversal in stocks market, first, we use the universe selection API to pick the stocks with the price higher than 4 and rank those stocks by dollar volume and 3 | choose the top 100 stocks as our asset pool. In fine universe selection, the prescreened stocks are sorted by market cap we choose the top 20. To detect the reversal effect, 4 | the return is the most straightforward measure of the stock history performance. The RateOfReturn indicator is used to calculate the monthly return. We go long on the 10 stocks 5 | with the lowest performance in the previous month and go short on the 10 stocks with the greatest performance from the previous month. 6 |

7 | -------------------------------------------------------------------------------- /04 Strategy Library/15 Short Term Reversal/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/15 Short Term Reversal/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/152 Momentum Effect in REITs/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | The momentum effect is a classic anomaly that says what was strongly going up in the past will probably continue to go up in the near future. The calculation performed uses the rate of change in price movements. We see this effect in REITs through studies where REITs with the highest annual past performance beat lower performing trusts. This strategy will take a long position in companies with the strongest momentum and rebalance quarterly. 3 |

-------------------------------------------------------------------------------- /04 Strategy Library/152 Momentum Effect in REITs/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/152 Momentum Effect in REITs/04 Source.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04 Strategy Library/155 Momentum and Reversal Combined with Volatility Effect in Stocks/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Momentum is a well-known strategy that buys stocks with the best return over the past three to twelve months and sells stocks with the worst performances over the same time horizon. 3 | The reversal strategy buys the stocks with relatively low returns and sells stocks with high returns. In this algorithm, we will develop a long-short strategy combining the momentum/reversal effect with the realized volatility. 4 |

5 | -------------------------------------------------------------------------------- /04 Strategy Library/155 Momentum and Reversal Combined with Volatility Effect in Stocks/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/155 Momentum and Reversal Combined with Volatility Effect in Stocks/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/16 Overnight Anomaly/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Instead of collecting profit from intraday trading, this algorithm tries to capture the overnight returns of the index. 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/16 Overnight Anomaly/02 Method.html: -------------------------------------------------------------------------------- 1 |

2 | The strategy buys SPY ETF at its closing price and sells it at the opening each day. 3 | The strategy makes a lot of trades, therefore, the whole strategy is very sensitive 4 | to slippage costs and fees. Those returns are canceled out once transaction costs 5 | are taken into account. With the InteractiveBrokers transaction model, fees for 20 6 | years backtest is almost 25% of the initial cash. 7 |

8 | -------------------------------------------------------------------------------- /04 Strategy Library/16 Overnight Anomaly/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/16 Overnight Anomaly/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/162 Momentum Effect in Stocks in Small Portfolios/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | The main reason for the momentum anomaly is the behavioral biases of the investor like underreaction and confirmation bias. 3 | Momentum strategy usually uses portfolios filled by thousands of stocks to compute the momentum factor return. 4 | This is not possible for small retail investors with small portfolios. They are constrained compared to big hedge funds and cannot diversify so well. 5 | In this tutorial, we'll construct a small portfolio consisting of up to 50 stocks to check the effect of momentum. 6 |

7 | -------------------------------------------------------------------------------- /04 Strategy Library/162 Momentum Effect in Stocks in Small Portfolios/01 简介.cn.html: -------------------------------------------------------------------------------- 1 |

2 | 动量异常的主要原因是投资者的行为偏差,例如反应不足和确认偏差。动量策略通常会使用由成千上万只股票组成的投资组合来计算动量要素收益。这对于持有小型投资组合的小型散户投资者来说是不可能的。与大型对冲基金相比,它们受到限制,无法进行多样化投资。在本教程中,我们将构建一个由50支股票组成的小型投资组合,以检查动量所产生影响。 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/162 Momentum Effect in Stocks in Small Portfolios/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/162 Momentum Effect in Stocks in Small Portfolios/03 算法.cn.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/162 Momentum Effect in Stocks in Small Portfolios/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/162 Momentum Effect in Stocks in Small Portfolios/04 来源.cn.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/17 Forex Momentum/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Momentum is a trend following strategy, where the strategy buys the assets which have performed well in the past and sells the assets which have performed bad. 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/17 Forex Momentum/02 Method.html: -------------------------------------------------------------------------------- 1 |

2 | This algorithm applies momentum to the forex market. Our universe consists of 15 forex pairs 3 | and covers period from 2006 to 2018. The algorithm goes long 3 currencies with strongest 12-month 4 | momentum against USD and goes short 3 currencies with lowest 12-month momentum against USD. 5 |

6 | -------------------------------------------------------------------------------- /04 Strategy Library/17 Forex Momentum/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/17 Forex Momentum/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/18 Volatility Effect in Stocks/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | The low volatility effect in equities refers to that stocks which previously 3 | exhibited lower volatility will earn higher risk-adjusted returns than those with higher volatility. 4 | This algorithm extends the study of the low volatility effect to U.S stocks with higher market capital. 5 |

6 | -------------------------------------------------------------------------------- /04 Strategy Library/18 Volatility Effect in Stocks/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/18 Volatility Effect in Stocks/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/19 Pairs Trading with Stocks/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | The pairs trading algorithm aims to find two stocks which have prices that moved historically together. 3 | If price series diverges, long and short positions are opened in the opposite direction. With the assumption 4 | of mean reversion, the algorithm expects to make profits from the abnormal fluctuation of prices. 5 | The crucial part of pairs trading is determining which stocks are correlated and how to define a price divergence. 6 |

7 | -------------------------------------------------------------------------------- /04 Strategy Library/19 Pairs Trading with Stocks/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/19 Pairs Trading with Stocks/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/198 Exploiting Term Structure of VIX Futures/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/198 Exploiting Term Structure of VIX Futures/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/199 ROA Effect within Stocks/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Return on Equity(ROE) is defined as the ratio of net income over shareholders equity, 3 | where shareholders’ equity is the difference between a company's total assets and total liabilities. Shareholders' equity is often referred to as the book value of the company. 4 | ROE is a measure of how efficiently a company uses its assets to produce earnings. It can explain many anomalies related to earnings and profitability. This algorithm will build a long-short portfolio with ROE factor. 5 |

6 | -------------------------------------------------------------------------------- /04 Strategy Library/199 ROA Effect within Stocks/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/199 ROA Effect within Stocks/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/20 Forex Carry Trade/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Carry trade is very common in the foreign exchange market. 3 | The strategy systematically sells low-interest rate currencies and buys high-interest rates currencies. The “carry” of an asset is the opportunity cost of holding that asset. Carry trade strategy holds one currency relative to another in order to capture the spread between the rates. We can think of this strategy as borrowing money from one country with a lower interest rate and investing it in another country with a higher interest rate. 4 |

5 | -------------------------------------------------------------------------------- /04 Strategy Library/20 Forex Carry Trade/01 简介.cn.html: -------------------------------------------------------------------------------- 1 |

2 | 套利交易在外汇市场上很常见。此策略系统性地出售低利率货币,买入高利率货币。资产的“套利”是持有该资产的机会成本。套利交易策略持有相对于其他货币的某一种货币,以获取利率之间的价差。我们可以把这种策略看作是从一个利率较低的国家借钱,然后将钱投资到另一个利率较高的国家。 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/20 Forex Carry Trade/02 方法.cn.html: -------------------------------------------------------------------------------- 1 |

导入自定义数据

2 |

3 | 央行利率数据来自Quandl。对于交易集合来说,我们选择了央行利率数据在Quandl中可用的9种货币。导入自定义数据的方法是AddData(type, symbol, resoltuion, timeZone, fillDataForward)。由于自定义文件具有唯一的colume名称,因此我们需要创建一个类别来指定利率的colume名称。 4 |

5 |
6 |
 7 | from QuantConnect.Python import PythonQuandl
 8 | class QuandlRate(PythonQuandl):
 9 |     def __init__(self):
10 |         self.ValueColumnName = 'Value'
11 | 
12 |
13 |

14 | 我们将利率符号和对应的外汇资产符号保存到字典中。 15 |

16 |

每月调整交易

17 |

18 | 下一步,我们根据利率的值对外汇符号进行排序。这种算法会做多利率最高的货币,做空利率最低的货币。该战略每月都会重新调整。采用日程事件法在每个月的第一个交易日触发重新调整事件。 19 |

20 | -------------------------------------------------------------------------------- /04 Strategy Library/20 Forex Carry Trade/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/20 Forex Carry Trade/03 算法.cn.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/20 Forex Carry Trade/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/20 Forex Carry Trade/04 来源.cn.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/207 Value Effect within Countries/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Equity valuation may be a predictive signal for future equity return. There are various methodologies to evaluate whether 3 | the equity is undervalued or overvalued using metrics like price-to-earnings (P/E), return on equity (ROE), dividend yield, book-to-equity and so on. 4 | In this algorithm, we use a ten-year normalized earnings metrics invented by Yale University professor Robert Shiller to find the fair value of the equity market. 5 |

6 | -------------------------------------------------------------------------------- /04 Strategy Library/207 Value Effect within Countries/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/207 Value Effect within Countries/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/21 Momentum Effect in Stocks/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | The momentum anomaly says that what was strongly going up in the near past will probably continue to go up shortly. Stocks which outperform peers on 3-12 month period tend to perform well also in the future. This algorithm will explore the momentum effect on large-cap stocks. 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/21 Momentum Effect in Stocks/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/21 Momentum Effect in Stocks/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/211 Mean-Reversion Statistical Arbitrage Strategy in Stocks/03 Results.html: -------------------------------------------------------------------------------- 1 |

2 | In our alorithm, the portfolio is rebalanced every 30 days and the backtest period runs from Jan 2010 to Aug 2019. 3 | Our result is an annual rate of return over 7% with a max drawdown of around 40% for nearly 10 years. Our performance indicates 4 | using PCA combined with linear regression to measure the deviation level is reasonable. 5 |

6 |

7 | To tune the model, we could expand our universe of stocks beyond the current 20 equities or incorporate more PCA components. 8 | We could also come up with another way to measure the level of deviation or change the rebalance frequency of the algorithm 9 | (30 days in this example). 10 |

11 | 12 | -------------------------------------------------------------------------------- /04 Strategy Library/211 Mean-Reversion Statistical Arbitrage Strategy in Stocks/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/211 Mean-Reversion Statistical Arbitrage Strategy in Stocks/05 Reference.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/22 Momentum Effect in Country Equity Indexes/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | This algorithm examines the momentum effect in country indexes exchange-traded funds. 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/22 Momentum Effect in Country Equity Indexes/01 简介.cn.html: -------------------------------------------------------------------------------- 1 |

2 | 此算法检验了国家指数交易所交易基金的动量效应。 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/22 Momentum Effect in Country Equity Indexes/02 方法.cn.html: -------------------------------------------------------------------------------- 1 |

2 | 此算法选取35个国家的指数基金作为交易集合。由于集合中的符号不会随时间发生变化,我们使用动量指示器辅助方法self.MOM(symbol, period, resolution)。这种辅助方法会创建一个新的动量指示器,并计算证券在绝对n周期中的变化。与指示器构造函数Momentum(period)相反,辅助方法指示器将根据给定的分辨率自动更新。 3 |

4 |

5 | 在Initialize()中,我们将预热周期设置为动量周期并创建字典self.data,以保存每个符号的指示符。每个月,将选择6个月势头最好的前5支指数基金进行多头仓位。没有列在榜首的基金将被斩仓。采用日程事件API制定投资组合,在每个月月初时重新平衡。 6 |

7 | -------------------------------------------------------------------------------- /04 Strategy Library/22 Momentum Effect in Country Equity Indexes/03 Conclusion.html: -------------------------------------------------------------------------------- 1 |

2 | The algorithm result shows that momentum effects do exist in the country indices. 3 | The strategy of holding for one month, a portfolio of the five best performing country indices ETFs over the previous six months, was found to out-perform the equal-weighted portfolio by around 40% per annum over the 16-year period from 2002 to 2018. 4 |

5 | -------------------------------------------------------------------------------- /04 Strategy Library/22 Momentum Effect in Country Equity Indexes/03 结论.cn.html: -------------------------------------------------------------------------------- 1 |

2 | 算法结果表明,国家指数存在动量效应。在2002年至2018年的16年时间里,持有一个月的策略(即在过去6个月中表现最好的5个国家指数基金投资组合)的表现每年要超出平均加权投资组合约40%。 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/22 Momentum Effect in Country Equity Indexes/05 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/22 Momentum Effect in Country Equity Indexes/05 来源.cn.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/229 Earnings Quality Factor/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Multiple factors can explain abnormal equity returns which could be used to build profitable equity long-short strategy. 3 | The most common factors are momentum, short-term reversal, market value, size factors and so on. 4 | In this tutorial, we will choose a few factors associated with earnings quality to investigate the return premium on stocks. 5 |

6 | -------------------------------------------------------------------------------- /04 Strategy Library/229 Earnings Quality Factor/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/229 Earnings Quality Factor/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/23 Mean Reversion Effect in Country Equity Indexes/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Mean reversion in stock price is the assumption that the price will tend to move back to the average price over time. 3 | Mean reversion trading often refers to counter-trend or reversal trading. This algorithm will explore the mean reversion effect in country equity indexes. 4 |

5 | -------------------------------------------------------------------------------- /04 Strategy Library/23 Mean Reversion Effect in Country Equity Indexes/02 Method.html: -------------------------------------------------------------------------------- 1 |

2 | The investment universe consists of 19 ETFs which invest in individual country equity indexes. 3 | The strategy is going to long on the bottom four countries with the worst 36-month return and short on the top 4 countries with the best 36-month return. The helper indicator method self.ROC(symbol, period, resolution) 4 | is used to calculate 36-month return where the resolution is daily and the period is 36*21. 5 |

6 |

7 | The portfolio is reweighted every three years. We schedule the event to fire every month. self.months is the variable to save the number of months, and the algorithm jumps the rebalance execution if the amount of passed months does not equate to 36. 8 |

9 | -------------------------------------------------------------------------------- /04 Strategy Library/23 Mean Reversion Effect in Country Equity Indexes/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/23 Mean Reversion Effect in Country Equity Indexes/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/24 Liquidity Effect in Stocks/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Liquidity has a powerful impact on price and the valuation of equities. Stocks with little liquidity are used to earning higher returns than stocks with high liquidity. In this algorithm, we present the effect of liquidity on returns for the lowest capitalization quartile from the largest 1500 stocks. 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/24 Liquidity Effect in Stocks/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/24 Liquidity Effect in Stocks/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/25 Volatility Risk Premium Effect/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Long volatility means that the value of your portfolio increases when the volatility goes up. 3 | Short volatility means that you make money when the volatility goes down. The simplest example of volatility selling involves the sale of put and call contracts. 4 | Traders often long volatility by holding the long position of put or call options for hedging purpose. 5 | In contrast, the short volatility strategy expects to earn the systematic risk premium by selling options. 6 | This algorithm will explore the risk premium effect in volatility selling. 7 |

8 | -------------------------------------------------------------------------------- /04 Strategy Library/25 Volatility Risk Premium Effect/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/25 Volatility Risk Premium Effect/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/269 Seasonality Effect based on Same-Calendar Month Returns/03 Results.html: -------------------------------------------------------------------------------- 1 |

2 | In backtesting our algorithm achieves a Sharpe ratio of 0.332 relative to S&P 500 (SPY) Sharpe ratio of 0.893 for the past 10 years. 3 | The performance indicates using the idea of same-calendar month returns makes sense. Interested users can build upon this implementation by trying the following extensions: 4 |

5 |
    6 |
  1. Using the same-calendar months of multiple years (e.g. the last 5 years), instead of using the previous year as we did in this tutorial, to get more stable monthly returns.
  2. 7 |
  3. Using discounting to capture time effects in the returns.
  4. 8 |
  5. Creating the initial universe using different criteria such as quarterly, rather than monthly, returns.
  6. 9 |
-------------------------------------------------------------------------------- /04 Strategy Library/269 Seasonality Effect based on Same-Calendar Month Returns/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/269 Seasonality Effect based on Same-Calendar Month Returns/05 Reference.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/27 Momentum Effect in Commodities Futures/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Commodity futures are excellent portfolio diversifiers and some of them are an effective hedge against inflation. 3 | This algorithm will explore the momentum effect in commodity futures with the momentum return. 4 |

5 | -------------------------------------------------------------------------------- /04 Strategy Library/27 Momentum Effect in Commodities Futures/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/27 Momentum Effect in Commodities Futures/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/270 Risk Premia in Forex Markets/03 Results.html: -------------------------------------------------------------------------------- 1 |

2 | In this case our backtest results in a low annual return of approximately -0.7% over a decade. The poor performance may be due to several reasons: 3 |

    4 |
  1. The fixed forex universe chosen is not large enough to properly diversify market risk
  2. 5 |
  3. The thresholds for entering long and short positions (0.6, -0.6) may need adjustment
  4. 6 |
  5. The length of historical data might be not large enough for this weekly-rebalanced strategy.
  6. 7 |
8 | We encourage the community to further develop this strategy by testing out different symbols, thresholds, and historical data lengths. 9 |

-------------------------------------------------------------------------------- /04 Strategy Library/270 Risk Premia in Forex Markets/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/270 Risk Premia in Forex Markets/05 Reference.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/271 Price and Earning Momentum/03 Results.html: -------------------------------------------------------------------------------- 1 |

2 | Our backtest results in a Sharpe ratio of 0.59 while the SP500 Sharpe ratio is 0.8 during the same decade. This performance may be due to several factors: 3 |

    4 |
  1. The number of stocks in our portfolio, 100, could be too low.
  2. 5 |
  3. Equal weighting for all stocks may not fully capture the strength of higher ranking stocks.
  4. 6 |
  5. Rebalancing quarterly may be too frequent for a momentum strategy in equities.
  6. 7 |
8 | This tutorial shows us how to take advantage of the techniques of requesting historical data and using a RollingWindow. We hope the community can further develop strategies based on these techniques. 9 |

-------------------------------------------------------------------------------- /04 Strategy Library/271 Price and Earning Momentum/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/271 Price and Earning Momentum/05 Reference.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/28 Small Capitalization Stocks Premium Anomaly/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Small caps are typically defined as companies with market caps that are less than $2 billion. 3 | The advantage of investing in small cap companies is that they are young companies with significant growth potential. 4 | However, the risk of failure is greater with small-cap stocks than with large-cap and mid-cap stocks. 5 | In this algorithm, we will explore the performance of the small-capitalization investment. 6 |

7 | -------------------------------------------------------------------------------- /04 Strategy Library/28 Small Capitalization Stocks Premium Anomaly/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/28 Small Capitalization Stocks Premium Anomaly/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/29 Term Structure Effect in Commodities/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | The term structure of commodities usually refers to the difference between futures prices of different maturities at a given time point. The shape of the futures curve is essential to commodity hedgers and speculators as futures price serves as a forecast of future spot price. The futures price curve contains the information about futures supply and demand conditions. This algorithm will examine the role of term structure signals for the design of profitable trading strategies in commodity futures markets. 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/29 Term Structure Effect in Commodities/04 References.html: -------------------------------------------------------------------------------- 1 | 2 |
    3 |
  1. 4 | Fuertes, Ana-Maria and Miffre, Joëlle and Rallis, Georgios, Tactical Allocation in Commodity Futures Markets: Combining Momentum and Term Structure Signals (April 22, 2010). Journal of Banking and Finance 34, 2530-2548. Online Copy 5 |
  2. 6 |
  3. 7 | Jez Liberty, Roll Yield and Commodity Yield Curve (July 19th, 2010). Automated Trading System Online Copy 8 |
  4. 9 |
10 | -------------------------------------------------------------------------------- /04 Strategy Library/29 Term Structure Effect in Commodities/05 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/30 Momentum Effect Combined with Term Structure in Commodities/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/30 Momentum Effect Combined with Term Structure in Commodities/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/31 Book-to-Market Value Anomaly/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/31 Book-to-Market Value Anomaly/04 Summary.html: -------------------------------------------------------------------------------- 1 |

2 | The portfolio underperforms relatively to the benchmark, S&P 500, during the backtest period. 3 |

4 |

5 | In general, stocks that have a low B/P ratio are considered to be value stocks, and similarly, stocks that have a high B/P ratio are referred to as growth stocks. 6 |

7 |

8 | During a bull market, which is associated with high GDP growth, value stocks tend to underperform growth stocks, as investors are optimistic about future earnings growth. 9 |

10 | -------------------------------------------------------------------------------- /04 Strategy Library/31 Book-to-Market Value Anomaly/05 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/32 Gold Market Timing/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Gold plays an essential role as a diversifier due to its low or negative correlation to other asset classes. We explore "The Fed Model," a theory that bonds can be used to judge whether the U.S. stock market is fairly valued and use this to determine entry and exit points for gold. 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/32 Gold Market Timing/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/32 Gold Market Timing/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/33 Paired Switching/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Paired switching is a strategy where in its simplest form, investors pick two assets that are negatively correlated and periodically switch position based on their relative performance. The idea behind this strategy is that if the assets are negatively correlated, then a traditional mixed portfolio might lead to a lower return than the return for the individual assets. If the negative correlation exists, switching positions could improve the performance of a portfolio where two assets are statically weighted. 3 |

-------------------------------------------------------------------------------- /04 Strategy Library/33 Paired Switching/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/33 Paired Switching/04 Source.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04 Strategy Library/34 Momentum-Short Term Reversal Strategy/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | Momentum effect is an anomaly in nearly every market. However, if a stock in the winner group is in the final stages of overreaction, it is not the best long opportunity because of the high probability of its reversal, and therefore profit reduction. Similarly, in the loser group, a stock which is in the final stages of overreaction is also not the best short opportunity because its reversal would lower the profit of short selling within a short time. Based on this logic, 3 | this momentum-reversal strategy seeks to buy winners and sell losers that are less likely to be in the final stages of overreaction. 4 |

5 | -------------------------------------------------------------------------------- /04 Strategy Library/34 Momentum-Short Term Reversal Strategy/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/34 Momentum-Short Term Reversal Strategy/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/35 Turn of the Month in Equity Indexes/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | The turn of the month is an effect on stock indices which states that stocks will rise during the last day before the end of the month and the first three days of each month. Researchers believe this significance comes as a result of pension funds receiving cash flows and reinvesting in the market, along with this period being a natural point for portfolio rebalancing between retail and professional investors. This algorithm is an approximation of the following strategy. 3 |

4 | -------------------------------------------------------------------------------- /04 Strategy Library/35 Turn of the Month in Equity Indexes/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/35 Turn of the Month in Equity Indexes/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/353 Fama French Five Factors/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

2 | The relationship between return and risk has long been a popular topic for research. Investors have been seeking financial models that quantify risk and use it to estimate the expected return on equity. The Fama French five-factor model, improved from the Fama French three-factor model, is one of the most classic models (Fama and French, 2015). In this post, we will discuss this model and develop a stock-picking strategy based on it. 3 |

-------------------------------------------------------------------------------- /04 Strategy Library/353 Fama French Five Factors/04 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
7 | -------------------------------------------------------------------------------- /04 Strategy Library/353 Fama French Five Factors/05 References.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04 Strategy Library/354 Expected Idiosyncratic Skewness/01 Abstract.html: -------------------------------------------------------------------------------- 1 |

2 | This tutorial implements a strategy that trades stocks with low expected idiosyncratic skewness based on a paper by Boyer, Mitton and Vorkink (2009, hereafter BMV) published in The Review of Financial Studies. Our implementation narrows down our initial universe to liquid assets by selecting 200 stocks based on daily trading volume, price and whether the stock has fundamental data in our data library. We calculate the expected idiosyncratic skewness at the end of each month and sort our universe based on the calculated skewness. This implementation will long the bottom 5%, hold for the next month, and rebalance the portfolio monthly. The Sharpe ratio is 1.03 relative to S&P 500 (SPY) Sharpe ratio of 1.00 during the period of July 1, 2009 to July 30, 2019. 3 |

-------------------------------------------------------------------------------- /04 Strategy Library/354 Expected Idiosyncratic Skewness/06 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
-------------------------------------------------------------------------------- /04 Strategy Library/355 Standardized Unexpected Earnings/01 Abstract.html: -------------------------------------------------------------------------------- 1 |

2 | This tutorial implements a strategy that standardizes the unexpected earnings of stocks and trades the top 5% of those standardized stocks. It is written based on a paper published in The Accounting Review by Foster, Olsen, and Shevlin (1984). Our implementation narrows down our universe to 1000 liquid assets based on daily trading volume and price, and the availability of fundamental data on the stocks in our data library. We calculate the unexpected earnings at the beginning of each month, standardize the unexpected earnings, go long on the top 5%, and rebalance the portfolio monthly. We observed a Sharpe ratio of 0.83 relative to SPY Sharpe of 0.88 using this implementation during the period of December 1, 2009 to September 1, 2019 in backtesting. 3 |

-------------------------------------------------------------------------------- /04 Strategy Library/355 Standardized Unexpected Earnings/02 Theory.html: -------------------------------------------------------------------------------- 1 |

2 | In market efficiency literature, one frequently discussed topic is the anomalous behavior of stock returns following earnings announcements. The market does not adjust to news from earning announcements instantaneously. Instead, many studies report evidence that the direction and magnitude of returns in the post-earnings announcement period are positively correlated with the direction and magnitude of the unexpected component in the earnings releases. This observed phenomenon is consistent with suggestions that the capital market is inefficient. 3 |

-------------------------------------------------------------------------------- /04 Strategy Library/355 Standardized Unexpected Earnings/05 Algorithm.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |
6 |
-------------------------------------------------------------------------------- /04 Strategy Library/355 Standardized Unexpected Earnings/06 References.html: -------------------------------------------------------------------------------- 1 |
    2 |
  1. 3 | Foster G, Olsen C, Shevlin T. Earnings releases, anomalies, and the behavior of security returns. Accounting Review. 1984 Oct 1:574-603 Online Copy 4 |
  2. 5 |
  3. 6 | Hou K, Xue C, Zhang L. Replicating Anomalies. The Review of Financial Studies Online Copy 7 |
  4. 8 |
      9 | -------------------------------------------------------------------------------- /04 Strategy Library/356 Improved Momentum Strategy on Commodities Futures/01 Abstract.html: -------------------------------------------------------------------------------- 1 |

      2 | In this tutorial we implement a correlation-adjusted time-series momentum strategy (TSMOM-CF) that addresses three weaknesses typically found in traditional time-series momentum strategies (TSMOM). Our implementation is based on the paper "Demystifying Time-Series Momentum Strategies: Volatility Estimators, Trading Rules and Pairwise Correlations" by Nick Baltas and Robert Kosowski. We will also compare TSMOM-CF to the basic momentum strategy implemented in our strategy library - Momentum Effect in Commodities Futures. 3 |

      -------------------------------------------------------------------------------- /04 Strategy Library/356 Improved Momentum Strategy on Commodities Futures/05 Summary.html: -------------------------------------------------------------------------------- 1 |

      2 | The implementation of TSMOM-CF in the post-GFC period, January 2018 to September 2019, shows significant performance improvement over the basic TSMOM. The backtest of TSMOM-CF produces Sharpe ratio of 0.321, compared to TSMOM's Sharpe ratio of -0.746 and SPY Sharpe ratio of 0.46. The exact TSMOM algorithm can be found in the strategy library. 3 |

      -------------------------------------------------------------------------------- /04 Strategy Library/356 Improved Momentum Strategy on Commodities Futures/06 Algorithm.html: -------------------------------------------------------------------------------- 1 |
      2 |
      3 |
      4 | 5 |
      6 |
      7 | -------------------------------------------------------------------------------- /04 Strategy Library/356 Improved Momentum Strategy on Commodities Futures/07 References.html: -------------------------------------------------------------------------------- 1 |
        2 |
      1. 3 | Baltas, Nick & Kosowski, Robert. (2017). Demystifying Time-Series Momentum Strategies: Volatility Estimators, Trading Rules and Pairwise Correlations. SSRN Electronic Journal. 10.2139/ssrn.2140091. Online Copy 4 |
      2. 5 |
      3. 6 | Yang, Dennis & Zhang, Qiang. (2000). Drift-Independent Volatility Estimation Based on High, Low, Open, and Close Prices. The Journal of Business, 73(3), 477-492. doi:10.1086/209650. Online Copy 7 |
      4. 8 |
          -------------------------------------------------------------------------------- /04 Strategy Library/357 Commodities Futures Trend Following/01 Abstract.html: -------------------------------------------------------------------------------- 1 |

          2 | In this tutorial we implement a trend following strategy on commodities futures based on a 2014 paper "Two Centuries Of Trend Following" by Y. Lempérière, C. Deremble, P. Seager, M. Potters, and J. P. Bouchaud. 3 |

          -------------------------------------------------------------------------------- /04 Strategy Library/357 Commodities Futures Trend Following/05 Algorithm.html: -------------------------------------------------------------------------------- 1 |
          2 |
          3 |
          4 | 5 |
          6 |
          7 | -------------------------------------------------------------------------------- /04 Strategy Library/357 Commodities Futures Trend Following/06 References.html: -------------------------------------------------------------------------------- 1 |
            2 |
          1. 3 | Y. Lempérière, C. Deremble, P. Seager, M. Potters, J. P. Bouchaud (2014). Two centuries of trend following. Online Copy 4 |
          2. 5 |
              -------------------------------------------------------------------------------- /04 Strategy Library/36 Sentiment and Style Rotation Effect in Stocks/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | Growth stocks refer to high-quality, successful companies whose earnings are expected to continue growing at an above-average rate relative to the market. 3 | Growth stocks generally have high price-to-earnings (P/E) ratios and high price-to-book(P/B) ratios. At times, growth stocks are considered expensive and overvalued. The value stocks refer to stocks which have high dividend payout ratios or low financial ratios such as P/E ratios and P/B ratios. The value stocks are often considered undervalued by the market. This algorithm will create the long-short positions based on the relation between investor sentiment and the performance of value stocks over growth stocks. 4 |

              5 | -------------------------------------------------------------------------------- /04 Strategy Library/36 Sentiment and Style Rotation Effect in Stocks/01 简介.cn.html: -------------------------------------------------------------------------------- 1 |

              2 | 成长型股票指的是高质量、成功的公司,它们的盈利预期将继续以高于市场平均水平的速度增长。成长型股票通常具有高市盈率(P/E)和高市净率(P/B)。有时,成长型股票被认为价格过高。价值型股票是指股息率高或财务比率(如市盈率和市净率)低的股票。价值型股票通常会被市场低估。此算法将基于投资者情绪和价值型股票相对于成长型股票表现之间的关系来建立多空头寸。 3 |

              4 | -------------------------------------------------------------------------------- /04 Strategy Library/36 Sentiment and Style Rotation Effect in Stocks/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              7 | -------------------------------------------------------------------------------- /04 Strategy Library/36 Sentiment and Style Rotation Effect in Stocks/03 算法.cn.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              7 | -------------------------------------------------------------------------------- /04 Strategy Library/36 Sentiment and Style Rotation Effect in Stocks/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/36 Sentiment and Style Rotation Effect in Stocks/04 来源.cn.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/37 Momentum and State of Market Filters/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | The momentum effect states that what was strongly going up in the near past will probably continue to go up shortly. It is one of the most used trading anomalies, but the strategy using only the momentum can suffer significant drawdowns sometimes. 3 | 4 | Some research papers show that the return of momentum strategies depend on the overall market conditions. 5 | This state of the market can be defined in various ways like the investors' sentiment, prior market returns and so on. 6 | Therefore, this algorithm will combine the momentum effect with the market state filter to turn off the momentum trading in down market state times. 7 |

              8 | -------------------------------------------------------------------------------- /04 Strategy Library/37 Momentum and State of Market Filters/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              7 | -------------------------------------------------------------------------------- /04 Strategy Library/37 Momentum and State of Market Filters/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/38 Accrual Anomaly/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | Accrual anomaly is based upon the reasoning that it is important to measure if a company's earnings are based on real cash inflow or on revenue recognition from questionable accounting practices. Since companies with lower levels of accruals have more certain real earnings, they should earn higher market returns. This strategy will take a long position in low accrual companies and a short position in high accrual accompanies. It is important to note that this strategy requires fundamental data from the current and past year in order to perform its analysis. As a result, it won't be implementable in live trading at this time. 3 |

              -------------------------------------------------------------------------------- /04 Strategy Library/38 Accrual Anomaly/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              7 | -------------------------------------------------------------------------------- /04 Strategy Library/38 Accrual Anomaly/04 Source.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04 Strategy Library/39 Asset Growth Effect/01 简介.cn.html: -------------------------------------------------------------------------------- 1 |

              2 | 资产增长效基于高资产增长股票的表现弱于低资产增长股票。一些研究认为,低资产成长型股票的收益溢价与风险补偿是一致的。有两种流行的观点支持这种回报溢价。一种观点是,随着公司的成长,公司的资产组合风险会降低,因为现有资产取代了公司未来预期投资的资产价值。第二种观点是,由于将过去的收益推断为高资产成长型企业的增长,导致了对成长型企业的系统性市场定价错误。 3 |

              4 |

              5 | 这一策略将在低资产增长型公司做多,同时在高资产增长的公司做空。值得注意的是,这一策略需要根据当前和过去一年的基本数据来进行分析。因此,这种策略需要一年的实时交易时间来确定信号。 6 |

              -------------------------------------------------------------------------------- /04 Strategy Library/39 Asset Growth Effect/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              7 | -------------------------------------------------------------------------------- /04 Strategy Library/39 Asset Growth Effect/03 算法.cn.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              7 | -------------------------------------------------------------------------------- /04 Strategy Library/39 Asset Growth Effect/04 Source.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04 Strategy Library/39 Asset Growth Effect/04 来源.cn.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04 Strategy Library/40 Pairs Trading with Country ETFs/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | Pairs trading is a non-directional, market-neutral trading strategy which seeks to identify the price divergence from two highly correlated assets. 3 | Pairs trading assumes the co-movement and the mean reversion of two asset prices. It indicates that the price of selected assets 4 | tend to move together, and when they diverge, we can exploit the investment opportunity by taking a market neutral position as we assume their price will tend to move back to the average price over time. 5 | In this algorithm, we use a large family of international exchange-traded funds(ETFs) to examine the performance of the pairs trading strategy. 6 |

              7 | -------------------------------------------------------------------------------- /04 Strategy Library/40 Pairs Trading with Country ETFs/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              7 | -------------------------------------------------------------------------------- /04 Strategy Library/40 Pairs Trading with Country ETFs/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/58 VIX Predicts Stock Index Returns/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | VIX index is the weighted average of the implied volatilities computed from a total of eight near-the-money, nearby and second nearby American option contracts on the underlying S&P100 index. The index is calculated on an intraday basis by the CBOE. 3 | The extreme levels of the VIX index are a strong indicator of equity index returns. 4 | One could anticipate that the higher the fear in the markets, indicated by the VIX index, the higher the subsequent returns on the broad equity index. 5 | In this algorithm, we will explore if VIX index is the forward-looking indicator of future stock index returns. 6 |

              7 | -------------------------------------------------------------------------------- /04 Strategy Library/58 VIX Predicts Stock Index Returns/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              7 | -------------------------------------------------------------------------------- /04 Strategy Library/58 VIX Predicts Stock Index Returns/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/61 Lunar Cycle in Equity Market/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | The lunar phase is the shape of the direct sunlight portion of the Moon as viewed from Earth. 3 | The lunar phases gradually and cyclically change over the period of a month. 4 | Lunar phases have proven effects on human biology and psychology. 5 | Investors are subject to various psychological and behavioral biases and mood fluctuations. 6 | Therefore if lunar phases affect mood, by extension, these phases may affect investor behavior and thus asset prices. 7 | This tutorial we will build an algorithm based upon the Moon phase. 8 |

              9 | -------------------------------------------------------------------------------- /04 Strategy Library/61 Lunar Cycle in Equity Market/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              7 | -------------------------------------------------------------------------------- /04 Strategy Library/61 Lunar Cycle in Equity Market/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/66 Combining Momentum Effect with Volume/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | The Momentum traders take on a long or short position in the stock, in the hopes that the momentum will continue in the same direction. 3 | The momentum strategy has a higher degree of volatility than most other strategies. 4 | In the tutorial, we'll introduce the trading volume factor to enhance the portfolio return and control the risk of momentum strategy. 5 |

              6 | -------------------------------------------------------------------------------- /04 Strategy Library/66 Combining Momentum Effect with Volume/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              7 | -------------------------------------------------------------------------------- /04 Strategy Library/66 Combining Momentum Effect with Volume/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/71 Short Term Reversal with Futures/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | The short-term reversal strategy buys stocks which are past losers and sells stocks which are past winners. 3 | It is commonly used in the equity market. This algorithm will explore the reversal effect in the futures market. 4 | Research also suggests that trading volume contains information about future market movements. The algorithm will 5 | be constructed with both the volume and return reversal effect. 6 |

              7 | -------------------------------------------------------------------------------- /04 Strategy Library/71 Short Term Reversal with Futures/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              7 | -------------------------------------------------------------------------------- /04 Strategy Library/71 Short Term Reversal with Futures/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/77 Beta Factors in Stocks/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              7 | -------------------------------------------------------------------------------- /04 Strategy Library/77 Beta Factors in Stocks/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/78 Beta Factor in Country Equity Indexes/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | Some investors are prohibited from using leverage and other investors’ leverage is limited by margin requirements. 3 | Their only way to achieve higher returns is to buy more risky stocks which makes these assets more expensive. 4 | High-beta and risky assets should therefore deliver lower risk-adjusted returns than low-beta assets. 5 | Investors could exploit this inefficiency by using ETFs. This algorithm is going to explore this phenomenon. 6 |

              7 | -------------------------------------------------------------------------------- /04 Strategy Library/78 Beta Factor in Country Equity Indexes/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              7 | -------------------------------------------------------------------------------- /04 Strategy Library/78 Beta Factor in Country Equity Indexes/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/83 Pre-Holiday Effect/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | Pre-holiday days on the market are often characterized with lower liquidity as a lot of market participants are not involved in the market or they lower their exposure. 3 | Historical research shows that stock prices often behave in a specific manner in each of the two trading days preceding these holidays. 4 | This anomaly in equities is often called the pre-holiday effect. It is the market in-efficiency for short-term traders to gain on the final trading day before a holiday. 5 | In this algorithm, we'll construct a simple strategy to exploit this pre-holiday effect in the equity market. 6 |

              7 | -------------------------------------------------------------------------------- /04 Strategy Library/83 Pre-Holiday Effect/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              7 | -------------------------------------------------------------------------------- /04 Strategy Library/83 Pre-Holiday Effect/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/85 Momentum in Mutual Fund Returns/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | Researchers have shown that the historical returns of a mutual fund and the nearness of its net asset value (NAV) to 3 | a previous high can provide significant predictive power about the fund's future returns. In respect to the 4 | historical returns, some have attributed the persistence to investor herding and macroeconomic variables. When it 5 | comes to the NAV, some suggest the outperformance of funds with a NAV near its trailing high is a result of 6 | anchoring bias in investors' psychology. As we do not have access to invest in individual mutual funds on the QC 7 | platform or access to NAV metrics, in this tutorial, we trade asset management firms and use their respective share 8 | price as a proxy for fund performance and NAV. 9 |

              10 | -------------------------------------------------------------------------------- /04 Strategy Library/85 Momentum in Mutual Fund Returns/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              -------------------------------------------------------------------------------- /04 Strategy Library/85 Momentum in Mutual Fund Returns/05 Market & Competition Qualification.html: -------------------------------------------------------------------------------- 1 |

              2 | Although this strategy passes several of the 3 | metrics required for Alpha Streams and 4 | the Quant League competition, it requires further work to meet the following requirements: 5 |

              6 | 7 | 8 |
                9 |
              • Profitable
              • 10 |
              • PSR >= 80%
              • 11 |
              • Max drawdown duration <= 6 months
              • 12 |
              • Insights contain the following properties: Symbol, Duration, Direction, and Weight
              • 13 |
              • Minute or second data resolution
              • 14 |
              • Insight Weighting or Equal Weighting Portfolio Construction model
              • 15 |
              -------------------------------------------------------------------------------- /04 Strategy Library/85 Momentum in Mutual Fund Returns/07 References.html: -------------------------------------------------------------------------------- 1 |
                2 |
              1. 3 | Sapp, Travis, The 52-Week High, Momentum, and Predicting Mutual Fund Returns (April 1, 2010). Review of Quantitative Finance and Accounting, Vol. 37, pp. 149-179, 2011. 4 |
              2. 5 |
              -------------------------------------------------------------------------------- /04 Strategy Library/91 Momentum and Style Rotation Effect/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | Based on the market cap, we can divide the stocks into large-cap, mid-cap and small-cap stocks. In each of those categories, we can subdivide them into value stocks and growth stocks. The growth stocks typically grow revenues faster than the market average and have relatively high P/E ratios and P/B ratios. The value stocks have relatively low P/E ratios and P/B ratios. There are six styles in total. 3 | We've demonstrated various momentum strategies to generate excess returns at the firm, industry, and country level. 4 | In this algorithm, we'll explore the momentum effect at the style index ETF level. 5 |

              6 | -------------------------------------------------------------------------------- /04 Strategy Library/91 Momentum and Style Rotation Effect/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              7 | -------------------------------------------------------------------------------- /04 Strategy Library/91 Momentum and Style Rotation Effect/04 Source.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /04 Strategy Library/92 Price Earnings Anomaly/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | The Price to Earnings ratio, also known as the P/E ratio, is the ratio of a company's 3 | market price per share to the company's earnings per share. 4 |

              5 |

              6 | \[Price \ to \ Earnings\ Ratio=\frac{Market \ price \ per \ share}{Earnings \ per \ share \ from \ the \ most \ recent \ financial \ year}\] 7 |

              8 |

              9 | The P/E ratio is often used by investors to determine the valuation of a company's stock. Research suggests that a portfolio that consists of stocks with relatively low P/E 10 | ratio outperforms a portfolio that consists of stocks with relatively high P/E ratio. 11 |

              12 | -------------------------------------------------------------------------------- /04 Strategy Library/92 Price Earnings Anomaly/03 Algorithm.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              7 | -------------------------------------------------------------------------------- /04 Strategy Library/92 Price Earnings Anomaly/05 References.html: -------------------------------------------------------------------------------- 1 |
                2 |
              1. 3 | Persson E, Ståhlberg C (2006). P/E and EV/EBITDA Investment Strategies vs. the Market (Master's thesis, Linköping University, Linköping, Sweden). Online Copy 4 |
              2. 5 | 6 |
              3. 7 | Fama, Eugene F. and French, Kenneth R., Multifactor Explanations of Asset Pricing Anomalies. J. OF FINANCE, Vol. 51 No. 1, March 1996. Available at SSRN: https://ssrn.com/abstract=7365 8 |
              4. 9 |
              10 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/01 Data Types and Data Structures/01 Introduction.html: -------------------------------------------------------------------------------- 1 | 

              2 | This tutorial provides a basic introduction to the Python programming language. If you are new to Python, you should run the code snippets while reading this tutorial. If you are an advanced Python user, please feel free to skip this chapter. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/01 Data Types and Data Structures/03 Basic Math Operations.html: -------------------------------------------------------------------------------- 1 | 

              2 | The basic math operators in python are demonstrated below: 3 |

              4 | 5 |
              6 |
               7 | print("Addition ", 1+1)
               8 | print("Subtraction ", 5-2)
               9 | print("Multiplication ", 2*3)
              10 | print("Division", 10/2)
              11 | print("exponent", 2**3)
              12 | [out]:
              13 | Addition  2
              14 | Subtraction  3
              15 | Multiplication  6
              16 | Division  5
              17 | exponent 8
              18 | 
              19 |
              20 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/01 Data Types and Data Structures/06 Summary.html: -------------------------------------------------------------------------------- 1 | 

              2 | We have seen the basic data types and data structures in Python. It's important to keep practicing to become familiar with these data structures. In the next tutorial, we will cover for and while loops and logical operations in Python. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/02 Logical Operations and Loops/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | We discussed the basic data types and data structures in Python in the last tutorial. This chapter covers logical operations and loops in Python, which are very common in programming. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/02 Logical Operations and Loops/06 Summary.html: -------------------------------------------------------------------------------- 1 |

              2 | This chapter has introduced logical operations, loops, and list comprehension. In the next chapter, we will introduce functions and object-oriented programming, which will enable us to make our codes clean and versatile. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/03 Functions and Objective-Oriented Programming/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | In the last tutorial we introduced logical operations, loops and list comprehension. We will introduce functions and object-oriented programming in this chapter, which will enable us to build complex algorithms in more flexible ways. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/03 Functions and Objective-Oriented Programming/05 Summary.html: -------------------------------------------------------------------------------- 1 |

              2 | In this chapter we have introduced functions and classes. When we write a QuantConnect algorithm, we would define our algorithm as a class (QCAlgorithm). This means our algorithm inherited the QC API methods from QCAlgorithm class. 3 |

              4 | 5 |

              6 | In the next chapter, we will introduce NumPy and Pandas, which enable us to conduct scientific calculations in Python. 7 |

              8 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/04 NumPy and Basic Pandas/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | Now that we have introduced the fundamentals of Python, it's time to learn about NumPy and Pandas. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/04 NumPy and Basic Pandas/04 Summary.html: -------------------------------------------------------------------------------- 1 |

              2 | Here we have introduced NumPy and Pandas for scientific computing in Python. In the next chapter, we will dive into Pandas to learn resampling and manipulating Pandas DataFrame, which are commonly used in financial data analysis. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/05 Pandas-Resampling and DataFrame/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | In the last chapter we had a glimpse of Pandas. In this chapter we will learn about resampling methods and the DataFrame object, which is a powerful tool for financial data analysis. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/05 Pandas-Resampling and DataFrame/05 Summary.html: -------------------------------------------------------------------------------- 1 |

              2 | Hereby we introduced the most import part of python: resampling and DataFrame manipulation. We only introduced the most commonly used method in Financial data analysis. There are also many methods used in data mining, which are also beneficial. You can always check the Pandas official documentations for help. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/06 Rate of Return, Mean and Variance/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | In this chapter we are going to introduce some basic concepts in quantitative finance. We start with rate of return, mean and variance. You may think it's simple to calculate these values, however, there are number of different methods to calculate them. It's important to choose the appropriate calculation methods case by case. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/06 Rate of Return, Mean and Variance/05 Summary.html: -------------------------------------------------------------------------------- 1 |

              2 | We introduced different types of rate of return in this chapter, which could be a little bit tricky when we calculate them. Mean and standard deviation are also very important concepts when we conduct hypothesis test or measure the risk associated with a asset. We will use those concepts intensively in our later chapter. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/07 Random Variables and Distributions/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | In the last chapter we learned the definition of mean and variance, which are kind of point estimation. Point estimation means using sample data to calculate a single value which is to serve as a 'best estimation' of an unknown population. However, this it not enough because point estimations can be deceiving. We need to use more rigorous methods to test our ideas. That's why we consider distribution and hypothesis testing. Random variable distribution is the basis for almost all quantitative finance topics: linear regression, CAPM, Black-Scholes, binomial tree pricing, etc. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/07 Random Variables and Distributions/05 Summary.html: -------------------------------------------------------------------------------- 1 |

              2 | In this chapter we introduced random variable, the difference between discrete random distribution and continuous random distribution, and most importantly, normal distribution. In the next chapter we will introduce how to use these distributions to test our idea or generating trading signals. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/08 Confidence Interval and Hypothesis Testing/04 Summary.html: -------------------------------------------------------------------------------- 1 |

              2 | In this chapter we introduced confidence interval, especially that for the normal distribution, and hypothesis test. Now we know how to test our idea rigorously. Normal distribution and it's confidence interval can be applied to many quantitative finance theories, we will see it frequently in our following tutorials. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/09 Simple Linear Regression/06 Summary.html: -------------------------------------------------------------------------------- 1 |

              2 | In this chapter we introduced how to implement simple linear in python, and focused on how to read the summary table. In next chapter we will introduced multiple linear regression, which are commonly used to built models in finance and economics. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/10 Multiple Linear Regression/01 Introduction.html: -------------------------------------------------------------------------------- 1 | 

              2 | In the last chapter we introduced simple linear regression, which has only one independent variable. In this chapter we will learn about linear regression with multiple independent variables. 3 |

              4 |

              5 | A simple linear regression model is written in the following form: 6 |

              7 | \[ Y = \alpha + \beta X + \epsilon \] 8 | 9 |

              10 | A multiple linear regression model with p variables is given by: 11 |

              12 | \[ Y = \alpha + \beta_1 X_1 + \beta_2 X_2 + \dots + \beta_p X_p + \epsilon \] 13 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/10 Multiple Linear Regression/05 Summary.html: -------------------------------------------------------------------------------- 1 | 

              2 | In this chapter we have introduced multiple linear regression, F test and residual analysis, which are the fundamentals of linear models. In the next chapter we will introduce some linear algebra, which are used in modern portfolio theory and CAPM. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/10 Multiple Linear Regression/06 References.html: -------------------------------------------------------------------------------- 1 |
                2 |
              1. 3 | mba.tuck.dartmouth.edu/pages/faculty/ken.french/Data_Library/f-f_factors.html 4 |
              2. 5 |
              6 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/11 Linear Algebra/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | Many papers in statistics and quantitative finance make heavy use of linear algebra, so you need to have a working knowledge of it in order to read and apply them to your trading. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/11 Linear Algebra/07 Summary.html: -------------------------------------------------------------------------------- 1 |

              2 | In this chapter we have introduced vectors, matrices, inverse matrices and linear equations. Some applications in finance include: finding arbitrage opportunities by solving linear equations, computing portfolio variance, etc. In the next chapter, we will introduce modern portfolio theory and CAPM. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/12 Modern Portfolio Theory/01 Introduction.html: -------------------------------------------------------------------------------- 1 | 

              2 | The Modern Portfolio Theory (MPT) suggests how investors should spread their wealth across various assets to minimize risk and maximize return. 3 | This chapter is mathematically intense, so don't feel demoralized if you don't understand it on your first reading. 4 |

              5 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/12 Modern Portfolio Theory/05 Summary.html: -------------------------------------------------------------------------------- 1 | 

              2 | In this chapter we have learnt about the modern portfolio theory. It recommends investors to spread their wealth across many asset classes to maximize returns while minimizing risk. In the next chapter, we will introduce the Capital Asset Pricing Model. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/12 Modern Portfolio Theory/06 Algorithm.html: -------------------------------------------------------------------------------- 1 | 

              2 | Mean-variance analysis is used to optimize portfolios with several strategies. Here we treat Dow 30 stocks as strategy and designed an algorithm to test mean-variance analysis: 3 |

              4 |
              5 |
              6 |
              7 | 8 |
              9 |
              10 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/13 Market Risk/01 Introduction.html: -------------------------------------------------------------------------------- 1 | 

              2 | In the financial literature, you may hear terms like the "beta" or "market risk" of an asset. This chapter will explain where these terms come from and how they can be useful. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/13 Market Risk/05 Summary.html: -------------------------------------------------------------------------------- 1 |

              2 | This chapter has explained what market risk means in the context of CAPM, and how market risk can be reduced. In the next chapter we will generalize CAPM to multi-factor models, such as the Fama-French models. 3 |

              4 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/14 Fama-French Multi-Factor Models/01 Introduction.html: -------------------------------------------------------------------------------- 1 | 

              2 | In previous chapters, we learnt that the Capital Asset Pricing Model (CAPM) treats the market return as the only factor affecting the return of any asset. This chapter will generalize CAPM to multi-factor models of the following form: 3 |

              4 | \[ R = \alpha + \beta_1 f_1 + \beta_2 f_2 + \dots + \beta_n f_n \] 5 |

              6 | where each \(f_i\) is a factor. 7 |

              8 | -------------------------------------------------------------------------------- /05 Introduction to Financial Python[]/14 Fama-French Multi-Factor Models/05 Summary.html: -------------------------------------------------------------------------------- 1 | 

              2 | In this chapter we expand Capital Asset Pricing Model (CAPM) into multi-factor models: the Fama-French factor models in particular. They are the most empirically successful multi-factor models by far, and are commonly used in practice. 3 |

              4 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/01 General Features of Options/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | In this tutorial, we will discuss the basic features of options to help you gain insight on what the option is, how options market is organized and how these contracts are traded. Then we will discuss the settlement rules of option contracts and the moneyness of options. 3 |

              4 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/01 General Features of Options/07 Summary.html: -------------------------------------------------------------------------------- 1 |

              2 | An option is a standardized contract between two parties to buy or sell an asset for a certain price. Options are pretty different from equity trading. Here we concerned primarily with the stock options. This chapter we present some introductory material on options market like the basic features of options contracts and the options trading mechanism. In addition, we explain how options markets are organized, how the contracts are traded. Next chapter we will take a close look at how to use QuantConnect API to start your options trading algorithm. 3 |

              4 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/02 QuantConnect Options API/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | QuantConnect provides US options trade and quotes price data for approximately 4000 symbols, each of which has roughly 10 strikes on average. Data is available starting January 1st, 2008. In this tutorial, we will discuss how to use QuantConnect to start your options trading algorithm. 3 |

              4 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/02 QuantConnect Options API/05 Algorithm.html: -------------------------------------------------------------------------------- 1 |

              2 | This simple example demonstrates how you can inspect the option chain to pick a specific option contract to trade. 3 |

              4 |
              5 |
              6 |
              7 | 8 |
              9 |
              10 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/02 QuantConnect Options API/06 Summary.html: -------------------------------------------------------------------------------- 1 |

              2 | After mastering the basic knowledge of options market, this tutorial we take a close at how to use Quantconnect to customize your own options trading. For example, how you can access an option chain, how to view the details of the contract as a Python data frame, and the most important how to trade the specific option contract. 3 | Next chapter we will examine some important topics of options like the payoff, Put-Call parity, and the synthetic positions. By learning all those concepts, we will start some brief hedging strategies involving options. 4 |

              5 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/03 Put-Call Parity and Arbitrage Strategies/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

              2 | In this chapter, we will discuss the option's payoff if you long or short the options. Then we discuss the put-call parity which is a relationship between the price of a European call option, the price of a European put option, and the underlying stock price. In addition, an application of put-call parity in arbitrage trading strategies was demonstrated. 3 |

              4 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/03 Put-Call Parity and Arbitrage Strategies/05 Algorithm.html: -------------------------------------------------------------------------------- 1 |
              2 |
              3 |
              4 | 5 |
              6 |
              7 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/03 Put-Call Parity and Arbitrage Strategies/06 Summary.html: -------------------------------------------------------------------------------- 1 |

              2 | In this chapter, we derived an important relationship between the prices of European put and call options that have the same strike price and time to maturity by constructing two portfolios. Then we described the synthetic positions, a common concept which is always used in arbitrage trading strategies. Finally two simple arbitrage strategies conversion and reversal are demonstrated on QC platform to help you get a better understanding of how to implement algorithms with simple option mechanism. 3 |

              4 |

              5 | Next chapter we will dig into the famous option pricing model-Black Sholes Merton Model and discuss how to apply BSM in European options pricing. 6 |

              7 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/03 Put-Call Parity and Arbitrage Strategies/07 References.html: -------------------------------------------------------------------------------- 1 |
                2 |
              1. 3 | Bouzoubaa M, Osseiran A. Exotic options and hybrids: A guide to structuring, pricing and trading[M]. John Wiley & Sons, 2010. 4 |
              2. 5 |
              3. 6 | Put-Call Parity and Arbitrage Opportunity, Jim Graham, February 6, 2017, Online Copy 7 |
              4. 8 |
                  9 | 10 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/04 Stochastic Processes and Monte Carlo Method/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

                  2 | Last few chapters we introduced the basic principles and mechanism of options trading. We already knew what an option contract is and the basic relationship between call and put options' price. But how do these contracts traded in the exchange are being priced and where does the option premium come from? In the next few chapters, we will discuss the pricing of options. 3 |

                  4 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/04 Stochastic Processes and Monte Carlo Method/06 Summary.html: -------------------------------------------------------------------------------- 1 |

                  2 | In this chapter, we modeled stock price with the stochastic process. The stochastic process usually assumed for a stock price is geometric Brownian motion.The Black–Scholes–Merton model, which we cover in the next chapter, is based on the geometric Brownian motion assumption. Under this process, the logarithm of stock return in a small period of time is normally distributed and the returns in two nonoverlapping periods are independent. 3 |

                  4 |

                  5 | In the second part of the tutorial,  we applied Monte Carlo method to simulate the stock price in order to gain an intuitive understanding of the stochastic process followed by stock price. Then we discussed how to use Monte Carlo method to price the options based on the underlying prices paths. 6 |

                  7 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/04 Stochastic Processes and Monte Carlo Method/07 References.html: -------------------------------------------------------------------------------- 1 |
                    2 |
                  1. 3 | Hull J C. Options, futures, and other derivatives[M]. Pearson Education India, 2006. 4 |
                  2. 5 |
                  6 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/05 Options Pricing Black Scholes Merton Model/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

                  2 | In the last chapter, we modeled the stock price with the Geometric Brownian motion. The logarithm of return \(\text{ln}(S_T/S_0)\) follows the normal distribution \(N\left[(\mu-\sigma^2/2)T,\sigma^2T\right]\). It means the logarithm of stock price\(\text{ln}(S_T)\)follows the normal distribution \(N\left[\text lnS_0+(\mu-\sigma^2/2)T,\sigma^2T\right]\). Based on this basic assumption, in this chapter, we will talk about a famous option pricing model: Black Scholes Merton Model. 3 |

                  4 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/05 Options Pricing Black Scholes Merton Model/06 Summary.html: -------------------------------------------------------------------------------- 1 |

                  2 | This tutorial discussed factors affecting the options price and introduced a famous option pricing model including input parameters, assumptions and the formula. 3 |

                  4 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/06 The Greek Letters/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

                  2 | Option Greeks measure the exposure of option price or option delta to movement of different factors such as the underlying price, time and volatility. In this tutorial we will discuss various Greeks, their meanings and their implications on the pricing and how to use them to hedge risks. 3 |

                  4 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/06 The Greek Letters/08 Summary.html: -------------------------------------------------------------------------------- 1 |

                  2 | In this chapter we discussed various Greeks, their meanings and their implications on the pricing and hedging of derivatives. We also presented some useful formulas for calculating the Greeks value of European options and generated the plots to show how they changed with strikes and time to expirations. The Greeks letter is the sensitivity measure of options price to the market variables. Next chapter we will discuss another major risk measures: volatility. 3 |

                  4 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/07 Historical Volatility and Implied Volatility/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

                  2 | The change of volatility can have a significant impact on the performance of options trading. In addition to the Vega we explained in Greeks letter chapter, this part of the volatility tutorial will discuss the concept of volatility, specifically, we discuss realized and implied volatility, their meanings, measurements, uses, and limitations. 3 |

                  4 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/07 Historical Volatility and Implied Volatility/08 References.html: -------------------------------------------------------------------------------- 1 |
                    2 |
                  1. 3 | Options Pricing: Intrinsic Value And Time Value, Jean Folger, Online Copy 4 |
                  2. 5 |
                  6 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/08 Local Volatility and Stochastic Volatility/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

                  2 | In the last chapter, we discussed two types of volatility: historical volatility and implied volatility. This chapter, we will further extend the concept of volatility and introduce the local volatility and the stochastic volatility. 3 |

                  4 | -------------------------------------------------------------------------------- /06 Introduction to Options[]/08 Local Volatility and Stochastic Volatility/05 Summary.html: -------------------------------------------------------------------------------- 1 |

                  2 | In Black–Scholes, that volatility is assumed to be constant, it is not reasonable especially for some exotic options in which the option's payoff is based on the changing volatility. Therefore we introduced the two volatility models to capture the volatility skew. The first approach, local volatility, assumes that the volatility is a deterministic function of time and the underlying asset price. This function must be chosen as to match the observed market option prices. In another stochastic volatility models, the asset price and its volatility are both assumed to be random processes. 3 |

                  4 |

                  5 | The calibration needs the market price of the Vanilla options. When we get the model estimation we can use these models to price exotic options. 6 |

                  7 | -------------------------------------------------------------------------------- /07 Applied Options[]/01 Covered Call/03 Summary.html: -------------------------------------------------------------------------------- 1 |

                  2 | From the above strategy we can see that the share price of IBM had been increasing during the backtesting period from January 2016 to June 2016. The drawdown is small -- the Covered Call strategy performs better than a simple buy-and-hold strategy of underlying stock in a bearish market. The benefit of Covered Call is that you keep the premium, any gains from the underlying price increase up to the strike price, and accrued dividends during the stock holding period. In a bullish market, however, you miss out on any gains if the underlying stock price breaches the strike price. 3 |

                  4 | -------------------------------------------------------------------------------- /07 Applied Options[]/02 Bull Call Spread/03 Summary.html: -------------------------------------------------------------------------------- 1 |

                  2 | This strategy can be implemented when you have a moderate outlook on the stock because the payoff reaches its maximum when the price is between the strike price range of two traded options. The strategy protects the downside move of the stock price. But when the price is above the higher strike, the profit is capped. 3 |

                  4 | -------------------------------------------------------------------------------- /07 Applied Options[]/04 Long Strangle/03 Summary.html: -------------------------------------------------------------------------------- 1 |

                  2 | In this algorithm, at time 0, we buy OTM call with strike price 870 and OTM put with strike price 795. The share price of GOOG at time 0 is $832.8. At the expiry, the share price of GOOG is $930.16, and so the call option is exercised and we get 100 shares of GOOG while the put option expires worthless. 3 |

                  4 |

                  5 | You can enter into a Long Strangle if you have no clear idea of market direction but forecast that there will be a great movement in the underlying asset. As the options you buy are all out of the money, the premium cost of entering this position is low. However, because the call and the put options are all out of the money, the stock will need to move even more significantly than in a long straddle in order to profit from this strategy. 6 |

                  7 | -------------------------------------------------------------------------------- /07 Applied Options[]/05 Butterfly Spread/03 Summary.html: -------------------------------------------------------------------------------- 1 |

                  2 | From the following algorithm, at time 0, the GOOG share price is $832.8. We purchase 1 OTM call option with strike price $855, 1 ITM call option with strike price $810 and sell 2 ATM options with strike prices at 835. At the expiry 05/19/2017, the share price is $930 and so the long positions of the ITM option and the OTM option are exercised: we buy 100 GOOG shares at $810 and buy another 100 shares at $855. At the same time, the 2 short positions of the ATM option are also exercised: we sell 200  GOOG shares to the option holder at $835. After the expiration date, we don't hold any shares of the underlying. Since the stock price had a sharp increase during the life of options, we fail to profit from a Long Call Butterfly Spread. 3 |

                  4 | -------------------------------------------------------------------------------- /07 Applied Options[]/06 Iron Condor/03 Summary.html: -------------------------------------------------------------------------------- 1 |

                  2 | The iron condor is an option strategy that earns money as long as the underlying asset price does move out of a predetermined price range. In this algorithm, that range is $775 to $827.5. At 02/01/2017, we long $750 put at $1.25 and short $775 put at $3.5. At the same time, we short $827.5 call at$2.3 and long $850 call at $0.75. At this moment, the GOOG share price is $799.55 all the options are out the money. At expiration date 02/17/2017, the share price of GOOG is $828.07. The long put, short put and long call expire worthless. The short call is exercised. Thus we wind up going short 100 shares of GOOG. 3 |

                  4 | -------------------------------------------------------------------------------- /07 Applied Options[]/07 Iron Butterfly/03 Summary.html: -------------------------------------------------------------------------------- 1 |

                  2 | In this algorithm, on 04/03/2017, the share price of Google is $832.8. We buy OTM put(strike = $805) at $2, OTM call(strike = $860) and sell an ATM call and an ATM put. At the expiry 04/21/2017, the share price is $841.53. The ATM call is exercised and the other 3 options expire worthless. As we hold the short position of the ATM call, after expiration we will be short 100 shares of GOOG. 3 |

                  4 | -------------------------------------------------------------------------------- /07 Applied Options[]/08 Protective Collar/03 Summary.html: -------------------------------------------------------------------------------- 1 |

                  2 | In this algorithm, at the beginning  01/04/2016, we purchased 100 GOOG shares. At the same time, we purchased a $715 put at $6 and sells a $772.5 call at $2.45. The share price of GOOG is $739.32, which is between the strike prices of two out-the-money options. At the expiry 01/15/2016, the share price of GOOG drops to $714.32. The call option expire worthless but the put option is exercised. Then we sell 100 GOOG shares at $715. Then we hold neither option positions and stock positions. 3 |

                  4 | -------------------------------------------------------------------------------- /08 Meta/01 Creating BootCamp Tutorials/01 Introduction.html: -------------------------------------------------------------------------------- 1 |

                  2 | BootCamp is an interactive, education system for teaching the community the QuantConnect API, and the structure for building an algorithm. In January 2019, QuantConnect opened up the BootCamp technology to allow contributions of tutorials from the community! This guide seeks to show you how to create a BootCamp tutorial. 3 |

                  4 | 5 |

                  6 | Education and access to the information required to compete is a the cornerstone of QuantConnect's mission for radical openness, and the democratization of finance. With your help we can train the community on how to make the best algorithms possible. 7 |

                  8 | -------------------------------------------------------------------------------- /08 Meta/01 Creating BootCamp Tutorials/07 Building Code Validators.html: -------------------------------------------------------------------------------- 1 |

                  2 | Validators 3 | Partial Class 4 | Validating algorithm output 5 | 6 | Examples of validation 7 |

                  8 | -------------------------------------------------------------------------------- /08 Meta/01 Creating BootCamp Tutorials/08 Style Guide.html: -------------------------------------------------------------------------------- 1 |

                  2 | H4 titles, verbs describing strategy step 3 | Brief Short sentences, 4 | Aim for no more than 3 todo's per task 5 | Hint should give enough information to complete the task. 6 | technical grammar, present tense. 7 |

                  8 | -------------------------------------------------------------------------------- /08 Meta/01 Creating BootCamp Tutorials/09 Submitting Lesson for Review.html: -------------------------------------------------------------------------------- 1 |

                  2 | Lesson submission 3 |

                  4 | -------------------------------------------------------------------------------- /08 Meta/01 Creating BootCamp Tutorials/10 Summary.html: -------------------------------------------------------------------------------- 1 |

                  2 | 3 |

                  4 | --------------------------------------------------------------------------------