models

package
v0.0.0-...-9421b4a Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAlgo

func DeleteAlgo(id int, owner string) error

func DeleteUser

func DeleteUser(user string) error

func EraseTransaction

func EraseTransaction() error

func GetUniqueAlgoTesting

func GetUniqueAlgoTesting() ([]int, error)

func GetUniqueAlgoTransaction

func GetUniqueAlgoTransaction() ([]int, error)

func InitDB

func InitDB(filename string) error

func InsertAccount

func InsertAccount(account Account) error

func InsertAlgo

func InsertAlgo(algor Algor) error

func InsertTestingBuy

func InsertTestingBuy(tb TestingBuy) error

func InsertTestingCalcTable

func InsertTestingCalcTable() error

func InsertTestingSell

func InsertTestingSell(ts TestingSell) error

func InsertTransactionBuy

func InsertTransactionBuy(tb TransactionBuy) error

func InsertTransactionSell

func InsertTransactionSell(ts TransactionSell) error

func UpdateAlgoState

func UpdateAlgoState(state string, id int, owner string) error

func UpdateOrderStatus

func UpdateOrderStatus(status string, id int) error

Types

type Account

type Account struct {
	Name           string
	ApiKey         string
	SecretKey      string
	ApiKey_test    string
	SecretKey_test string
}

func GetAccountByName

func GetAccountByName(name string) (Account, error)

func GetAccounts

func GetAccounts() ([]Account, error)

type AlgoStats

type AlgoStats struct {
	Botid             int
	TotalReturn       float64
	AvgReturnPerTrade float64
	AvgReturnPerMonth float64
	SucessRate        float64
	MaxDrawdown       float64
	AvgTradeTime      int
}

func GetAllAlgoStats

func GetAllAlgoStats() ([]AlgoStats, error)

func GetAllAlgoStatsLive

func GetAllAlgoStatsLive() ([]AlgoStats, error)

func GetStatsById

func GetStatsById(stats []AlgoStats, botid int) AlgoStats

func GetStatsById2

func GetStatsById2(botid int) (AlgoStats, error)

func GetStatsByIdLive

func GetStatsByIdLive(stats []AlgoStats, botid int) AlgoStats

type AlgoStatsLive

type AlgoStatsLive struct {
	Botid             int
	TotalReturn       float64
	AvgReturnPerTrade float64
	AvgReturnPerMonth float64
	SucessRate        float64
	MaxDrawdown       float64
	AvgTradeTime      int
}

type AlgoTesting

type AlgoTesting struct {
	Id        int
	Botid     int
	Ticket    string
	Buyvalue  float64
	Buytime   int64
	Sellvalue float64
	Selltime  int64
}

func GetTestingBuy

func GetTestingBuy(botid int) ([]AlgoTesting, error)

func GetTestingSell

func GetTestingSell(botid int) ([]AlgoTesting, error)

type AlgoTransaction

type AlgoTransaction struct {
	Id          int
	Botid       int
	Orderid     int
	Ticket      string
	Orderstatus string
	Buyvalue    float64
	Buyquantity float64
	Buytime     int
	Sellvalue   float64
	Selltime    int
}

func GetTransactionBuy

func GetTransactionBuy(botid int) ([]AlgoTransaction, error)

func GetTransactionPending

func GetTransactionPending(botid int) ([]AlgoTransaction, error)

func GetTransactionSell

func GetTransactionSell(botid int) ([]AlgoTransaction, error)

type Algor

type Algor struct {
	Id         int
	Owner      string
	Name       string
	Created    int64
	Buycode    string
	State      string
	BaseAsset  string
	QuoteAsset string
}

func GetAlgos

func GetAlgos(owner string) ([]Algor, error)

func GetAllAlgos

func GetAllAlgos() ([]Algor, error)

type TestingBuy

type TestingBuy struct {
	Botid      int
	Baseasset  string
	Quoteasset string
	Buyvalue   float64
	Buytime    int64
}

type TestingSell

type TestingSell struct {
	Entryid   int
	Sellvalue float64
	Selltime  int64
}

type TransactionBuy

type TransactionBuy struct {
	Botid       int
	Orderid     int
	Baseasset   string
	Quoteasset  string
	Orderstatus string
	Buyvalue    float64
	Buyquantity float64
	Buytime     int
}

type TransactionSell

type TransactionSell struct {
	Entryid     int
	Orderstatus string
	Sellvalue   float64
	Selltime    int
	Orderid     int
}

Jump to

Keyboard shortcuts

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