Skip to content

My AI HF news trading bot, executes BUY/SELL SHORT/COVER, CALL trades within <100ms from news release depending on ping. Many other features to optimize your portfolio. Uses Alpaca, Benzinga News, FM FMP, GPT 4o

Notifications You must be signed in to change notification settings

crollila/High-Frequency-Trading-Algorithm-with-Instant-News-Sentiment-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatGPTTradingBot ⭐

This is my AI high frequency trading algorithm, a Node.js project that uses the Alpaca Trade API for trading activities. When a live news event is released via Benzinga News, it will send the important data from the article to a tailored GPT 4o model and receive a sentiment analysis score on if the event will have a positive or negative effect on the company stock on a scale from 0-100, 0=worst news, 100=best news, all within 20ms. Based on the score, an algorithm determines if and how much it will BUY/SELL or SHORT/COVER the stock, the algorithm scales based on funds in the account and will adjust if margin trading is wanted. Any quantity of money used up to $10,000,000 will have similar profitable results. Location used has largest impact on success.

Additional Features:

  • Adjustable Fail safe mechanism at different thresholds that will sell all positions in the event of
  • Adjustable requirements for the volume/liquidity of a stock to be able to buy or short.
  • Adjustable profit taking thresholds, 2%, 4%, 6%, 10% - Along with % of stock to be sold/covered after profiting from those thresholds.
  • Instant and efficient News Reception, parsing, data feed into LLM and consistent accurate responses.
  • From news -> Purchased stock = 5-70ms
  • Live Logs all scores and prices of stock to compare against portfolio to make any adjustments/optimizations as needed at all times.
  • Supports pre-market and after-market trading
  • Supports pre-market and after-market live pricing updates to accurate adjust portfolio at all times.
  • In the case of internet outage, bot will continue to retry and run to save and update positions as soon as problems are resolved.
  • Console log updates on thought process and execution of bot
  • Bot will not invest in Crypto currencies, Adjustable

BOT INFO

3 - "Time in beats timing" 5% emergency sell off - sell off lowest on new opportunity - Margin/Short If anything drops 5% from highest logged price, sell (LONG) If anything drops 5% from highest logged price, buy (SHORT) Buy/Short tradeValueThreshold = 5000000 : /1 Buy/Short limit_price = current_price * 1.007 : .993 Sell/Cover limit_price = current_price * .99 : 1.01 emergency sell-off/cover @3.5% loss of position from avg purchase price

RegT Threshold @ 98%

Getting Started

Prerequisites

Running the Server

This script uses ECMAScript (ES) modules, which is a modern JavaScript module system that differs from CommonJS

  • node s.mjs

Dependancies

  • @alpacahq/alpaca-trade-api
  • dotenv
  • fs
  • moment-timezone
  • node-fetch
  • openai

Tech Stack

  • Node.js (version 12 +)
  • JavaScript (ES Modules)
  • npm (usually comes with Node.js)(npm install)
  • OpenAI
  • dotenv
  • node-fetch
  • @alpacahq/alpaca-trade-api
  • fs & fs/promises
  • moment-timezone npm install dotenv node-fetch @alpacahq/alpaca-trade-api moment-timezone openai

About

My AI HF news trading bot, executes BUY/SELL SHORT/COVER, CALL trades within <100ms from news release depending on ping. Many other features to optimize your portfolio. Uses Alpaca, Benzinga News, FM FMP, GPT 4o

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published