banexg

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 4 Imported by: 19

README

BanExg - CryptoCurrency Exchange Trading Library

A Go library for cryptocurrency trading, whose most interfaces are consistent with CCXT.
Please note that this library is under development and is not ready for production!

Notes

Use Options instead of direct fields assign to initialized a Exchange

When an exchange object is initialized, some fields of simple types like int will have default type values. When setting these in the Init method, it's impossible to distinguish whether the current value is one set by the user or the default value. Therefore, any configuration needed from outside should be passed in through Options, and then these Options should be read and set onto the corresponding fields in the Init method.

Documentation

Index

Constants

View Source
const (
	HasFail     = base.HasFail
	HasOk       = base.HasOk
	HasEmulated = base.HasEmulated
)
View Source
const (
	BoolNull  = base.BoolNull
	BoolFalse = base.BoolFalse
	BoolTrue  = base.BoolTrue
)
View Source
const (
	OptProxy           = base.OptProxy
	OptApiKey          = base.OptApiKey
	OptApiSecret       = base.OptApiSecret
	OptAccCreds        = base.OptAccCreds
	OptAccName         = base.OptAccName
	OptUserAgent       = base.OptUserAgent
	OptReqHeaders      = base.OptReqHeaders
	OptCareMarkets     = base.OptCareMarkets
	OptPrecisionMode   = base.OptPrecisionMode
	OptMarketType      = base.OptMarketType
	OptContractType    = base.OptContractType
	OptTimeInForce     = base.OptTimeInForce
	OptWsIntvs         = base.OptWsIntvs
	OptRetries         = base.OptRetries
	OptWsConn          = base.OptWsConn
	OptAuthRefreshSecs = base.OptAuthRefreshSecs
	OptPositionMethod  = base.OptPositionMethod
)
View Source
const (
	PrecModeDecimalPlace = utils.PrecModeDecimalPlace
	PrecModeSignifDigits = utils.PrecModeSignifDigits
	PrecModeTickSize     = utils.PrecModeTickSize
)
View Source
const (
	MarketSpot    = base.MarketSpot   // 现货交易
	MarketMargin  = base.MarketMargin // 保证金杠杆现货交易 margin trade
	MarketLinear  = base.MarketLinear
	MarketInverse = base.MarketInverse
	MarketOption  = base.MarketOption // 期权 for option contracts
	MarketSwap    = base.MarketSwap   // 永续合约 for perpetual swap futures that don't have a delivery date
	MarketFuture  = base.MarketFuture // 有交割日的期货 for expiring futures contracts that have a delivery/settlement date
)
View Source
const (
	MarginCross    = base.MarginCross
	MarginIsolated = base.MarginIsolated
)
View Source
const (
	OdStatusOpen      = base.OdStatusOpen
	OdStatusClosed    = base.OdStatusClosed
	OdStatusCanceled  = base.OdStatusCanceled
	OdStatusCanceling = base.OdStatusCanceling
	OdStatusRejected  = base.OdStatusRejected
	OdStatusExpired   = base.OdStatusExpired
)
View Source
const (
	OdTypeMarket          = base.OdTypeMarket
	OdTypeLimit           = base.OdTypeLimit
	OdTypeStopLoss        = base.OdTypeStopLoss
	OdTypeStopLossLimit   = base.OdTypeStopLossLimit
	OdTypeTakeProfit      = base.OdTypeTakeProfit
	OdTypeTakeProfitLimit = base.OdTypeTakeProfitLimit
	OdTypeStop            = base.OdTypeStop
	OdTypeLimitMaker      = base.OdTypeLimitMaker
)
View Source
const (
	OdSideBuy  = base.OdSideBuy
	OdSideSell = base.OdSideSell
)
View Source
const (
	PosSideLong  = base.PosSideLong
	PosSideShort = base.PosSideShort
	PosSideBoth  = base.PosSideBoth
)
View Source
const (
	TimeInForceGTC = base.TimeInForceGTC // Good Till Cancel 一直有效,直到被成交或取消
	TimeInForceIOC = base.TimeInForceIOC // Immediate or Cancel 无法立即成交的部分取消
	TimeInForceFOK = base.TimeInForceFOK // Fill or Kill 无法全部立即成交就撤销
	TimeInForceGTX = base.TimeInForceGTX // Good Till Crossing 无法成为挂单方就取消
	TimeInForceGTD = base.TimeInForceGTD // Good Till Date 在特定时间前有效,到期自动取消
	TimeInForcePO  = base.TimeInForcePO  // Post Only
)

Variables

View Source
var (
	ParamClientOrderId      = base.ParamClientOrderId
	ParamOrderIds           = base.ParamOrderIds
	ParamOrigClientOrderIDs = base.ParamOrigClientOrderIDs
	ParamSor                = base.ParamSor
	ParamPostOnly           = base.ParamPostOnly
	ParamTimeInForce        = base.ParamTimeInForce
	ParamTriggerPrice       = base.ParamTriggerPrice
	ParamStopLossPrice      = base.ParamStopLossPrice
	ParamTakeProfitPrice    = base.ParamTakeProfitPrice
	ParamTrailingDelta      = base.ParamTrailingDelta
	ParamReduceOnly         = base.ParamReduceOnly
	ParamCost               = base.ParamCost
	ParamClosePosition      = base.ParamClosePosition
	ParamCallbackRate       = base.ParamCallbackRate
	ParamRolling            = base.ParamRolling
	ParamTest               = base.ParamTest
	ParamMarginMode         = base.ParamMarginMode
	ParamSymbol             = base.ParamSymbol
	ParamPositionSide       = base.ParamPositionSide
	ParamProxy              = base.ParamProxy
	ParamName               = base.ParamName
	ParamMethod             = base.ParamMethod
	ParamInterval           = base.ParamInterval
	ParamAccount            = base.ParamAccount
)
View Source
var (
	ParamHandshakeTimeout = base.ParamHandshakeTimeout
	ParamChanCaps         = base.ParamChanCaps
	ParamChanCap          = base.ParamChanCap
)

Functions

This section is empty.

Types

type Account

type Account = base.Account

type Asset

type Asset = base.Asset

type Balances

type Balances = base.Balances

type BanExchange

type BanExchange = base.BanExchange

func New

func New(name string, options *map[string]interface{}) (BanExchange, *errs.Error)

type ChainNetwork

type ChainNetwork = base.ChainNetwork

type CodeLimits

type CodeLimits = base.CodeLimits

type Credential

type Credential = base.Credential

type Currency

type Currency = base.Currency

type CurrencyMap

type CurrencyMap = base.CurrencyMap

type Entry

type Entry = base.Entry

type Exchange

type Exchange = base.Exchange

type ExgFee

type ExgFee = base.ExgFee

type ExgHosts

type ExgHosts = base.ExgHosts

type Fee

type Fee = base.Fee

type FeeTierItem

type FeeTierItem = base.FeeTierItem

type FeeTiers

type FeeTiers = base.FeeTiers

type FuncAuth

type FuncAuth = base.FuncAuth

type FuncFetchCurr

type FuncFetchCurr = base.FuncFetchCurr

type FuncFetchMarkets

type FuncFetchMarkets = base.FuncFetchMarkets

type FuncGetWsJob

type FuncGetWsJob = base.FuncGetWsJob

type FuncNewExchange

type FuncNewExchange = func(map[string]interface{}) (BanExchange, *errs.Error)

type FuncOnWsClose

type FuncOnWsClose = base.FuncOnWsClose

type FuncOnWsErr

type FuncOnWsErr = base.FuncOnWsErr

type FuncOnWsMethod

type FuncOnWsMethod = base.FuncOnWsMethod

type FuncOnWsMsg

type FuncOnWsMsg = base.FuncOnWsMsg

type FuncSign

type FuncSign = base.FuncSign

type HttpReq

type HttpReq = base.HttpReq

type HttpRes

type HttpRes = base.HttpRes

type Kline

type Kline = base.Kline

type LimitRange

type LimitRange = base.LimitRange

type Market

type Market = base.Market

type MarketArrMap

type MarketArrMap = base.MarketArrMap

type MarketLimits

type MarketLimits = base.MarketLimits

type MarketMap

type MarketMap = base.MarketMap

type MyTrade

type MyTrade = base.MyTrade

type OhlcvArr

type OhlcvArr = base.OhlcvArr

type Order

type Order = base.Order

type OrderBook

type OrderBook = base.OrderBook

type OrderBookSide

type OrderBookSide = base.OrderBookSide

type Position

type Position = base.Position

type Precision

type Precision = base.Precision

type SymbolKline

type SymbolKline = base.SymbolKline

type Ticker

type Ticker = base.Ticker

type Trade

type Trade = base.Trade

type TradeFee

type TradeFee = base.TradeFee

type WebSocket

type WebSocket = base.WebSocket

type WsClient

type WsClient = base.WsClient

type WsJobInfo

type WsJobInfo = base.WsJobInfo

type WsMsg

type WsMsg = base.WsMsg

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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