{"id":40888623,"date":"2022-10-13T11:47:28","date_gmt":"2022-10-13T06:17:28","guid":{"rendered":"https:\/\/stockviz.biz\/index.php\/?p=40888623"},"modified":"2022-10-13T11:47:37","modified_gmt":"2022-10-13T06:17:37","slug":"adventures-in-pattern-matching-part-i","status":"publish","type":"post","link":"https:\/\/stockviz.biz\/index.php\/2022\/10\/13\/adventures-in-pattern-matching-part-i\/","title":{"rendered":"Adventures in Pattern Matching, Part I"},"content":{"rendered":"\n<p>Hypothesis: If a price segment is similar to a set of historical segments, then there should be a correlation between historical and future returns.<\/p>\n\n\n\n<p>Setup: Take 60-minute segments of 1-minute bars. Match them with 200 of the most recent days&#8217; with times aligned. Take the top 40 days with the closest match and calculate their median next 30-minute returns. Plot the median vs. actual.<\/p>\n\n\n\n<p>Simplifications:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Non-overlapping segments. Its can be argued that patterns don&#8217;t start and stop and perfectly aligned boundaries. <\/li><li>Most-recent 200 day look-back period. What if that&#8217;s not enough? Or too much?<\/li><li>30-minute prediction. Too short? Too long? <\/li><\/ol>\n\n\n\n<p>Verdict: There is no discernable relationship.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/stockviz\/blog\/master\/pattern-matching-1\/nifty-60.30.200.1.jpeg\" alt=\"\" \/><\/figure>\n\n\n\n<p>Code: <a href=\"https:\/\/github.com\/stockviz\/blog\/tree\/master\/pattern-matching-1\" target=\"_blank\" rel=\"noreferrer noopener\">github<\/a><\/p>\n\n\n\n<p>Related: <a href=\"https:\/\/stockviz.biz\/2020\/11\/17\/euclidean-distance-for-pattern-matching\/\" target=\"_blank\" rel=\"noreferrer noopener\">Euclidean Distance for Pattern Matching<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hypothesis: If a price segment is similar to a set of historical segments, then there should be a correlation between historical and future returns. Setup: Take 60-minute segments of 1-minute bars. Match them with 200 of the most recent days&#8217; with times aligned. Take the top 40 days with the closest match and calculate their &hellip; <\/p>\n","protected":false},"author":2,"featured_media":2106273,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3471],"tags":[2761],"class_list":["post-40888623","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-investing-insight","tag-quant","entry"],"_links":{"self":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/40888623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/comments?post=40888623"}],"version-history":[{"count":0,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/posts\/40888623\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/media\/2106273"}],"wp:attachment":[{"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/media?parent=40888623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/categories?post=40888623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stockviz.biz\/index.php\/wp-json\/wp\/v2\/tags?post=40888623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}