gitmyhub

Stock-Prediction-Models

Jupyter Notebook ★ 9.4k updated 3y ago ▣ archived

Gathers machine learning and deep learning models for Stock forecasting including trading bots and simulations

A large collection of Jupyter Notebooks with machine learning models for predicting stock prices and simulating automated trading strategies. Built for learning and research, not live trading.

PythonJupyter NotebookTensorFlowPyTorchJavaScriptsetup: moderatecomplexity 3/5

Stock-Prediction-Models is a collection of machine learning and deep learning experiments aimed at forecasting stock prices and simulating trading strategies. Everything is organized as Jupyter Notebooks, which are interactive documents that combine code, charts, and explanations in a single file. The repository is intended as a research and learning resource rather than a production trading system.

The collection is split into two main areas. The first is price prediction models: about 18 deep learning architectures are included, covering a range of neural network types used for working with time-series data. Among them are LSTM networks (which process sequences of data by maintaining a kind of memory across time steps), GRU networks (a related but slightly simpler approach), convolutional approaches, and attention-based models. Some models use a technique called Seq2seq, where the model reads a sequence and outputs a new sequence, which can be useful for forecasting multiple future time steps at once.

The second area is trading agents: over 20 automated decision-making programs that decide when to buy or sell. These range from simple rule-based approaches like moving averages to more complex reinforcement learning agents, where the program learns by trial and error through simulated trading. Approaches include Q-learning, policy gradient methods, actor-critic setups, and evolution strategies.

Additional notebooks cover data exploration, including outlier detection and overbought/oversold analysis applied to Tesla stock, as well as Monte Carlo simulations (a way to model uncertainty by running many randomized scenarios) for portfolio optimization. A portfolio optimization notebook is also included.

A JavaScript version of one LSTM model and one trading agent is available as a browser-based demo, allowing you to upload historical stock data in CSV format and see predictions without installing any software.

The project is released under the Apache 2.0 license. It is primarily aimed at people learning machine learning techniques in the context of financial data, not at traders looking for a ready-made system.

Where it fits