Neural Networks and Deep Learning

Lecture 5 · Game: Up or down tomorrow?

Up or down tomorrow?

You see the last 60 trading days of the S&P 500 index or of the Banca Transilvania share (TLV, Bucharest Stock Exchange) and decide: will the next trading day close up or down? After each decision you see the forecast of the recurrent network of Lecture 5 and the real close. All 10 days come from the test period of the lecture (2020 to October 2026), which the network never saw during training.

The network is the LSTM (long short-term memory network) of the lecture: 16 hidden units, it reads the last 22 daily returns and forecasts the next one. It was trained on 2005 to 2016 (TLV: 2008 to 2016) and tuned on 2017 to 2019. The lecture trained five such networks with different seeds; the game shows their average forecast and says 'up' when it is positive. On the S&P 500 test days this average says 'up' on 70.2% of days.

Class board for the projector

Data: S&P 500 adjusted closes (Yahoo Finance) and Banca Transilvania adjusted closes (EODHD, Bucharest Stock Exchange); forecasts: cached LSTM forecasts of analysis_L5.py (lectures/L5/cache/ret.pkl). The 40 days of the game are drawn at random from the test days (20 per series; seed 20261108); every game draws 5 of each series. Code: lectures/L5/make_game_L5.py.