Skip to content

shoumik121/Neural-Network-Trading-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Neural Network Trading Bot

A neural network-powered trading bot that uses LSTM (Long Short-Term Memory) to predict cryptocurrency prices and backtest a simple buy/sell strategy based on those predictions.

πŸš€ Features

  • Fetches historical price data from Yahoo Finance (or generates synthetic data)
  • Preprocesses and scales time series data
  • Builds and trains a deep learning model using LSTM layers
  • Predicts future prices
  • Generates buy/sell signals
  • Simulates trades and backtests strategy
  • Visualizes predictions, signals, and portfolio performance

πŸ“ˆ Example Output

Example Chart

πŸ› οΈ Technologies Used

  • Python
  • TensorFlow / Keras
  • Scikit-learn
  • Pandas
  • NumPy
  • Matplotlib
  • Yahoo Finance (yfinance)

πŸ“¦ Installation

git clone https://github.com/yourusername/neural-network-trading-bot.git
cd neural-network-trading-bot
pip install -r requirements.txt


βš™οΈ Usage
You can run the bot directly using:

bash
Copy
Edit
python trading_bot.py
To customize:

python
Copy
Edit
bot = NeuralNetworkTradingBot(
    symbol='BTC-USD',
    start_date='2020-01-01',
    use_synthetic_data=True  # Set to False to fetch real data
)
bot.run()
πŸ“Š Backtesting Metrics
The bot calculates and displays:

Total return

Annualized return

Sharpe ratio

Buy/Sell actions

Portfolio value over time

πŸ“ Project Structure
bash
Copy
Edit
.
β”œβ”€β”€ trading_bot.py       # Main bot logic
β”œβ”€β”€ README.md            # This file
β”œβ”€β”€ requirements.txt     # Python dependencies
βœ… Requirements
numpy

pandas

matplotlib

scikit-learn

yfinance

tensorflow

You can install them with:

bash
Copy
Edit
pip install -r requirements.txt
πŸ“ˆ Strategy Logic
Buy Signal: If predicted price is >1% higher than previous close.

Sell Signal: If predicted price is >1% lower than previous close.

πŸ“Œ Limitations
The model is for educational purposes and may not perform well in real markets.

No risk management or transaction fee modeling.

Real-world trading requires more advanced strategy design and evaluation.

πŸ“„ License
This project is licensed under the MIT License.

πŸ‘€ Author
Your Name – Sadman Shoumik Rouf

Disclaimer: This software is for educational purposes only and is not financial advice.

About

Video player with controls Video information (title, views, likes) Channel subscription button Interactive like/dislike buttons Comment section with the ability to add new comments Recommended videos list

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages