Skip to content

A Youtube Live chat bot that makes trades in a custom simulated live market based on commands sent directly in the stream chat!

Notifications You must be signed in to change notification settings

ScruffyTheMoose/stream_trader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stream Trader

Python

Stream Trader is a Youtube based chat bot. It receives commands in the live chat of a stream and makes trades in a simulated 'paper' market. This bot is made possible using the yahoo_fin and pytchat libraries.

This bot was inspired by Joma's video allowing users in his live chat to trade by issuing commands to a chatbot. This bot allows only for standard buy/sell order and will not permit short selling.

All operations completed by the bot will be saved to a .log file.

Launch

python run.py <stream-id>

Live Chat Commands

None of the commands are case sensitive. There are a series of code blocks to catch errors and log specific details regarding what occurred.

  • Purchase a share
!buy ['ticker-symbol']
[HH:MM:SS] -- <user> successfully purchased share of $AAPL for $155.47
  • Sell a share
!sell ['ticker-symbol']
[HH:MM:SS] -- <user> successfully sold share of $AAPL for $127.86
  • Check updated PnL
!update
[HH:MM:SS] -- Current Profit/Loss: $88977.24
  • Bot Uptime
!uptime
[HH:MM:SS] -- Current uptime: HH:MM:SS // the time in [square braces] is the time of the log, the uptime is the running time of the bot

Errors

  • Balance
[HH:MM:SS] -- There is not a large enough balance to purchase ${ticker}
  • Share Count
[HH:MM:SS] -- There are no remaining shares of ${ticker} to sell
  • Holdings
[HH:MM:SS] -- There are no holdings of ${ticker} currently in the portfolio
  • Command
[HH:MM:SS] -- Incorrect command syntax, try: !buy ['ticker-symbol'] or !sell ['ticker-symbol']
  • Symbol Not Found
[HH:MM:SS] -- No pricing data found for ticker ${ticker}

About

A Youtube Live chat bot that makes trades in a custom simulated live market based on commands sent directly in the stream chat!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages