{"id":670,"date":"2018-11-24T00:39:08","date_gmt":"2018-11-23T23:39:08","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=670"},"modified":"2020-11-21T22:22:50","modified_gmt":"2020-11-21T21:22:50","slug":"investor-stock-forecasting-with-lstm","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/","title":{"rendered":"Investor &#8211; Stock Forecasting with LSTM"},"content":{"rendered":"<p>In this blog we show how to forecast the closing price of <a href=\"https:\/\/www.bloomberg.com\/quote\/AAPL:US\">AAPL<\/a> using a <a href=\"https:\/\/deeplearning4j.org\/docs\/latest\/deeplearning4j-nn-recurrent\">LSTM RRN network.<\/a> We use the open, closing, high and low rates and the volume of the current day as input in order to predict the subsequent closing price.<\/p>\n<p>This demo has been implemented in Scala using <a href=\"http:\/\/jupyter.org\/\">Jupyter<\/a> with the <a href=\"http:\/\/beakerx.com\/\">BeakerX<\/a>\u00a0kernel using the following libraries<br \/>\n&#8211; <a href=\"https:\/\/www.pschatzmann.ch\/home\/category\/quantitative-trading\/\">Investor<\/a><br \/>\n&#8211; <a href=\"https:\/\/deeplearning4j.org\/\">DL4j<\/a><\/p>\n<p>The details can be found in the following <a href=\"https:\/\/nbviewer.jupyter.org\/gist\/pschatzmann\/5594355cf3542432e7417692147d8380\">Gist<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog we show how to forecast the closing price of AAPL using a LSTM RRN network. We use the open, closing, high and low rates and the volume of the current day as input in order to predict the subsequent closing price. This demo has been implemented in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":671,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[14,13],"tags":[],"class_list":["post-670","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-machine-learning","category-quantitative-trading"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Investor - Stock Forecasting with LSTM - Phil Schatzmann<\/title>\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.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Investor - Stock Forecasting with LSTM - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"In this blog we show how to forecast the closing price of AAPL using a LSTM RRN network. We use the open, closing, high and low rates and the volume of the current day as input in order to predict the subsequent closing price. This demo has been implemented in [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2018-11-23T23:39:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-21T21:22:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2018\/11\/aapl.png\" \/>\n\t<meta property=\"og:image:width\" content=\"650\" \/>\n\t<meta property=\"og:image:height\" content=\"492\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"pschatzmann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pschatzmann\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/11\\\/24\\\/investor-stock-forecasting-with-lstm\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/11\\\/24\\\/investor-stock-forecasting-with-lstm\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"Investor &#8211; Stock Forecasting with LSTM\",\"datePublished\":\"2018-11-23T23:39:08+00:00\",\"dateModified\":\"2020-11-21T21:22:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/11\\\/24\\\/investor-stock-forecasting-with-lstm\\\/\"},\"wordCount\":81,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/11\\\/24\\\/investor-stock-forecasting-with-lstm\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2018\\\/11\\\/aapl.png\",\"articleSection\":[\"Machine Learning\",\"Quantitative Trading\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/11\\\/24\\\/investor-stock-forecasting-with-lstm\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/11\\\/24\\\/investor-stock-forecasting-with-lstm\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/11\\\/24\\\/investor-stock-forecasting-with-lstm\\\/\",\"name\":\"Investor - Stock Forecasting with LSTM - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/11\\\/24\\\/investor-stock-forecasting-with-lstm\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/11\\\/24\\\/investor-stock-forecasting-with-lstm\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2018\\\/11\\\/aapl.png\",\"datePublished\":\"2018-11-23T23:39:08+00:00\",\"dateModified\":\"2020-11-21T21:22:50+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/11\\\/24\\\/investor-stock-forecasting-with-lstm\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/11\\\/24\\\/investor-stock-forecasting-with-lstm\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/11\\\/24\\\/investor-stock-forecasting-with-lstm\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2018\\\/11\\\/aapl.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2018\\\/11\\\/aapl.png\",\"width\":650,\"height\":492},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2018\\\/11\\\/24\\\/investor-stock-forecasting-with-lstm\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Investor &#8211; Stock Forecasting with LSTM\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\",\"name\":\"Phil Schatzmann Consulting\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\",\"name\":\"pschatzmann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"width\":305,\"height\":305,\"caption\":\"pschatzmann\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Investor - Stock Forecasting with LSTM - Phil Schatzmann","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.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/","og_locale":"en_US","og_type":"article","og_title":"Investor - Stock Forecasting with LSTM - Phil Schatzmann","og_description":"In this blog we show how to forecast the closing price of AAPL using a LSTM RRN network. We use the open, closing, high and low rates and the volume of the current day as input in order to predict the subsequent closing price. This demo has been implemented in [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/","og_site_name":"Phil Schatzmann","article_published_time":"2018-11-23T23:39:08+00:00","article_modified_time":"2020-11-21T21:22:50+00:00","og_image":[{"width":650,"height":492,"url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2018\/11\/aapl.png","type":"image\/png"}],"author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"Investor &#8211; Stock Forecasting with LSTM","datePublished":"2018-11-23T23:39:08+00:00","dateModified":"2020-11-21T21:22:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/"},"wordCount":81,"commentCount":0,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2018\/11\/aapl.png","articleSection":["Machine Learning","Quantitative Trading"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/","url":"https:\/\/www.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/","name":"Investor - Stock Forecasting with LSTM - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/#primaryimage"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2018\/11\/aapl.png","datePublished":"2018-11-23T23:39:08+00:00","dateModified":"2020-11-21T21:22:50+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/#primaryimage","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2018\/11\/aapl.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2018\/11\/aapl.png","width":650,"height":492},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2018\/11\/24\/investor-stock-forecasting-with-lstm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"Investor &#8211; Stock Forecasting with LSTM"}]},{"@type":"WebSite","@id":"https:\/\/www.pschatzmann.ch\/home\/#website","url":"https:\/\/www.pschatzmann.ch\/home\/","name":"Phil Schatzmann Consulting","description":"","publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pschatzmann.ch\/home\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1","name":"pschatzmann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","width":305,"height":305,"caption":"pschatzmann"},"logo":{"@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png"}}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/comments?post=670"}],"version-history":[{"count":1,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/670\/revisions"}],"predecessor-version":[{"id":2208,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/670\/revisions\/2208"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media\/671"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}