mysql

package
v1.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBInit

func DBInit() *sql.DB

DBInit export

This function initializes GCP mysql database connectivity

func DeleteSession

func DeleteSession(
	sessionData *types.Session) (err error)

DeleteSession Delete session from Session table

func DeleteThreadTransactionByOrderID

func DeleteThreadTransactionByOrderID(
	sessionData *types.Session,
	orderID int) (err error)

DeleteThreadTransactionByOrderID function

func GetLastOrderTransactionPrice

func GetLastOrderTransactionPrice(
	sessionData *types.Session,
	Side string) (price float64, err error)

GetLastOrderTransactionPrice Get time for last transaction the ThreadID

func GetLastOrderTransactionSide

func GetLastOrderTransactionSide(
	sessionData *types.Session) (side string, err error)

GetLastOrderTransactionSide Get Side for last transaction the ThreadID

func GetOrderSymbol

func GetOrderSymbol(
	sessionData *types.Session) (symbol string, err error)

GetOrderSymbol Get symbol for ThreadID

func GetOrderTransactionCount

func GetOrderTransactionCount(
	sessionData *types.Session,
	side string) (count float64, err error)

GetOrderTransactionCount Retrieve transaction count by Side and minutes

func GetOrderTransactionPending

func GetOrderTransactionPending(
	sessionData *types.Session) (orderID int64, symbol string, err error)

GetOrderTransactionPending Get 1 order with pending FILLED status

func GetOrderTransactionSideLastTwo

func GetOrderTransactionSideLastTwo(
	sessionData *types.Session) (side1 string, side2 string, err error)

GetOrderTransactionSideLastTwo function

func GetProfit

func GetProfit(
	sessionData *types.Session) (fiat float64, percentage float64, err error)

GetProfit retrieve total and average percentage profit

func GetProfitByThreadID

func GetProfitByThreadID(sessionData *types.Session) (fiat float64, percentage float64, err error)

GetProfitByThreadID retrieve total and average percentage profit by ThreadID

func GetSessionStatus

func GetSessionStatus(
	sessionData *types.Session) (threadID string, err error)

GetSessionStatus check for system error status

func GetThreadAmount

func GetThreadAmount(
	sessionData *types.Session) (amount float64, err error)

GetThreadAmount Retrieve Thread Dollar Amount

func GetThreadCount

func GetThreadCount(
	sessionData *types.Session) (count int, err error)

GetThreadCount Retrieve Running Thread Count

func GetThreadLastTransaction

func GetThreadLastTransaction(
	sessionData *types.Session) (orderID int, price float64, executedQuantity float64, cumulativeQuoteQty float64, transactTime int64, err error)

GetThreadLastTransaction Return the last 'active' BUY transaction for a Thread

func GetThreadTransactionByPrice

func GetThreadTransactionByPrice(
	marketData *types.Market,
	sessionData *types.Session) (orderID int, price float64, executedQuantity float64, cumulativeQuoteQty float64, transactTime int64, err error)

GetThreadTransactionByPrice function

func GetThreadTransactionByPriceHigher

func GetThreadTransactionByPriceHigher(
	marketData *types.Market,
	sessionData *types.Session) (order types.Order, err error)

GetThreadTransactionByPriceHigher function returns the highert Thread order above a certain treshold. It is used for STOPLOSS Loss as ratio that should trigger a sale

func GetThreadTransactionByThreadID

func GetThreadTransactionByThreadID(
	sessionData *types.Session) (orders []types.Order, err error)

GetThreadTransactionByThreadID Retrieve transaction count by Side and minutes

func GetThreadTransactionCount

func GetThreadTransactionCount(
	sessionData *types.Session) (count int, err error)

GetThreadTransactionCount Get Thread count

func GetThreadTransactionDistinct

func GetThreadTransactionDistinct(
	sessionData *types.Session) (threadID string, threadIDSession string, err error)

GetThreadTransactionDistinct Get Thread Distinct

func GetThreadTransactiontUpmarketPriceCount

func GetThreadTransactiontUpmarketPriceCount(
	sessionData *types.Session,
	price float64) (count int, err error)

GetThreadTransactiontUpmarketPriceCount function

func InitSocketConnectionPool

func InitSocketConnectionPool() (*sql.DB, error)

InitSocketConnectionPool initializes a Unix socket connection pool for a Cloud SQL instance of SQL Server.

func InitTCPConnectionPool

func InitTCPConnectionPool() (*sql.DB, error)

InitTCPConnectionPool initializes a TCP connection pool for a Cloud SQL instance of SQL Server.

func SaveOrder

func SaveOrder(
	sessionData *types.Session,
	ClientOrderID string,
	CumulativeQuoteQuantity float64,
	ExecutedQuantity float64,
	OrderID int64,
	OrderIDSource int64,
	Price float64,
	Side string,
	Status string,
	Symbol string,
	TransactTime int64) (err error)

SaveOrder Save order to database

func SaveSession

func SaveSession(
	configData *types.Config,
	sessionData *types.Session) (err error)

SaveSession Save new session to Session table.

func SaveThreadTransaction

func SaveThreadTransaction(
	sessionData *types.Session,
	OrderID int64,
	CumulativeQuoteQuantity float64,
	Price float64,
	ExecutedQuantity float64) (err error)

SaveThreadTransaction Save Thread cycle to database

func UpdateOrder

func UpdateOrder(
	sessionData *types.Session,
	OrderID int64,
	CumulativeQuoteQuantity float64,
	ExecutedQuantity float64,
	Price float64,
	Status string) (err error)

UpdateOrder Update order

func UpdateSession

func UpdateSession(
	configData *types.Config,
	sessionData *types.Session) (err error)

UpdateSession Update existing session on Session table

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL