Ayushpanditmoto / Trading-Bot

Binary Trading AI Bot is a project idea aimed at developing an AI-powered bot for binary trading. The bot utilizes machine learning algorithms to predict the direction of the next candle (whether it will move up or down) with high accuracy.
39 stars 44 forks source link

Lumibot: Sentiment Analysis Strategy for Backtesting #77

Closed shaziaakhan closed 2 weeks ago

shaziaakhan commented 1 month ago

Implementing a backtesting strategy for a trading bot that leverages sentiment analysis to inform buy and sell decisions.

Functionality:

Process:

  1. Gathers Sentiment: Fetches news headlines for the target stock within a specific timeframe.
  2. Estimates Sentiment: Analyzes the headlines using a custom estimate_sentiment function to determine sentiment and its confidence level.
  3. Trading Logic (High Confidence Only):
    • Only considers trades when the sentiment analysis has extremely high confidence (>0.999)
    • If sentiment is positive and confidence is high:
      • Sells existing holdings if previously bought.
      • Places a buy order with a "bracket order" (including take-profit and stop-loss prices).
    • If sentiment is negative and confidence is high:
      • Sells existing holdings if previously bought.
      • Places a sell order with a bracket order.
  4. Position Sizing: Allocates a portion of available cash (cash at risk percentage) for each trade.

Files added:

bot.py
utils.py
requirements.txt
shaziaakhan commented 3 weeks ago

@Ayushpanditmoto it has been more than a week! please merge this PR, thanks.