{"id":5653,"date":"2021-06-17T11:07:58","date_gmt":"2021-06-17T09:07:58","guid":{"rendered":"https:\/\/joapen.com\/blog\/?p=5653"},"modified":"2021-06-17T14:15:41","modified_gmt":"2021-06-17T12:15:41","slug":"machine-learning-using-lstm-to-predict-sp-500","status":"publish","type":"post","link":"https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/","title":{"rendered":"Machine Learning, using LSTM to predict S&#038;P 500"},"content":{"rendered":"\n<p>This post gather the analysis of data done with market breadth data, VIX, DIX and GEX. They are moved into a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Long_short-term_memory\" target=\"_blank\" rel=\"noreferrer noopener\">Long Short Term Memory (LSTM)<\/a> neural network, that is a recurrent neural network.<\/p>\n\n\n\n<p>You can check<a href=\"https:\/\/github.com\/joapen\/ML-Learning-bucket\/blob\/main\/marketbreadthdata_v4.ipynb\" target=\"_blank\" rel=\"noreferrer noopener\"> the code and read how the whole thing is done<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Input data<\/h2>\n\n\n\n<p>The used features as input are:<\/p>\n\n\n\n<p>Data ranges of input files (From -&gt; To):<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Market breadth (1979-12-31 -&gt; 2021-05-25 ).<\/li><li>DIX and gex (2011-05-02 -&gt; 2021-05-25).<\/li><li>VIX (1990-01-02 -&gt; 2021-05-25).<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">The LSTM neural network<\/h2>\n\n\n\n<p>This is the basic version of a recurrent neural network:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/nickmccullum.com\/images\/python-deep-learning\/lstms\/recurrent-neural-network.png\" alt=\"A basic recurrent neural network\"\/><figcaption>basic recurrent neural network<\/figcaption><\/figure>\n\n\n\n<p>LSTM neural network simplified diagram:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/nickmccullum.com\/images\/python-deep-learning\/lstms\/lstm.png\" alt=\"An LSTM\"\/><figcaption>LSTM neural network<\/figcaption><\/figure>\n\n\n\n<p>To understand the diagram in detail you can read this <a href=\"https:\/\/www.freecodecamp.org\/news\/the-ultimate-guide-to-recurrent-neural-networks-in-python\/\" target=\"_blank\" rel=\"noreferrer noopener\">article<\/a>. Some notes for my poor memory:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The upper line with &#8220;X&#8221; and &#8220;+&#8221; symbols represents the cell state\u2019s, which purpose is to decide what information to carry forward from the different observations.<\/li><li>The left side of the input is composed by 2 steps: the input gate layer and the tanh layer. These layers work together to determine how to update the cell state.<\/li><li>The right side of the LSTM determines the output for this observation. This step runs through both a sigmoid function and a hyperbolic tangent function.<\/li><\/ul>\n\n\n\n<p>More about forecasting, you can find on Joaqu\u00edn&#8217;s Github this repository: <a href=\"https:\/\/github.com\/JoaquinAmatRodrigo\/skforecast\">https:\/\/github.com\/JoaquinAmatRodrigo\/skforecast<\/a> , that contains a very useful notebook: <a href=\"https:\/\/github.com\/JoaquinAmatRodrigo\/skforecast\/blob\/master\/notebooks\/introduction_skforecast.ipynb\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/JoaquinAmatRodrigo\/skforecast\/blob\/master\/notebooks\/introduction_skforecast.ipynb<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Optimizers used during this test<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Adam<\/strong> optimization is a stochastic gradient descent method that is based on adaptive estimation of first-order and second-order moments.<\/li><li><strong>SGD<\/strong>: Gradient descent (with momentum) optimizer.<\/li><li><strong>RMSprop<\/strong>: The gist of RMSprop is to 1) maintain a moving (discounted) average of the square of gradients; and 2) Divide the gradient by the root of this average.<\/li><\/ul>\n\n\n\n<p>One of the tests I have not performed is to define different parameters for the optimizers. There is a good bunch of alternatives you can play with, but as the initial results are not good, it does not makes sense to me to dig in. These ones are:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tf.keras.optimizers.Adam(\n    learning_rate=0.001,\n    beta_1=0.9,\n    beta_2=0.999,\n    epsilon=1e-07,\n    amsgrad=False,\n    name=\"Adam\",\n    **kwargs\n)\ntf.keras.optimizers.SGD(\n    learning_rate=0.01, momentum=0.0, nesterov=False, name=\"SGD\", **kwargs\n)\ntf.keras.optimizers.RMSprop(\n    learning_rate=0.001,\n    rho=0.9,\n    momentum=0.0,\n    epsilon=1e-07,\n    centered=False,\n    name=\"RMSprop\",\n    **kwargs\n)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Basic correlation<\/h2>\n\n\n\n<p>Initially there is not a high correlation between SPX and other input features, but let&#8217;s see what happens, this is an experiment.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"563\" src=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-12-1024x563.png\" alt=\"\" class=\"wp-image-5657\" srcset=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-12-1024x563.png 1024w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-12-300x165.png 300w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-12-768x422.png 768w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-12.png 1257w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>basic correlation between features<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">The challenges to me to build the neural network on Keras have been:<\/h2>\n\n\n\n<ol class=\"wp-block-list\"><li>Transform the matrix of 21 input parameters into a normalized matrix.<\/li><li> Look for the more convenient optimizer.<\/li><li>Understand the influence of the activation function.<\/li><li>Work with matrix to adapt the visual representation of the results.<\/li><li>Do the reverse transformation to visualize the prediction in the right amounts.<\/li><li>I am using a recursive forecasting model so by definition I define a &#8220;time step&#8221;, that in my case is defined initially at 60, so it works on 60 rows of data and then it returns the 61 as result or prediction. This can be seen on the visual test where the first 60 values of the prediction are set to zero.<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"596\" src=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-9-1024x596.png\" alt=\"\" class=\"wp-image-5654\" srcset=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-9-1024x596.png 1024w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-9-300x175.png 300w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-9-768x447.png 768w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-9.png 1166w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Visual result<\/h2>\n\n\n\n<p>This is the first result I obtained:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"389\" src=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-10-1024x389.png\" alt=\"\" class=\"wp-image-5655\" srcset=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-10-1024x389.png 1024w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-10-300x114.png 300w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-10-768x291.png 768w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-10-1536x583.png 1536w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-10.png 1671w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>I have adjusted the relative result with an offset. That uses the first value of the prediction and the first actual value to define this offset.<\/p>\n\n\n\n<p>The initial results are not too bad, but the degradation of the results with respect the time makes the this result to be very poor as the difference between real and predicted number is bad:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"378\" src=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-11-1024x378.png\" alt=\"\" class=\"wp-image-5656\" srcset=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-11-1024x378.png 1024w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-11-300x111.png 300w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-11-768x284.png 768w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-11.png 1297w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Results of the experiment<\/h2>\n\n\n\n<p>I have created a true positive, true negative, false positive and false negative table. I have defined 5 basic points of the SPX as threshold, below these 5 basic points of difference between actual value and predicted value the result is considered as accurate, above 5 basic points, it is considered as not accurate.<\/p>\n\n\n\n<p>On this initial test only 10% of the tests are accurate. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"415\" height=\"340\" src=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-13.png\" alt=\"\" class=\"wp-image-5658\" srcset=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-13.png 415w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-13-300x246.png 300w\" sizes=\"auto, (max-width: 415px) 100vw, 415px\" \/><\/figure>\n\n\n\n<p>The common parameters of all tests have been:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Loss=mae<\/li><li>epochs=20<\/li><li>training_data = 9647<\/li><li>test_data = 793<\/li><li>Accuracy = 5 basic points of SPX<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Table of results<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"705\" height=\"387\" src=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-14.png\" alt=\"\" class=\"wp-image-5663\" srcset=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-14.png 705w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/06\/image-14-300x165.png 300w\" sizes=\"auto, (max-width: 705px) 100vw, 705px\" \/><figcaption>table of results<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>This post gather the analysis of data done with market breadth data, VIX, DIX and GEX. They are moved into a Long Short Term Memory (LSTM) neural network, that is a recurrent neural network. You can check the code and read how the whole thing is done. Input data The used features as input are: &#8230; <a title=\"Machine Learning, using LSTM to predict S&#038;P 500\" class=\"read-more\" href=\"https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/\" aria-label=\"Read more about Machine Learning, using LSTM to predict S&#038;P 500\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[151,104],"tags":[],"class_list":["post-5653","post","type-post","status-publish","format-standard","hentry","category-machine-learning","category-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Machine Learning, using LSTM to predict S&amp;P 500 -<\/title>\n<meta name=\"description\" content=\"This post gather the analysis of data done with market breadth data, VIX, DIX and GEX. They are moved into a Long Short Term Memory (LSTM) neural network, - joapen projects\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Machine Learning, using LSTM to predict S&amp;P 500 -\" \/>\n<meta property=\"og:description\" content=\"This post gather the analysis of data done with market breadth data, VIX, DIX and GEX. They are moved into a Long Short Term Memory (LSTM) neural network, - joapen projects\" \/>\n<meta property=\"og:url\" content=\"https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/\" \/>\n<meta property=\"og:site_name\" content=\"joapen projects\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-17T09:07:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-17T12:15:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/nickmccullum.com\/images\/python-deep-learning\/lstms\/recurrent-neural-network.png\" \/>\n<meta name=\"author\" content=\"joapen\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"joapen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/06\\\/17\\\/machine-learning-using-lstm-to-predict-sp-500\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/06\\\/17\\\/machine-learning-using-lstm-to-predict-sp-500\\\/\"},\"author\":{\"name\":\"joapen\",\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/#\\\/schema\\\/person\\\/23919df2312175fe9c4609203595b217\"},\"headline\":\"Machine Learning, using LSTM to predict S&#038;P 500\",\"datePublished\":\"2021-06-17T09:07:58+00:00\",\"dateModified\":\"2021-06-17T12:15:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/06\\\/17\\\/machine-learning-using-lstm-to-predict-sp-500\\\/\"},\"wordCount\":667,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/#\\\/schema\\\/person\\\/23919df2312175fe9c4609203595b217\"},\"image\":{\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/06\\\/17\\\/machine-learning-using-lstm-to-predict-sp-500\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/nickmccullum.com\\\/images\\\/python-deep-learning\\\/lstms\\\/recurrent-neural-network.png\",\"articleSection\":[\"Machine Learning\",\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/06\\\/17\\\/machine-learning-using-lstm-to-predict-sp-500\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/06\\\/17\\\/machine-learning-using-lstm-to-predict-sp-500\\\/\",\"url\":\"https:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/06\\\/17\\\/machine-learning-using-lstm-to-predict-sp-500\\\/\",\"name\":\"Machine Learning, using LSTM to predict S&P 500 -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/06\\\/17\\\/machine-learning-using-lstm-to-predict-sp-500\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/06\\\/17\\\/machine-learning-using-lstm-to-predict-sp-500\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/nickmccullum.com\\\/images\\\/python-deep-learning\\\/lstms\\\/recurrent-neural-network.png\",\"datePublished\":\"2021-06-17T09:07:58+00:00\",\"dateModified\":\"2021-06-17T12:15:41+00:00\",\"description\":\"This post gather the analysis of data done with market breadth data, VIX, DIX and GEX. They are moved into a Long Short Term Memory (LSTM) neural network, - joapen projects\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/06\\\/17\\\/machine-learning-using-lstm-to-predict-sp-500\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/06\\\/17\\\/machine-learning-using-lstm-to-predict-sp-500\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/06\\\/17\\\/machine-learning-using-lstm-to-predict-sp-500\\\/#primaryimage\",\"url\":\"https:\\\/\\\/nickmccullum.com\\\/images\\\/python-deep-learning\\\/lstms\\\/recurrent-neural-network.png\",\"contentUrl\":\"https:\\\/\\\/nickmccullum.com\\\/images\\\/python-deep-learning\\\/lstms\\\/recurrent-neural-network.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/06\\\/17\\\/machine-learning-using-lstm-to-predict-sp-500\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/joapen.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Machine Learning, using LSTM to predict S&#038;P 500\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/joapen.com\\\/blog\\\/\",\"name\":\"joapen projects\",\"description\":\"Just a place to write\",\"publisher\":{\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/#\\\/schema\\\/person\\\/23919df2312175fe9c4609203595b217\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/joapen.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/#\\\/schema\\\/person\\\/23919df2312175fe9c4609203595b217\",\"name\":\"joapen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/joapen-mini.jpeg\",\"url\":\"https:\\\/\\\/joapen.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/joapen-mini.jpeg\",\"contentUrl\":\"https:\\\/\\\/joapen.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/joapen-mini.jpeg\",\"width\":400,\"height\":400,\"caption\":\"joapen\"},\"logo\":{\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/joapen-mini.jpeg\"},\"sameAs\":[\"http:\\\/\\\/www.joapen.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Machine Learning, using LSTM to predict S&P 500 -","description":"This post gather the analysis of data done with market breadth data, VIX, DIX and GEX. They are moved into a Long Short Term Memory (LSTM) neural network, - joapen projects","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:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/","og_locale":"en_US","og_type":"article","og_title":"Machine Learning, using LSTM to predict S&P 500 -","og_description":"This post gather the analysis of data done with market breadth data, VIX, DIX and GEX. They are moved into a Long Short Term Memory (LSTM) neural network, - joapen projects","og_url":"https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/","og_site_name":"joapen projects","article_published_time":"2021-06-17T09:07:58+00:00","article_modified_time":"2021-06-17T12:15:41+00:00","og_image":[{"url":"https:\/\/nickmccullum.com\/images\/python-deep-learning\/lstms\/recurrent-neural-network.png","type":"","width":"","height":""}],"author":"joapen","twitter_misc":{"Written by":"joapen","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/#article","isPartOf":{"@id":"https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/"},"author":{"name":"joapen","@id":"https:\/\/joapen.com\/blog\/#\/schema\/person\/23919df2312175fe9c4609203595b217"},"headline":"Machine Learning, using LSTM to predict S&#038;P 500","datePublished":"2021-06-17T09:07:58+00:00","dateModified":"2021-06-17T12:15:41+00:00","mainEntityOfPage":{"@id":"https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/"},"wordCount":667,"commentCount":0,"publisher":{"@id":"https:\/\/joapen.com\/blog\/#\/schema\/person\/23919df2312175fe9c4609203595b217"},"image":{"@id":"https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/#primaryimage"},"thumbnailUrl":"https:\/\/nickmccullum.com\/images\/python-deep-learning\/lstms\/recurrent-neural-network.png","articleSection":["Machine Learning","Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/","url":"https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/","name":"Machine Learning, using LSTM to predict S&P 500 -","isPartOf":{"@id":"https:\/\/joapen.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/#primaryimage"},"image":{"@id":"https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/#primaryimage"},"thumbnailUrl":"https:\/\/nickmccullum.com\/images\/python-deep-learning\/lstms\/recurrent-neural-network.png","datePublished":"2021-06-17T09:07:58+00:00","dateModified":"2021-06-17T12:15:41+00:00","description":"This post gather the analysis of data done with market breadth data, VIX, DIX and GEX. They are moved into a Long Short Term Memory (LSTM) neural network, - joapen projects","breadcrumb":{"@id":"https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/#primaryimage","url":"https:\/\/nickmccullum.com\/images\/python-deep-learning\/lstms\/recurrent-neural-network.png","contentUrl":"https:\/\/nickmccullum.com\/images\/python-deep-learning\/lstms\/recurrent-neural-network.png"},{"@type":"BreadcrumbList","@id":"https:\/\/joapen.com\/blog\/2021\/06\/17\/machine-learning-using-lstm-to-predict-sp-500\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/joapen.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Machine Learning, using LSTM to predict S&#038;P 500"}]},{"@type":"WebSite","@id":"https:\/\/joapen.com\/blog\/#website","url":"https:\/\/joapen.com\/blog\/","name":"joapen projects","description":"Just a place to write","publisher":{"@id":"https:\/\/joapen.com\/blog\/#\/schema\/person\/23919df2312175fe9c4609203595b217"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/joapen.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/joapen.com\/blog\/#\/schema\/person\/23919df2312175fe9c4609203595b217","name":"joapen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/04\/joapen-mini.jpeg","url":"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/04\/joapen-mini.jpeg","contentUrl":"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/04\/joapen-mini.jpeg","width":400,"height":400,"caption":"joapen"},"logo":{"@id":"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/04\/joapen-mini.jpeg"},"sameAs":["http:\/\/www.joapen.com"]}]}},"_links":{"self":[{"href":"https:\/\/joapen.com\/blog\/wp-json\/wp\/v2\/posts\/5653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/joapen.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/joapen.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/joapen.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/joapen.com\/blog\/wp-json\/wp\/v2\/comments?post=5653"}],"version-history":[{"count":5,"href":"https:\/\/joapen.com\/blog\/wp-json\/wp\/v2\/posts\/5653\/revisions"}],"predecessor-version":[{"id":5667,"href":"https:\/\/joapen.com\/blog\/wp-json\/wp\/v2\/posts\/5653\/revisions\/5667"}],"wp:attachment":[{"href":"https:\/\/joapen.com\/blog\/wp-json\/wp\/v2\/media?parent=5653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/joapen.com\/blog\/wp-json\/wp\/v2\/categories?post=5653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/joapen.com\/blog\/wp-json\/wp\/v2\/tags?post=5653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}