{"id":4439,"date":"2021-05-08T14:51:03","date_gmt":"2021-05-08T14:51:03","guid":{"rendered":"https:\/\/afluxcoin.com\/51\/can-you-time-the-market-with-basic-python\/"},"modified":"2021-05-08T14:51:03","modified_gmt":"2021-05-08T14:51:03","slug":"can-you-time-the-market-with-basic-python","status":"publish","type":"post","link":"https:\/\/afluxcoin.com\/ru\/51\/can-you-time-the-market-with-basic-python\/","title":{"rendered":"\u041c\u043e\u0436\u0435\u0442\u0435 \u043b\u0438 \u0432\u044b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0440\u044b\u043d\u043e\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e Python?"},"content":{"rendered":"

Using basic Pandas to tell when to enter and exit an investmentPhoto by Chris Liverani on UnsplashDisclaimer: This does not constitute any form of investment advice so please use this methodology at your own risk.For this analysis, we hope to observe some form of seasonal trend within a stock market and come up with a simple strategy to take advantage of this trend. A basic level of Python (more specifically Pandas) is used to manipulate the data. As this is supposedly a simple strategy, there will not be usage of statistical analysis or predictive techniques (these can and will be covered in the future).Here, we will be looking at the Singapore stock market. A common barometer of the Singapore economy would be the Straits Times Index (STI), which tracks the performance of 30 stocks listed on the Singapore Exchange (SGX)We cannot exactly buy a unit of the STI, but we can gain exposure to it. One method is to use an exchange-traded fund (ETF), and in this case, I will be using the SPDR Straits Times Index ETF (ES3.SI). This ETF aims to replicate the performance of the STI and is available to trade over various brokers.Here\u2019s the adjusted close prices of ES3 from 1st Jan 2008 to 1st Jan 2018:Adjusted close prices of ES3 from 1st Jan 2008 to 1st Jan 2018Adjusted close price data is used to omit the effects of corporate actions such as dividends, stock splits etc. and will be a more accurate representation of stock price movements.We suppose that there are specific months that tend to give better returns than others. We will compute the arithmetic average of the log-returns of the different months (aggregated across the time period).For example, when considering January, we look at the daily returns of January 2008, January 2009 \u2026\u2026<\/p>","protected":false},"excerpt":{"rendered":"

Using basic Pandas to tell when to enter and exit an investmentPhoto by Chris Liverani on UnsplashDisclaimer: This does not constitute any form of investment advice [\u2026]<\/span><\/p>","protected":false},"author":0,"featured_media":2796,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[35],"tags":[],"_links":{"self":[{"href":"https:\/\/afluxcoin.com\/ru\/wp-json\/wp\/v2\/posts\/4439"}],"collection":[{"href":"https:\/\/afluxcoin.com\/ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afluxcoin.com\/ru\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/afluxcoin.com\/ru\/wp-json\/wp\/v2\/comments?post=4439"}],"version-history":[{"count":0,"href":"https:\/\/afluxcoin.com\/ru\/wp-json\/wp\/v2\/posts\/4439\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/afluxcoin.com\/ru\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/afluxcoin.com\/ru\/wp-json\/wp\/v2\/media?parent=4439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afluxcoin.com\/ru\/wp-json\/wp\/v2\/categories?post=4439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afluxcoin.com\/ru\/wp-json\/wp\/v2\/tags?post=4439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}