FAT Trading BOT

Library

  • Web Frimework Gin Gonic installed (version v1.7.7)
  • A SQL Compiler sqlc installed (version v1.11.0)
  • Database Migrations golang-migrate installed (version v4.15.1)
  • Management Configuration File viper installed (version v1.10.1)

Exchange

Indicator trading support

  • RSI
  • MACD
  • MA
  • EMA
  • BBANDS
  • SMA
  • WMA
  • KAMA
  • DEMA
  • MACDEXT
  • TEMA

Installation

To install FAT, you need to install Go and set your Go workspace first.
To install Gin package, you need to install Go and set your Go workspace first.

  1. The first need Go installed (version 1.13+ is required), then you can use the below Go command to install Gin.
$ go mod init
$ go mod tidy
  1. Setup Envronment :

ENV_APP=dev
ADDRESS_APP=0.0.0.0:9091

## DATABASE ENVIRONMENT ##
DATABASE_HOST=
DATABASE_PORT=
DATABASE_USER=
DATABASE_PASS=
DATABASE_NAME=

## EXCHANGE ENVIRONMENT ##
INDODAX_MAIN_DOMAIN=https://indodax.com
INDODAX_PUBLIC_KEY=
INDODAX_PRIVATE_KEY=
INDODAX_CRYPTO_CURRENCY=btcidr 
INDODAX_CRYPTO_TYPE=btc 
INDODAX_PAIR=btc_idr
INDODAX_PERIODE_TIME=1440  
INDODAX_TIME_FRAME=1

Quick start

the configuration the start already define on Makefile

# Makefile
sqlc:
	sqlc generate

generate_migration:
	migrate create -ext sql -dir ./repository/migrations -seq $(table)

dbup:
	migrate -database "postgres://postgres:[email protected]:5432/fat?sslmode=disable" -path ./repository/migrations up

dbdown:
	migrate -database "postgres://postgres:[email protected]st:5432/fat?sslmode=disable" -path ./repository/migrations down

dbrollback:
	migrate -path ./repository/migrations -database "postgres://postgres:[email protected]:5432/fat?sslmode=disable" force $(version)

server_dev:
	go run . --environment=dev

server_stg:
	go run . --environment=staging
    
server_prod:
	go run . --environment=production

# example the following below
# this for generate sql on respository
$ make sqlc

# this for generate sql file migration on directory ./repository/migrations
$ make generate_migration table=table_name

# this for migration db up
$ make dbup

# this for migration db dwn
$ make dbdown

# this for rollback dirty db version
$ make dbrollback version=1

# this for run server with environemnet dev
$ make server_dev

# this for run server with environemnet staging
$ make server_stg

# this for run server with environemnet production
$ make server_prod

GitHub

View Github