{"id":5611,"date":"2021-05-25T15:19:07","date_gmt":"2021-05-25T13:19:07","guid":{"rendered":"https:\/\/joapen.com\/blog\/?p=5611"},"modified":"2021-05-25T15:32:35","modified_gmt":"2021-05-25T13:32:35","slug":"using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex","status":"publish","type":"post","link":"https:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/","title":{"rendered":"Using Machine Learning to predict the S&#038;P 500 price change, using the dark pool indicators Dix and Gex"},"content":{"rendered":"\n<p>This is the <a href=\"https:\/\/www.kaggle.com\/joapen\/dix-and-gex-indicators\" target=\"_blank\" rel=\"noreferrer noopener\">first version<\/a> of an analysis I wanted to perform with the main purpose of learning. By this reason I have limited the number of input data and operations to the minimum.<\/p>\n\n\n\n<p>To do something different I will be looking for correlations between the two main dark pool indexes: DIX and GEX Indexes. For more information about these indexes:&nbsp;<a href=\"https:\/\/joapen.com\/blog\/2019\/10\/15\/dix-and-gex-indicators\/\">https:\/\/joapen.com\/blog\/2019\/10\/15\/dix-and-gex-indicators\/<\/a><\/p>\n\n\n\n<p>If you are interested to use this code to earn some dollars, this is not a good idea, maybe in future the new versions are more accurate and they can be used for that purpose. You always can take this code and make it better. It&#8217;s not difficult, I promise you.<\/p>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">Note 1 <\/span><\/strong>: To see the complete set of code and the results you need a Kaggle user.<\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\"><strong>Note 2<\/strong><\/span>: I&#8217;m not a professional developer, so you will see code that is written in a weird way, my apologizes.<\/p>\n\n\n\n<p>My purpose of this post is to review some main aspects of the code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1.- Import data and add some content<\/h2>\n\n\n\n<p>I have exported the data from <a href=\"https:\/\/squeezemetrics.com\/monitor\/dix?\" target=\"_blank\" rel=\"noreferrer noopener\">squeezemetrics<\/a> and after that I have created some new columns: PriceDailyReturn, DixDailyReturn and GexDailyReturn.<\/p>\n\n\n\n<p>I started the analysis focusing on &#8220;price&#8221; as target value I wanted to predict, but I have found that &#8220;PriceDailyReturn&#8221; is a better target, mainly because it does inherit the previous days errors.<\/p>\n\n\n\n<p>I have shifted the &#8220;PriceDailyReturn&#8221; so I am predicting the future, not the present.<\/p>\n\n\n\n<p>I have added a new column to the data frame called gexR, I found it as something used by others and I wanted to see if it was useful or not.<\/p>\n\n\n\n<p>I have split the data in training and test using 2\/January\/2020. This result in 2182 entries for training and 332 for testing.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"528\" height=\"377\" src=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-11.png\" alt=\"Load data and features\" class=\"wp-image-5612\" srcset=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-11.png 528w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-11-300x214.png 300w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-11-24x17.png 24w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-11-36x26.png 36w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-11-48x34.png 48w\" sizes=\"auto, (max-width: 528px) 100vw, 528px\" \/><figcaption>Load data and features<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">2.- Exploratory Data Analysis (EDA)<\/h2>\n\n\n\n<p>I have created several charts to explore the data and try to see how it looks like. Some of the charts are used to see if there is any NaN value and the others just to see correlations and potential trends. For instance:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.kaggleusercontent.com\/kf\/63889625\/eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0..EFkL0RjzB1kXjF83-mnaew.fnzaD9y4PtLdNhCFO_6ASlzy7BNKNSxnlzhUJh9HB7nqCdTumMxjP_XdN7jtaqN6Ncu280Jap4ADq-KknPcj5aBCUf0J_2nFfskgK2FUnOR2C0Boho09T7RRQfzcFsKP6Z87w_5FB3YvEVJjWOqcRwO9PHyO4swCC-l29Osn6j49By3BUm6VNtoAtpMcwQ8ta-ek1WIpWw7JqHrbREcLxnWW7xWCjkF10OHhKUx4DiyrIvZ7NFQefsIO4-dYgFEi95wR1IFTacj876uONpzEzx_nzJEUwEm5whpD1n_wI6watN-Vu7ONoLTmKH_0ooXRsZlXbj1vElF7DWREXOWK1z7pzBW8QbhHdWXKGoW1a9NVh_Qz4IZGvh4ArVEWLp3n3CFvpaSpFEZsb5UZbNeXwM5izLnBXNXA2GaoidWi_ppy_QX2_-0Ww9a412Lyvc16KrI92iuEOKXMIVSuVWdHA_tYy0HABNa8C5Ewn4BhwPL_QY3YhodwWPzv7v-YlVL3i_84vR2TirKz7p0Hwy3OYodUU49om81Uf_b5_OYNWkMeuQRmKwbzK0tDx5Du3k1P1OqMGUcfiNuBC4bT7IhbSPWwHAvCLTBoDriUEKbOnzKI7Hc87R2E0YD88wxK_SKia3Ffv8opGfDvxa8w3wzpcW5lqWdv876Lkj1r5yffsPs.S5Mq7A3pLpFOin7c1bpc2g\/__results___files\/__results___8_0.png\" alt=\"Correlation Matrix of Default Features\"\/><figcaption>Correlation Matrix of Default Features<\/figcaption><\/figure>\n\n\n\n<p>Another interesting one is the SPX price and the gexR representation:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.kaggleusercontent.com\/kf\/63889625\/eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0..EFkL0RjzB1kXjF83-mnaew.fnzaD9y4PtLdNhCFO_6ASlzy7BNKNSxnlzhUJh9HB7nqCdTumMxjP_XdN7jtaqN6Ncu280Jap4ADq-KknPcj5aBCUf0J_2nFfskgK2FUnOR2C0Boho09T7RRQfzcFsKP6Z87w_5FB3YvEVJjWOqcRwO9PHyO4swCC-l29Osn6j49By3BUm6VNtoAtpMcwQ8ta-ek1WIpWw7JqHrbREcLxnWW7xWCjkF10OHhKUx4DiyrIvZ7NFQefsIO4-dYgFEi95wR1IFTacj876uONpzEzx_nzJEUwEm5whpD1n_wI6watN-Vu7ONoLTmKH_0ooXRsZlXbj1vElF7DWREXOWK1z7pzBW8QbhHdWXKGoW1a9NVh_Qz4IZGvh4ArVEWLp3n3CFvpaSpFEZsb5UZbNeXwM5izLnBXNXA2GaoidWi_ppy_QX2_-0Ww9a412Lyvc16KrI92iuEOKXMIVSuVWdHA_tYy0HABNa8C5Ewn4BhwPL_QY3YhodwWPzv7v-YlVL3i_84vR2TirKz7p0Hwy3OYodUU49om81Uf_b5_OYNWkMeuQRmKwbzK0tDx5Du3k1P1OqMGUcfiNuBC4bT7IhbSPWwHAvCLTBoDriUEKbOnzKI7Hc87R2E0YD88wxK_SKia3Ffv8opGfDvxa8w3wzpcW5lqWdv876Lkj1r5yffsPs.S5Mq7A3pLpFOin7c1bpc2g\/__results___files\/__results___10_4.png\" alt=\"SPX price and gexR\"\/><figcaption>SPX price and gexR<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"3.--Feature-Engineering\">3.- Feature Engineering<\/h2>\n\n\n\n<p>At this part of the data analysis I have not done anything. I still need to get more data and then, study each one of the features in deep.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"4-Train\/test-split-of-data\">4.- Train\/test split of data<\/h2>\n\n\n\n<p>I have already split the data, so nothing here.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"5.--Classification-and-model\">5.- Classification and model<\/h2>\n\n\n\n<p>I have decided to use XGBoost library and a regressor as model.<\/p>\n\n\n\n<p>I have learned that  general, a small learning rate (and large number of estimators) will yield more accurate XGBoost models. This combination will also take the model longer to train since it does more iterations through the cycle.<\/p>\n\n\n\n<p>As I do not know the right combination of parameters , I have done an initial review of them and I will pick up the more accurate.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"734\" height=\"330\" src=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-12.png\" alt=\"xgboost.XGBRegressor\" class=\"wp-image-5613\" srcset=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-12.png 734w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-12-300x135.png 300w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-12-24x11.png 24w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-12-36x16.png 36w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-12-48x22.png 48w\" sizes=\"auto, (max-width: 734px) 100vw, 734px\" \/><figcaption>xgboost.XGBRegressor<\/figcaption><\/figure>\n\n\n\n<p>Once defined, I&#8217;ve run each one of the models and check its mean absolute error (MAE):<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"556\" height=\"270\" src=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-13.png\" alt=\"model.fit and model.predict\" class=\"wp-image-5614\" srcset=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-13.png 556w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-13-300x146.png 300w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-13-24x12.png 24w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-13-36x17.png 36w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-13-48x23.png 48w\" sizes=\"auto, (max-width: 556px) 100vw, 556px\" \/><figcaption>model.fit and model.predict<\/figcaption><\/figure>\n\n\n\n<p>From model 7 to model 10 the median absolute error (MAE) is similar. So I use model 7 as the valid one right now.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"634\" height=\"281\" src=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-14.png\" alt=\"execution of an specific model\" class=\"wp-image-5615\" srcset=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-14.png 634w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-14-300x133.png 300w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-14-24x11.png 24w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-14-36x16.png 36w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-14-48x21.png 48w\" sizes=\"auto, (max-width: 634px) 100vw, 634px\" \/><figcaption>execution of an specific model<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">6.- Let&#8217;s check the results<\/h2>\n\n\n\n<p>A basic chart with the actual data and the forecasted data:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"732\" height=\"607\" src=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-15.png\" alt=\"SPX daily return of test data and the predicted data\" class=\"wp-image-5616\" srcset=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-15.png 732w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-15-300x249.png 300w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-15-24x20.png 24w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-15-36x30.png 36w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-15-48x40.png 48w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><figcaption>SPX daily return of test data and the predicted data<\/figcaption><\/figure>\n\n\n\n<p>Visually, the behavior is fine when there are not so much changes, but this test data contains the big fall of March 2020, so there the predicted results are really bad (not a surprise with that few amount of parameters and data).<\/p>\n\n\n\n<p>I have calculated the difference between the actuals and the prediction, and then I have plotted it:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"392\" height=\"159\" src=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-16.png\" alt=\"\" class=\"wp-image-5617\" srcset=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-16.png 392w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-16-300x122.png 300w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-16-24x10.png 24w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-16-36x15.png 36w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-16-48x19.png 48w\" sizes=\"auto, (max-width: 392px) 100vw, 392px\" \/><figcaption>Calculate the difference between actual data and predicted data<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"295\" src=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-17.png\" alt=\"\" class=\"wp-image-5618\" srcset=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-17.png 738w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-17-300x120.png 300w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-17-24x10.png 24w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-17-36x14.png 36w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-17-48x19.png 48w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">6.1.- performance of the prediction: TP, FP, TN, FN<\/h3>\n\n\n\n<p>I asked myself: how right or wrong is this prediction?<\/p>\n\n\n\n<p>So to answer it I defined what are the true\/false positives and the true\/false negatives. I have defined a threshold of difference that I accept as valid, a type of accuracy that satisfies me.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"545\" height=\"658\" src=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-18.png\" alt=\"\" class=\"wp-image-5619\" srcset=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-18.png 545w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-18-248x300.png 248w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-18-20x24.png 20w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-18-30x36.png 30w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-18-40x48.png 40w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"573\" height=\"490\" src=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-19.png\" alt=\"\" class=\"wp-image-5620\" srcset=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-19.png 573w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-19-300x257.png 300w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-19-24x21.png 24w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-19-36x31.png 36w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-19-48x41.png 48w\" sizes=\"auto, (max-width: 573px) 100vw, 573px\" \/><\/figure>\n\n\n\n<p>The results are:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"395\" height=\"271\" src=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-20.png\" alt=\"\" class=\"wp-image-5621\" srcset=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-20.png 395w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-20-300x206.png 300w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-20-24x16.png 24w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-20-36x25.png 36w, https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-20-48x33.png 48w\" sizes=\"auto, (max-width: 395px) 100vw, 395px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>A lot of learning doing this exercise, and I hope to have some time to improve the input data, the features analysis and the model selected.<\/p>\n\n\n\n<p>If you have some suggestions or comments, please let me know, constructive feedback is more than welcome.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the first version of an analysis I wanted to perform with the main purpose of learning. By this reason I have limited the number of input data and operations to the minimum. To do something different I will be looking for correlations between the two main dark pool indexes: DIX and GEX Indexes. &#8230; <a title=\"Using Machine Learning to predict the S&#038;P 500 price change, using the dark pool indicators Dix and Gex\" class=\"read-more\" href=\"https:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/\" aria-label=\"Read more about Using Machine Learning to predict the S&#038;P 500 price change, using the dark pool indicators Dix and Gex\">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":[213],"class_list":["post-5611","post","type-post","status-publish","format-standard","hentry","category-machine-learning","category-python","tag-kaggle"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Using Machine Learning to predict the S&amp;P 500 price change, using the dark pool indicators Dix and Gex -<\/title>\n<meta name=\"description\" content=\"This is the first version of an analysis I wanted to perform with the main purpose of learning. By this reason I have limited the number of input data and - 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=\"http:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using Machine Learning to predict the S&amp;P 500 price change, using the dark pool indicators Dix and Gex -\" \/>\n<meta property=\"og:description\" content=\"This is the first version of an analysis I wanted to perform with the main purpose of learning. By this reason I have limited the number of input data and - joapen projects\" \/>\n<meta property=\"og:url\" content=\"http:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/\" \/>\n<meta property=\"og:site_name\" content=\"joapen projects\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-25T13:19:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-25T13:32:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-11.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=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/05\\\/25\\\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\\\/#article\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/05\\\/25\\\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\\\/\"},\"author\":{\"name\":\"joapen\",\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/#\\\/schema\\\/person\\\/23919df2312175fe9c4609203595b217\"},\"headline\":\"Using Machine Learning to predict the S&#038;P 500 price change, using the dark pool indicators Dix and Gex\",\"datePublished\":\"2021-05-25T13:19:07+00:00\",\"dateModified\":\"2021-05-25T13:32:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/05\\\/25\\\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\\\/\"},\"wordCount\":758,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/#\\\/schema\\\/person\\\/23919df2312175fe9c4609203595b217\"},\"image\":{\"@id\":\"http:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/05\\\/25\\\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/joapen.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/image-11.png\",\"keywords\":[\"kaggle\"],\"articleSection\":[\"Machine Learning\",\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/05\\\/25\\\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/05\\\/25\\\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\\\/\",\"url\":\"http:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/05\\\/25\\\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\\\/\",\"name\":\"Using Machine Learning to predict the S&P 500 price change, using the dark pool indicators Dix and Gex -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/joapen.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/05\\\/25\\\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\\\/#primaryimage\"},\"image\":{\"@id\":\"http:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/05\\\/25\\\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/joapen.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/image-11.png\",\"datePublished\":\"2021-05-25T13:19:07+00:00\",\"dateModified\":\"2021-05-25T13:32:35+00:00\",\"description\":\"This is the first version of an analysis I wanted to perform with the main purpose of learning. By this reason I have limited the number of input data and - joapen projects\",\"breadcrumb\":{\"@id\":\"http:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/05\\\/25\\\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/05\\\/25\\\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/05\\\/25\\\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\\\/#primaryimage\",\"url\":\"https:\\\/\\\/joapen.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/image-11.png\",\"contentUrl\":\"https:\\\/\\\/joapen.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/image-11.png\",\"width\":528,\"height\":377},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/joapen.com\\\/blog\\\/2021\\\/05\\\/25\\\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/joapen.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using Machine Learning to predict the S&#038;P 500 price change, using the dark pool indicators Dix and Gex\"}]},{\"@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":"Using Machine Learning to predict the S&P 500 price change, using the dark pool indicators Dix and Gex -","description":"This is the first version of an analysis I wanted to perform with the main purpose of learning. By this reason I have limited the number of input data and - 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":"http:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/","og_locale":"en_US","og_type":"article","og_title":"Using Machine Learning to predict the S&P 500 price change, using the dark pool indicators Dix and Gex -","og_description":"This is the first version of an analysis I wanted to perform with the main purpose of learning. By this reason I have limited the number of input data and - joapen projects","og_url":"http:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/","og_site_name":"joapen projects","article_published_time":"2021-05-25T13:19:07+00:00","article_modified_time":"2021-05-25T13:32:35+00:00","og_image":[{"url":"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-11.png","type":"","width":"","height":""}],"author":"joapen","twitter_misc":{"Written by":"joapen","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/#article","isPartOf":{"@id":"http:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/"},"author":{"name":"joapen","@id":"https:\/\/joapen.com\/blog\/#\/schema\/person\/23919df2312175fe9c4609203595b217"},"headline":"Using Machine Learning to predict the S&#038;P 500 price change, using the dark pool indicators Dix and Gex","datePublished":"2021-05-25T13:19:07+00:00","dateModified":"2021-05-25T13:32:35+00:00","mainEntityOfPage":{"@id":"http:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/"},"wordCount":758,"commentCount":0,"publisher":{"@id":"https:\/\/joapen.com\/blog\/#\/schema\/person\/23919df2312175fe9c4609203595b217"},"image":{"@id":"http:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/#primaryimage"},"thumbnailUrl":"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-11.png","keywords":["kaggle"],"articleSection":["Machine Learning","Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/","url":"http:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/","name":"Using Machine Learning to predict the S&P 500 price change, using the dark pool indicators Dix and Gex -","isPartOf":{"@id":"https:\/\/joapen.com\/blog\/#website"},"primaryImageOfPage":{"@id":"http:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/#primaryimage"},"image":{"@id":"http:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/#primaryimage"},"thumbnailUrl":"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-11.png","datePublished":"2021-05-25T13:19:07+00:00","dateModified":"2021-05-25T13:32:35+00:00","description":"This is the first version of an analysis I wanted to perform with the main purpose of learning. By this reason I have limited the number of input data and - joapen projects","breadcrumb":{"@id":"http:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/#primaryimage","url":"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-11.png","contentUrl":"https:\/\/joapen.com\/blog\/wp-content\/uploads\/2021\/05\/image-11.png","width":528,"height":377},{"@type":"BreadcrumbList","@id":"http:\/\/joapen.com\/blog\/2021\/05\/25\/using-machine-learning-to-predict-the-sp-500-price-change-using-the-dark-pool-indicators-dix-and-gex\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/joapen.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Using Machine Learning to predict the S&#038;P 500 price change, using the dark pool indicators Dix and Gex"}]},{"@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\/5611","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=5611"}],"version-history":[{"count":3,"href":"https:\/\/joapen.com\/blog\/wp-json\/wp\/v2\/posts\/5611\/revisions"}],"predecessor-version":[{"id":5626,"href":"https:\/\/joapen.com\/blog\/wp-json\/wp\/v2\/posts\/5611\/revisions\/5626"}],"wp:attachment":[{"href":"https:\/\/joapen.com\/blog\/wp-json\/wp\/v2\/media?parent=5611"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/joapen.com\/blog\/wp-json\/wp\/v2\/categories?post=5611"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/joapen.com\/blog\/wp-json\/wp\/v2\/tags?post=5611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}