Skip to content

theYsnS/bist100-stock-predictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BIST100 Stock Price Predictor

Python TensorFlow Keras License: MIT

Deep learning model for predicting BIST100 stock index movements using LSTM (Long Short-Term Memory) neural networks. The system fetches real-time market data, computes technical indicators, and generates price predictions with backtesting capabilities.

Features

  • LSTM Neural Network: Bidirectional LSTM with configurable architecture
  • Technical Indicators: SMA, EMA, RSI, MACD, Bollinger Bands
  • Real-time Data: Fetches live data via Yahoo Finance API
  • Backtesting Engine: Simulate trading strategies with performance metrics
  • Visualization: Publication-quality charts for predictions and analysis
  • Performance Metrics: MSE, MAE, RMSE, R² score, Sharpe Ratio

Model Architecture

Input (sequence_length, features)
    │
    ▼
Bidirectional LSTM (128 units)
    │
    ▼
Dropout (0.2)
    │
    ▼
LSTM (64 units)
    │
    ▼
Dropout (0.2)
    │
    ▼
Dense (32, ReLU)
    │
    ▼
Dense (1, Linear) → Price Prediction

Installation

git clone https://github.com/theYsnS/bist100-stock-predictor.git
cd bist100-stock-predictor
pip install -r requirements.txt

Usage

# Train model
python main.py --mode train --ticker XU100.IS --epochs 100

# Predict next day
python main.py --mode predict --ticker XU100.IS

# Backtest strategy
python main.py --mode backtest --ticker XU100.IS --start-date 2023-01-01

Results

The model achieves strong performance on BIST100 historical data:

  • RMSE: ~1.2% of average price
  • R² Score: 0.94+
  • Directional Accuracy: ~68%

Project Structure

bist100-stock-predictor/
├── src/
│   ├── data_loader.py     # Data fetching & preprocessing
│   ├── model.py           # LSTM model definition
│   ├── visualizer.py      # Chart generation
│   └── backtester.py      # Trading simulation
├── config/
│   └── model_config.yaml
├── main.py
├── requirements.txt
└── README.md

License

MIT License - see LICENSE for details.

About

Deep learning LSTM model for BIST100 stock index prediction using TensorFlow and Keras

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages