First Steps To Become a Self-Directed Quantitative Investor. Course for New Portfolio123 Users. Fred Piard. version: May 2018

Similar documents
Quantitative Trading System For The E-mini S&P

QUICK START. Your Guide to Using Telemet Orion

BOCI SmartXpress iphone & Android Trading Platform User Guide

1. NEW Sector Trading Application to emulate and improve upon Modern Portfolio Theory.

Tutorial. Morningstar DirectSM. Quick Start Guide

DIY Trade Manager Plus

Zacks Method for Trading: Home Study Course Workbook. Disclaimer. Disclaimer

GuruFocus User Manual: My Portfolios

Forex Kinetics Advanced Price Action Trading System. All rights reserved

Trading Diary Manual. Introduction

Zacks Method for Trading: Home Study Course Workbook. Disclaimer. Disclaimer

Any symbols displayed within these pages are for illustrative purposes only, and are not intended to portray any recommendation.

Illustration Software Quick Start Guide

Zacks Method for Trading: Home Study Course Workbook. Disclaimer. Disclaimer

Using the Clients & Portfolios Module in Advisor Workstation

Portfolio123 Book. The General tab is where you lay out both a few identifying characteristics of the model and some basic assumptions.

FxPro Direct User Guide. Version 1.0

Introduction to RELCOST. Carolyn Roos, Ph.D. Northwest CHP Technical Assistance Partnerships Washington State University Energy Program

Opening an Account on Schwab Retirement Center

PNC BENEFIT PLUS HSA INVESTMENT USER GUIDE. Home Page and Dashboard Navigation. pnc.com/pncbenefitplus

A Window to Your Financial World

FxPro Direct User Guide

Contents. Introduction

MOBILE (iphone/ipad)

END OF DAY DATA CORPORATION. Scanning the Market. using Stock Filter. Randal Harisch 2/27/2011

Student Guide: RWC Simulation Lab. Free Market Educational Services: RWC Curriculum

Client Software Feature Guide

Your guide to Fidelity NetBenefits

Gold Space USER GUIDE

Quick-Star Quick t Guide -Star

Adaptive Retirement Accounts

Morningstar Hypothetical Illustrator SM Quick Start Guide

TraderEx Self-Paced Tutorial and Case

A unique trading tool designed to help traders visualize and place orders based on market depth and order flow. DepthFinder TradingApp

FTS Real Time Project: Smart Beta Investing

We are not saying it s easy, we are just trying to make it simpler than before. An Online Platform for backtesting quantitative trading strategies.


Identifying Market Bottoms: IBD Follow-Through Days

This document will provide a step-by-step tutorial of the RIT 2.0 Client interface using the Liability Trading 3 Case.

MT4 Supreme Edition Trade Terminal

A Guide to Our REAL SPEND. Investment Strategies A RETIREMENT INCOME STRATEGY.

FUNDAMENTALS. A Guide for Reviewing Your Fund Information

GuruFocus User Manual: Interactive Charts

Guide to working with Aviva

A Window to Your Financial World

GuruFocus User Manual: New Guru Pages

Hi, everyone. there. should be. We are an this for 28 Louie, our

EFE 2 Contracts USER GUIDE

S-Enrooter 1.0. Automatic trading strategy USER GUIDE. Version 1.0

Benchmarking. Club Fund. We like to think about being in an investment club as a group of people running a little business.

2015 Performance Report

Gtrade manual version 2.04 updated

LAB 2 INSTRUCTIONS PROBABILITY DISTRIBUTIONS IN EXCEL

PROFIT TRADE SCANNER. USER GUIDE

META TRADER 4 MOBILE (ANDROID) USER GUIDE MOBILE (ANDROID) USER GUIDE.

McDowell s Special Market Report Using the TradersCoach.com Software Tools

Stock Forecast Toolbox

Creating a Standard AssetMatch Proposal in Advisor Workstation 2.0

Any symbols displayed within these pages are for illustrative purposes only, and are not intended to portray any recommendation.

FX-GO platform Webtrader manual V 2.0

We Provide the Insights. You Invest in the Right Opportunities. Solutions for Private Equity

AUTOMATED TRADE PREDATOR

Designing a Retirement Portfolio That s Just Right For You

Quant -Ideas. User Guide

Research Wizard: Upgrade -- April 2007 Descriptions and Screenshots

Any symbols displayed within these pages are for illustrative purposes only, and are not intended to portray any recommendation.

MT4 TRADING SIMULATOR

client user GUIDE 2011

Viive 5.2 QUICK START GUIDE MAC-VIIVE

FOREX GEMINI CODE. Presents. Dynamic Triple Edge

OMNILIFE USER GUIDE 1.0 QUOTE... 2

IPO VITAL SIGNS. Participant Training Guide

WIN NEW CLIENTS & INCREASE WALLET-SHARE with HiddenLevers Engaging prospects + clients with portfolio stress testing

PriceMyLoan.com Lender AE Guide. Revision 0707

HOW TO SWITCH AN INVESTMENT HOW TO SWITCH AN INVESTMENT GETTING STARTED HELP GUIDE. Use this step by step guide designed to help you get started.

Using the Principia Suite

GuruFocus User Manual: Interactive Charts version

Beta Test Quick-Start Guide

USER GUIDE

HEALTH SAVINGS ACCOUNT (HSA) INVESTMENT PORTAL GUIDE

Getting started as an investor. A guide for investors

Web BORSAT User s Manual

Forex Online Trading User Guide

Crude oil Arrow USER GUIDE

Money Management (MX) Frequently Asked Question s

Synaptic Analyser USER GUIDE

MT4 Awesomizer V3. Basics you should know:

Introduction to Client Online

A16 Documenting CECAS PRC 29 Request & Baseline SIF Data Training Script ( ) 1

USER MANUAL. Version 1.7

Dear Client, We appreciate your business!

FOREX PROFITABILITY CODE

Plan Access ABA-RF Guide

DIRECT INVESTOR. Take the sting out of downturns. Leading the way in service. In this issue

Work management. Work managers Training Guide

StuckyNet-Link.NET User Interface Manual

Instruction (Manual) Document

Workplace Education Series. NetBenefits Overview: Get answers to your questions about retirement

Judge InvestWrite Essays in Three Easy Steps

Customer Guide. Don t just be good with money, be MoneyBrilliant

Transcription:

First Steps To Become a Self-Directed Quantitative Investor Course for New Portfolio123 Users Fred Piard version: May 2018 Disclaimer The information provided by the author is for educational purpose only. It is not investment advice. Before deciding to invest in financial markets you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment. You should seek advice from an independent financial advisor if you have any doubt. All products, ETPs, indexes, tools and websites quoted in this document are property and trademarks of their respective issuers. This document does not constitute a solicitation to purchase any financial instruments. The past performance of a system or methodology is not necessarily indicative for the future. CFTC RULE 4.41 HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN. The Platform Portfolio123 is the best online tool I know to find, design, execute and manage quantitative investing strategies in the US and Canadian stock markets. It is used by individual and professional investors. It has professional grade daily data and powerful simulation features. Historical data include hundreds of fundamental and technical factors for thousands of stocks and ETFs. Companies that are now dead, merged, gone private are taken into account in backtests, as well as changes in indexes. Learning curve The interface is not fancy and the learning curve is long. There is a feature named Wizard to help beginners build their first screens in natural language, but it doesn t really simplify things. Learning how to use the rule-based language, understanding the components, identifying the most obvious pitfalls, may take months, if not years. I have been using the platform since February 2011. After thousands of hours I can t claim knowing all of it, despite being familiar with the technical concepts literally for decades. I worked for the first time with a database system in 1989, with industrial simulation software in 1990 and programmed a rule-based system in a nuclear plant in 1991. So, I can imagine the challenge for an average newcomer, and I understand why about 90% of the people coming to Portfolio123 give up. The platform has online help, tutorials, examples, but it is complicated for beginners. I hope this document fills the gap. Your P123 account If you have an old inactive Portfolio123 account, reactivate it. If you have forgotten your username or password, there is a link to ask it. If you need to create a new account Click This Link, then Sign Up (upper right). If you find a blank field Invitation Code in the process, copy and paste this: PIARD2 (this code is already in the link above, but it may not work in all browsers). My invitation link and code give you an extended free trial period. Page 1 - Bootstrap P123 - Fred Piard

You will have to choose a membership level. A free trial membership should be enough to follow this document. If you think the platform is good for you, you will need a paid membership to save your work after the free-trial. There are 4 levels of membership. Click the link Pricing at the bottom of the Portfolio123 home page for more info. Content of this document First Part: You will learn to code simple screens based on my book Quantitative Investing. You don t need to buy the book if you don t have it. Second Part: You will learn to use and combine pre-built ranking systems provided by Portfolio123. How to create a Screen and backtest it Click the menu item Screener, then click the button New and choose in the list if you want a screen in stocks, ETFs or CEFs. We will start with an ETF screen. A Screen has parameters dispatched in several tabs. When creating a screen, you land on the Rules tab, but first I suggest you have a look at the Settings tab. You can choose: a date to run the screen (by default the current date) the universe in which you want to run the screen (by default all U.S. ETFs) a ranking system (by default none) a benchmark to choose in a list of indexes and ETFs (by default SPY) a method (by default long) a maximum number of ETFs in the output list (by default 0, meaning all passing the rules) For all the examples hereafter, you will keep the default settings. Page 2 - Bootstrap P123 - Fred Piard

Go back to the tab Rules : Basically, a rule is a logical assumption expressed in a proprietary language. From a programming point of view, a rule is a line of code. The language is not case-sensitive. For every ETF, every rule has a logical value: TRUE or FALSE. Rules can be combined with the logical operators AND, OR. On instant execution (Button Run Screen, upper right), the screen will return the list of ETFs for which the combination or rules is TRUE at the specified date (upper right). A rule can be inactivated (or reactivated) by clicking on the green (or red) point on the left of the line. The screener skips rules with a red point. Every time you make a change, click the Save icon (upper right above Run Screen). The first time, you will be asked to give a name. It will help you find the screen next time you click on the menu item Screener. Let s take an example. Below are 3 rules in text: you can select, copy and paste them in the screener. ticker("iym,iyc,iyk,iye,iyf,iyh,iyj,iyr,iyw,iyz,idu") sma(50)>sma(200) sma(50,0,getseries("spy"))>sma(200,0,getseries("spy")) In the first rule, the function ticker() requires the ETF to be in a list. In the second rule, this first use of the function sma() requires the ETF s 50-day simple moving average to be above the 200-day simple moving average. In the third rule, the same condition is required for SPY. The Getseries() function can call any ETF. Page 3 - Bootstrap P123 - Fred Piard

By the way, this screen stands for a simple market-timing strategy described at page 29 of Quantitative Investing. You can now click on Save, then Run Screen to see the list of ETFs passing the rules. Rules are combined by default with AND. If you click on AND, it will be changed into OR (and the other way). For example, you can change the second AND into OR. Now only one of the 2 sma rules needs to be TRUE for the combination to be TRUE. Restore AND before going on. In the bells and whistles, you will appreciate the autocomplete feature when typing a rule, and also the double-click. Double-clicking a function name shows a short description in the reference panel (if expanded), and a link to the full description with detailed syntax, parameters and use cases. Now, go to the Backtest tab. You will keep the default parameters, except those circled in red above and described below. Slippage: 0.1% is enough to model spreads and transaction costs for very liquid ETFs. Max Pos: limiting position size at 9.1% forces a position into cash when one of the 11 ETFs in the list doesn t pass the rules. Rebalancing Frequency: Every Week means the screen is run the first trading day of every week in the time interval. Dates: choose a time interval between 01/02/1999 and today. It makes sense if you take into account the look-back period (in this example we use 200-day moving averages) and ETF inception dates. The backtest runs the screen at the beginning of every rebalancing period in the time interval. Holdings are in equal weight at the beginning of every period. Advanced sizing features exist in Portfolio123, but they are out of our scope here. Hereafter is the result of the backtest specified in the previous screenshot. Page 4 - Bootstrap P123 - Fred Piard

Returns are calculated with dividends reinvested. Now, I will give you the screens for most strategies described in the book Quantitative Investing. ETF screens These models have underperformed the benchmark between publication and 2018 (from 9/1/2013 to 1/1/2018), mostly because market timing and momentum indicators have been whipsawed in 2015 and 2016. However, they all have positive returns since 2013 and their logic still makes sense on a long time frame. If you follow me, you know that since May 2015 I don t use any more binary timing indicators, but a multi-valued risk indicator. Market Timing strategy p 17: Eval((sma(50,0,#Bench)>sma(200,0,#Bench)),Ticker("SPY"),Ticker("")) Note: The function Eval is an if...then...else... structure: double-click after pasting it to see the description. #Bench is a shorter way to access SPY data, provided that SPY has been declared as benchmark in the Settings tab. Market Timing strategy p 25: Ticker ("DIA,SPY,MDY,QQQ,IWM") sma(50)>sma(200) sma(50,0,#bench)>sma(200,0,#bench) Note: it is similar to the example of p29 with sectors, seen previously. Market-Timing p 32: Ticker ("IEF,TLT,ICF,SPY,ILF,EPP,IEV") sma(50)>sma(200) Note: MaxPos must be set to 14.3% in the backtest tab to keep positions in cash when ETFs don t pass. Page 5 - Bootstrap P123 - Fred Piard

Momentum p 39: Eval (sma(50,0,#bench)>sma(200,0,#bench), ticker("iym,iyc,iyk,iye,iyf,iyh,iyj,iyr,iyw,iyz,idu"), ticker("ief")) FOrder("Momentum(20,0,false)",#Previous,#DESC,false)<7 sma(50)>sma(200) Note: the first rule is split, paste the 2 lines in one. Double-click on FOrder to see the description. Momentum p 44: Ticker ("IEF,TLT,ICF,SPY,ILF,EPP,IEV") FOrder("Momentum(120,0,false)",#Previous,#DESC,false)<6 sma(50)>sma(200) Momentum p 47: Ticker("MDY,TLT")// Triple switch variant: Ticker("MDY,EEM,TLT") FOrder("Momentum(60,0)",#Previous,#DESC,false)=1 Seasonal p 60: Eval(inset(month,1,2,3,4,11,12),Ticker("EWS,EWZ"), Ticker("TLT")) Note: you already know Eval, double-click inset to learn the description. Seasonal p 63: Eval(inset(month,3,4,10,11,12),Ticker("EWG"), Ticker("TLT")) Stock screens These 3 screens have positive returns from 9/1/2013 to 1/1/2018, but 2 underperform the market. The second part of this document will give you a more robust screen to start your own work. Value strategy p 86: Universe(SP500) Pr2CashFlTTM<10 PEExclXorTTM<20 Pr2BookQ<8 AvgRec<=3 FOrder("DbtTot2EqQ",#Previous,#ASC,false)<=6 Note: This is with default parameters in the Settings tab. The first rule could be replaced by a universe declaration in Settings and the last one by choosing the factor DbtTot2EqQ as Quick Rank, also in Settings. There is no market timing here. Double-click on the factors to see their descriptions. Strategy p 89: Universe(SP500) EPS%ChgPQ>5 Sales%ChgPYQ>5 Pr2CashFlQ<8 RSI(14)<70 FOrder("DbtTot2EqQ",#Previous,#ASC,false)<=4 Page 6 - Bootstrap P123 - Fred Piard

Dividend Strategy p 91: Universe(SP500) Sector!=UTIL SI%Float<5 Yield5YAvg>4 Yield>4 FOrder("DbtTot2EqQ",#Previous,#ASC,false)<=10 Note:!= means different. UTIL is a constant naming the Utilities sector. You can find constants for sectors and industries seeking the full description of Sector. Portfolio123 ranking systems The Platform has pre-built ranking systems combining many factors. A ranking system applied to a universe results in a score between 0 and 100 for each stock or ETF in this universe. We will see now 2 ways to use ranking systems. Create a new stock screen, go to Settings and follow the next steps. 1. Choose S&P 500 Index in Universe 2. Choose Ranking System in Ranking 3. Choose Basic: Quality in the list of ranking systems 4. Type 25 in Max Number of Stocks This time, Rules are left blank. Go directly to the Backtest tab. Choose a 4-Week Rebalancing Frequency and a 0.1% slippage to model the bid-ask spread and transaction costs (which is realistic for S&P 500 stocks and a low-cost broker). Pick also dates to delimit a backtest period. If you run this backtest (with no rules), it will simulate a dynamic portfolio of 25 stocks, recomposed and rebalanced in equal weight every 4 weeks, holding the 25 companies with the highest scores in the pre-built ranking system Basic: Quality. From 1999 to 2018 the curve of total return (in red) compared to SPY (in blue) looks like this: Page 7 - Bootstrap P123 - Fred Piard

My purpose here is not discussing the performance, but showing how you can use pre-built components to code decent screens in minutes. Three points to keep in mind: Backtests picking illiquid stocks and penny stocks are pure fantasy. They must be eliminated by the choice of universe or by rules. The higher the number of holdings, the lower the risk of over-fitting. Outperformance coming from singularities is misleading. Short-selling backtests are flawed by definition. The availability and cost for shorting a stock in the past are unknown (and were variable across brokers). In the example above you can use only one ranking system. What if you want to select stocks using several ranking systems? The function Rating returns the score of a stock for any ranking system. Copy-paste the 2 lines below in the Rules of our current screen (blank until now): Rating("Basic: Value")>50 Rating("Basic: Growth")>50 What the screen does now is eliminating companies looking bad regarding the pre-built ranking systems Basic: Value and Basic: Growth before selecting the 25 best ones for Basic: Quality. The limit of good and bad is arbitrarily a score of 50. If you run the backtest again you will see a change in performance. Once again, the purpose is not discussing performances, but giving you insights to build winning strategies. You will understand what is inside a ranking system on the way to become an advanced user. For now, you just need to know how to use it. With pre-built ranking systems you can already design strategies based on Quality, Value, Growth, Momentum, Sentiment without caring about factors. You can permute ranking systems in Settings and Rules, change the limit 50 for Rating, try other prebuilt ranking systems, add other rules, change universes, modify the stock number. Doing so, you will learn more about what works and doesn t work in the stock market, and you may find good strategies. Page 8 - Bootstrap P123 - Fred Piard

Using Portfolio123 for research and reporting If you are not a pure quant, the platform has more to offer than screens, backtests and portfolios. You can search and visualize historical data on stocks and the economy in various ways in the menu items under Stocks and Data. You can plot any stock factor on charts: the example below shows the price, gross margin and PE ratio of Boeing (BA) on a 3-year period: You can create custom dashboards: Page 9 - Bootstrap P123 - Fred Piard

You can plot stocks, ETFs, indexes, economic indicators on the same chart:...and more. Conclusion Portfolio123 is certainly the best tool if you want to become a self-directed quantitative investor. It is also an excellent tool if you are a professional. I hope this document will save you some time and effort in the learning curve. You can copy and share this document unchanged and in whole with colleagues, friends, contacts. Diffusion by mass mailing and download links accessible by the public or search engines are excluded. You may not modify, publish, transmit parts of the document except sharing a whole copy with identified people. We reserve all rights not expressly granted. Page 10 - Bootstrap P123 - Fred Piard