mysql

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: MIT Imports: 10 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 GetGlobal added in v1.8.1

func GetGlobal(sessionData *types.Session) (profit float64, profitNet float64, profitPct float64, transactTime int64, err error)

GetGlobal get global data

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 GetOrderByOrderID added in v1.9.2

func GetOrderByOrderID(
	sessionData *types.Session) (order types.Order, err error)

GetOrderByOrderID Return order by OrderID (uses ThreadID as filter)

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) (order types.Order, 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) (profit float64, profitNet 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) (order types.Order, err error)

GetThreadLastTransaction function returns the last BUY transaction for a Thread

func GetThreadTransactionByPrice

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

GetThreadTransactionByPrice retrieve lowest price order from Thread database

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 SaveGlobal added in v1.8.1

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

SaveGlobal Save initial global settings

func SaveOrder

func SaveOrder(
	sessionData *types.Session,
	order *types.Order,
	orderIDSource int64,
	orderPrice float64) (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 UpdateGlobal added in v1.8.1

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

UpdateGlobal Update global settings

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