wyhwong / CATBOT

This project is a cloud application dedicated to auto cryptocurrency trading powered by primitive text scraping, text classification, and time series analysis.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CATBOT - Crypto Auto Trading Bot

CATBOT is a final capstone project for FINA4162 Big Data Applications and Financial Analytics, Advanced Diploma in FinTech, HKU School of Professional and Continuing Education. CATBOT is a cloud application dedicated to auto cryptocurrency trading powered by primitive text scraping, text classification, and time series analysis. We aim for a lightweight cloud application to get the best cost-performance efficiency.

Declaration: Please note that the data visualization or any scores provided is solely for reference purposes, and any conclusions drawn from it should be considered at your own risk. I cannot be held responsible for any losses or damages resulting from the analysis of this data.


Pipeline Diagram

plot


Prerequisites


Minimum System Requirements

CPU: i5-6500 or Equivalent
Memory: 2 GB RAM
Storage: 18 GB available space

Development

# Build Docker images
make build

# Start containers
make start

Deployment

# Build Docker images
make build

# Start containers
make start MODE=prod

Clean up

# Remove all containers
make clean

More Details on Pipeline Components

In this part, we add more details on the operation of the whole pipeline, the Slack command interface, and the features of each component. The most important concept of the product design is a lightweight cloud application to conduct an all-rounded analysis every several minutes, monitoring the price trend, financial news, and social media.

Slack Bot

The Slack bot records all analysis results on Slack channels and sends notifications on trades processed. The following commands are supported:

help: Show all you can do with CATBOT
    - Format: help
target: Target the cryptocurrency for trading
    - Format: target [target_1] [target_2] ...
    - Example: target BTCUSDT ETHUSDT
untarget: Untarget the cryptocurrency for trading
    - Format: untarget [target_1] [target_2] ...
    - Example: untarget BTCUSDT ETHUSDT
list_targets: List the currently targets set
    - Format: list_targets
set_log: Set the channel for logging
    - Format: set_log
unset_log: Unset the channel for logging
    - Format: unset_log
analyze: Start a text plus statistical analysis on targeted cryptocurrencies
    - Format: analyze
t_analyze: Start text analysis on a set of keywords
    - Format: t_analyze [keyword_1] [keyword_2]
    - Example: t_analyze crypto
s_show_klines: Show the klines of targeted coin
    - Format: s_show_klines [target] [number of hours to collect data] [sampling frequency]
    - Example: s_show_klines BTCUSDT 24 5m
s_show_last_predict: Show the prediction of targeted coin
    - Format: s_show_last_predict [target]
    - Example: s_show_klines BTCUSDT

# NOTE: require_privilege in the help command message means whether every user can call the command
# Or the command will only be callable for the admin Slack user
# It is configurable at configs/slackbot/commands.yml

Due to the time constraint on development, currently, only the following targets are supported:

  • BTCUSDT
  • ETHUSDT
  • BNBUSDT
  • MATICUSDT
  • SOLUSDT
  • LTCUSDT
  • SHIBUSDT
  • XRPUSDT
  • FILUSDT
  • APTUSDT
  • ADAUSDT

Quick Demonstration

  • This is a demonstration generated by s_show_klines ETHUSDT:

plot

  • This is a demonstration generated by s_show_last_predict ETHUSDT (LSTM disabled):

plot


Text Analyzer

The text analyzer contains the following parts:

1. Financial News Scraper, to scrape text contents from financial news websites
2. Reddit Post Scraper, to scrape Reddit posts
3. Twitter Post Scraper, to scrape Tweets
4. Text Classification, to give a score to each text content scraped

Statistical Analyzer

The statistical analyzer contains the following parts:

1. Binance API, to query time series data from Binance
2. Compose of time series models, to analyze queried time series data and forecast the future trend
    a. AutoARIMA
    b. LightGBM
    c. LSTM (need to be enabled in the config)

MQTT Broker

The MQTT Broker is used for container-to-container communication.


Future Development

In the future, we may update CATBOT with the following changes:

- Trading related commands
- Self trained text classifcation model
- Better financial news scrapers with Selenium
- Self trained time series forecasting model
- More time series forecasting algorithms
- Multi-platform supports, for example, Discord

Authors

@wyhwong, @KenHo11, @wayneau1220

About

This project is a cloud application dedicated to auto cryptocurrency trading powered by primitive text scraping, text classification, and time series analysis.

License:MIT License


Languages

Language:Python 97.8%Language:Makefile 1.2%Language:Dockerfile 1.0%