Documentation
¶
Index ¶
- func AppendBalancesJSON(dst []byte, balances []Balance) []byte
- func AppendPriceLevelsJSON(dst []byte, levels []PriceLevel) []byte
- func PriceToTick(price float64, pricePrecision int) int
- func QuantityToTick(quantity float64, sizePrecision int) int
- type Balance
- type BookState
- type EngineType
- type Exchange
- type Interval
- type Order
- type OrderStatus
- type OrderType
- type PriceLevel
- type ProductType
- type Side
- type TimeInForce
- type WalletType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendBalancesJSON ¶
AppendBalancesJSON appends a []Balance (nil → null).
func AppendPriceLevelsJSON ¶
func AppendPriceLevelsJSON(dst []byte, levels []PriceLevel) []byte
AppendPriceLevelsJSON appends a []PriceLevel (nil → null).
func PriceToTick ¶
PriceToTick converts price to integer tick given precision. E.g. PriceToTick(71532.32, 2) = 7153232
func QuantityToTick ¶
QuantityToTick converts quantity to integer tick given precision. E.g. QuantityToTick(0.025, 5) = 2500
Types ¶
type Balance ¶
func (Balance) AppendJSON ¶
AppendJSON appends a Balance as a JSON object matching encoding/json field names.
type EngineType ¶
type EngineType int
const ( EngineData EngineType = iota EngineExecution EngineLedger EngineRisk EngineStrategy )
func (EngineType) String ¶
func (e EngineType) String() string
type Interval ¶
type Interval int
Interval is a normalized candlestick interval shared across venues.
func ParseInterval ¶
ParseInterval converts a config / venue interval string to Interval. Accepts Binance forms (1m, 1h, 1d) and Bybit forms (1, 60, D, W, M).
func (Interval) BinanceStream ¶
BinanceStream returns the Binance kline stream interval suffix (e.g. "1m").
func (Interval) BybitTopic ¶
BybitTopic returns the Bybit kline topic interval token (e.g. "1", "60", "D").
type OrderStatus ¶
type OrderStatus int
const ( OrderStatusUninitialized OrderStatus = iota OrderStatusInitialized OrderStatusAccepted OrderStatusPartiallyFilled OrderStatusFilled OrderStatusCanceled OrderStatusRejected OrderStatusCancelling OrderStatusUnknown )
func (OrderStatus) Cancellable ¶
func (o OrderStatus) Cancellable() bool
func (OrderStatus) IsOpen ¶
func (o OrderStatus) IsOpen() bool
func (OrderStatus) IsTerminal ¶
func (o OrderStatus) IsTerminal() bool
type PriceLevel ¶
PriceLevel represents a single price level in an order book. PriceTick and QuantityTick are integer representations using symbol precision: PriceTick = round(Price * 10^PricePrecision), e.g. 71532.32 with precision 2 -> 7153232 QuantityTick = round(Quantity * 10^SizePrecision), e.g. 0.025 with precision 5 -> 2500
func (PriceLevel) AppendJSON ¶
func (p PriceLevel) AppendJSON(dst []byte) []byte
AppendJSON appends a PriceLevel as a JSON object matching encoding/json field names.
type ProductType ¶
type ProductType int
const ( ProductTypeUnknown ProductType = iota ProductTypeSpot // id=1 ProductTypePerpetual // id=2 )
type TimeInForce ¶
type TimeInForce int
const ( TimeInForceGTC TimeInForce = iota TimeInForceIOC TimeInForceFOK TimeInForcePO )
func (TimeInForce) String ¶
func (t TimeInForce) String() string
type WalletType ¶
type WalletType int
const ( WalletTypeUnknown WalletType = iota WalletTypeSpot // id=1 WalletTypeUMargin // id=2 (USD Margin) WalletTypeCMargin // id=3 (Coin Margin) WalletTypeLeverage // id=4 WalletTypeUnified // id=5 )
func (WalletType) String ¶
func (w WalletType) String() string