Skip to content

This is a trading bot which sells or buys based on sentiment analysis of the news

Notifications You must be signed in to change notification settings

siddharthprakash1/TradingBot_

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MLTrader: A Machine Learning Trading Bot

Project Overview

MLTrader is an innovative automated trading bot that leverages the power of machine learning to analyze financial news sentiment and execute trades based on the sentiment analysis. It utilizes the FinBERT model, a BERT-based model pre-trained on financial text to assess the sentiment of financial news. This project aims to capitalize on market movements by executing trades with the SPY ETF based on news sentiment, using Alpaca for trade execution and Yahoo Finance for backtesting. image

Features

  • Sentiment Analysis with FinBERT: Uses the FinBERT model to analyze the sentiment of financial news, categorizing them into positive, negative, or neutral.
  • Automated Trading on Alpaca: Executes trades based on the sentiment analysis results, with strategies for both positive and negative sentiments.
  • Backtesting Capability: Allows for backtesting strategies using historical data from Yahoo Finance to evaluate performance.
  • Risk Management: Implements a simple risk management strategy by allocating a configurable percentage of the cash balance to each trade.

Installation

Prerequisites

  • Python 3.8 or later.
  • An Alpaca brokerage account for trading execution.
  • CUDA-compatible GPU for running FinBERT model (optional but recommended for performance).

Configuration:

Before running MLTrader, configure the following settings in your project: -Alpaca API Keys: Set your Alpaca API key and secret in the ALPACA_CREDS dictionary. -FinBERT Model: The project uses ProsusAI/finbert for sentiment analysis. Ensure you have internet access for the initial download of the model.

Usage

Sentiment Analysis The finbert_utils module is responsible for processing financial news headlines to estimate their sentiment. The sentiment analysis function estimate_sentiment utilizes the FinBERT model to categorize sentiment as positive, negative, or neutral, influencing trading decisions.

Setup

  1. Clone the repository:
git clone https://github.com/yourusername/TradingBot_.git

About

This is a trading bot which sells or buys based on sentiment analysis of the news

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages