exg

package
v0.2.30 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: AGPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AfterCreateOrder func(*PutOrderRes) *errs.Error
)
View Source
var AllowExgIds = map[string]bool{
	"binance": true,
	"bybit":   true,
	"china":   true,
}

Functions

func GetAlignOff

func GetAlignOff(exgName string, tfSecs int) int

GetAlignOff Obtain the time offset of the aggregation for the specified period, in seconds 获取指定周期聚合的时间偏移,单位:秒

func GetLeverage

func GetLeverage(symbol string, notional float64, account string) (float64, float64)

func GetOdBook

func GetOdBook(pair string) (*banexg.OrderBook, *errs.Error)

func GetTickers24Hr added in v0.2.23

func GetTickers24Hr() (map[string]*banexg.Ticker, *errs.Error)

func GetWith

func GetWith(name, market, contractType string) (banexg.BanExchange, *errs.Error)

func PrecAmount

func PrecAmount(exchange banexg.BanExchange, symbol string, amount float64) (float64, *errs.Error)

func PrecCost

func PrecCost(exchange banexg.BanExchange, symbol string, cost float64) (float64, *errs.Error)

func PrecPrice

func PrecPrice(exchange banexg.BanExchange, symbol string, price float64) (float64, *errs.Error)

func Setup

func Setup() *errs.Error

Types

type BotExchange added in v0.2.18

type BotExchange struct {
	banexg.BanExchange
}

func (*BotExchange) CreateOrder added in v0.2.18

func (e *BotExchange) CreateOrder(symbol, odType, side string, amount, price float64, params map[string]interface{}) (*banexg.Order, *errs.Error)

type PutOrderRes added in v0.2.18

type PutOrderRes struct {
	Symbol    string
	OrderType string
	Side      string
	Amount    float64
	Price     float64
	Params    map[string]interface{}
	Order     *banexg.Order
	Err       *errs.Error
}

Jump to

Keyboard shortcuts

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