{"id":22897,"date":"2019-10-25T09:52:11","date_gmt":"2019-10-25T13:52:11","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=22897"},"modified":"2024-05-17T12:58:59","modified_gmt":"2024-05-17T16:58:59","slug":"intraday-momentum-with-leveraged-etfs","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/intraday-momentum-with-leveraged-etfs\/","title":{"rendered":"Intraday Momentum with Leveraged ETFs"},"content":{"rendered":"\n<p><strong><em>Excerpt<\/em><\/strong><\/p>\n\n\n\n<p><strong>Daily rebalancing of leveraged ETFs<\/strong><\/p>\n\n\n\n<p class=\"has-background has-pale-cyan-blue-background-color\"><strong>Source<\/strong>: Ernie Chan,&nbsp;<em>Algorithmic Trading: Winning Strategies and Their Rationale<\/em>, Wiley, May 28, 2013, chapter 7.<\/p>\n\n\n\n<p>Per their fund objectives, leveraged ETFs must maintain a constant daily leverage relative to their underlying index (usually 2x or 3x leverage). As Ernie Chan points out in his book&nbsp;<em>Algorithmic Trading<\/em>, doing so requires that the ETF sponsors buy more underlying shares on days the shares go up and sell shares on days the shares go down. The larger the gain or loss, the more shares the fund will have to buy or sell to maintain the proper leverage.<\/p>\n\n\n\n<p>Chan proposes a trading strategy that buys (sells) leveraged ETFs in the afternoon trading session following a significant intraday gain (loss), in expectation of further buying (selling) by the leveraged ETF sponsors heading into the close.<\/p>\n\n\n\n<p><strong>Leveraged ETF trading strategy<\/strong><\/p>\n\n\n\n<p>I create a Moonshot strategy to test Chan&#8217;s idea using 15-min data from Interactive Brokers. The strategy calculates the return from the prior close to 2 PM and takes a long or short position when the gain or loss is more than +\/-2% and holds until the close. The Pandas code is shown below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>closes = prices.loc[\"Close\"]\nopens = prices.loc[\"Open\"]\n\n# Take a cross section (xs) of prices to get a specific time's price;\n# the close of the 15:45 bar is the session close\nsession_closes = closes.xs(\"15:45:00\", level=\"Time\")\n# the open of the 14:00 bar is the 14:00 price\nafternoon_prices = opens.xs(\"14:00:00\", level=\"Time\")\n\n# calculate the return from yesterday's close to 14:00\nprior_closes = session_closes.shift()\nreturns = (afternoon_prices - prior_closes) \/ prior_closes\n\n# Go long if up more than 2%, go short if down more than -2%\nlong_signals = returns > 0.02\nshort_signals = returns &lt; -0.02<\/code><\/pre>\n\n\n\n<p><em>Visit QuantRocket website to read the full article and to download the code<\/em>:<br> <a href=\"https:\/\/www.quantrocket.com\/blog\/leveraged-etf-intraday-momentum\/\">https:\/\/www.quantrocket.com\/blog\/leveraged-etf-intraday-momentum\/<\/a><\/p>\n\n\n\n<p><em>Any trading symbols displayed are for illustrative purposes only and are not intended to portray recommendations.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>QuantRocket author creates a Moonshot strategy to test Chan&#8217;s idea using 15-min data from IBKR using Panda in Python.<\/p>\n","protected":false},"author":186,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[339,343,349,338,341,352,344],"tags":[851,806,494],"contributors-categories":[13675],"class_list":{"0":"post-22897","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-data-science","7":"category-programing-languages","8":"category-python-development","9":"category-ibkr-quant-news","10":"category-quant-development","11":"category-quant-north-america","12":"category-quant-regions","13":"tag-algo-trading","14":"tag-data-science","15":"tag-quant","16":"contributors-categories-quantrocket-llc"},"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.8) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Intraday Momentum with Leveraged ETFs | IBKR Quant<\/title>\n<meta name=\"description\" content=\"QuantRocket author creates a Moonshot strategy to test Chan&#039;s idea using 15-min data from IBKR using Panda in Python.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/22897\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Intraday Momentum with Leveraged ETFs | Quant Blog\" \/>\n<meta property=\"og:description\" content=\"QuantRocket author creates a Moonshot strategy to test Chan&#039;s idea using 15-min data from IBKR using Panda in Python.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/intraday-momentum-with-leveraged-etfs\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-25T13:52:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-17T16:58:59+00:00\" \/>\n<meta name=\"author\" content=\"Contributor Author\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Contributor Author\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/intraday-momentum-with-leveraged-etfs\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/intraday-momentum-with-leveraged-etfs\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"Contributor Author\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/e823e46b42ca381080387e794318a485\"\n\t            },\n\t            \"headline\": \"Intraday Momentum with Leveraged ETFs\",\n\t            \"datePublished\": \"2019-10-25T13:52:11+00:00\",\n\t            \"dateModified\": \"2024-05-17T16:58:59+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/intraday-momentum-with-leveraged-etfs\\\/\"\n\t            },\n\t            \"wordCount\": 235,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"keywords\": [\n\t                \"Algo Trading\",\n\t                \"Data Science\",\n\t                \"Quant\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"Data Science\",\n\t                \"Programming Languages\",\n\t                \"Python Development\",\n\t                \"Quant\",\n\t                \"Quant Development\",\n\t                \"Quant North America\",\n\t                \"Quant Regions\"\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/intraday-momentum-with-leveraged-etfs\\\/\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/intraday-momentum-with-leveraged-etfs\\\/\",\n\t            \"name\": \"Intraday Momentum with Leveraged ETFs | Quant Blog\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"datePublished\": \"2019-10-25T13:52:11+00:00\",\n\t            \"dateModified\": \"2024-05-17T16:58:59+00:00\",\n\t            \"description\": \"QuantRocket author creates a Moonshot strategy to test Chan's idea using 15-min data from IBKR using Panda in Python.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/ibkr-quant-news\\\/intraday-momentum-with-leveraged-etfs\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/e823e46b42ca381080387e794318a485\",\n\t            \"name\": \"Contributor Author\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/contributor-author\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Intraday Momentum with Leveraged ETFs | IBKR Quant","description":"QuantRocket author creates a Moonshot strategy to test Chan's idea using 15-min data from IBKR using Panda in Python.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/22897\/","og_locale":"en_US","og_type":"article","og_title":"Intraday Momentum with Leveraged ETFs | Quant Blog","og_description":"QuantRocket author creates a Moonshot strategy to test Chan's idea using 15-min data from IBKR using Panda in Python.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/intraday-momentum-with-leveraged-etfs\/","og_site_name":"IBKR Campus US","article_published_time":"2019-10-25T13:52:11+00:00","article_modified_time":"2024-05-17T16:58:59+00:00","author":"Contributor Author","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Contributor Author","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/intraday-momentum-with-leveraged-etfs\/#article","isPartOf":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/intraday-momentum-with-leveraged-etfs\/"},"author":{"name":"Contributor Author","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/e823e46b42ca381080387e794318a485"},"headline":"Intraday Momentum with Leveraged ETFs","datePublished":"2019-10-25T13:52:11+00:00","dateModified":"2024-05-17T16:58:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/intraday-momentum-with-leveraged-etfs\/"},"wordCount":235,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"keywords":["Algo Trading","Data Science","Quant"],"articleSection":["Data Science","Programming Languages","Python Development","Quant","Quant Development","Quant North America","Quant Regions"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/intraday-momentum-with-leveraged-etfs\/","url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/intraday-momentum-with-leveraged-etfs\/","name":"Intraday Momentum with Leveraged ETFs | Quant Blog","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"datePublished":"2019-10-25T13:52:11+00:00","dateModified":"2024-05-17T16:58:59+00:00","description":"QuantRocket author creates a Moonshot strategy to test Chan's idea using 15-min data from IBKR using Panda in Python.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/intraday-momentum-with-leveraged-etfs\/"]}]},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/e823e46b42ca381080387e794318a485","name":"Contributor Author","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/contributor-author\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/22897","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/186"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=22897"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/22897\/revisions"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=22897"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=22897"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=22897"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=22897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}