Documentation
¶
Index ¶
- Constants
- type WS
- func (ws *WS) Auth(key, secret string) chan struct{}
- func (ws *WS) Connect() error
- func (ws *WS) Disconnect() error
- func (ws *WS) Nonce() int64
- func (ws *WS) RegisterReStart(ch chan int64)
- func (ws *WS) SubOrder(ch chan WSOrder, contracts []bitmex.Contracts) chan struct{}
- func (ws *WS) SubPosition(ch chan WSPosition, contracts []bitmex.Contracts) chan struct{}
- func (ws *WS) SubQuote(ch chan WSQuote, contracts []bitmex.Contracts)
- func (ws *WS) SubTrade(ch chan WSTrade, contracts []bitmex.Contracts)
- func (ws *WS) SubWallet(ch chan bitmex.WSWallet) chan struct{}
- func (ws *WS) SubWalletAgain() chan struct{}
- type WSOrder
- type WSPosition
- type WSQuote
- type WSTrade
Constants ¶
View Source
const ( IDLE = 0 RESET = 1 EXIT = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WS ¶
WS - websocket connection object
func (*WS) RegisterReStart ¶
func (*WS) SubPosition ¶
func (ws *WS) SubPosition(ch chan WSPosition, contracts []bitmex.Contracts) chan struct{}
SubPosition - subscribe to position chage events
func (*WS) SubWalletAgain ¶
func (ws *WS) SubWalletAgain() chan struct{}
type WSOrder ¶
type WSOrder struct { Timestamp time.Time `json:"timestamp"` TransactTime time.Time `json:"transactTime"` OrderID uuid.UUID `json:"orderID"` OrderQty int64 `json:"orderQty"` Account int64 `json:"account"` DisplayQty int64 `json:"displayQty"` LeavesQty int64 `json:"leavesQty"` CumQty int64 `json:"cumQty"` Price float64 `json:"price"` SimpleOrderQty float64 `json:"simpleOrderQty"` StopPx float64 `json:"stopPx"` PegOffsetValue float64 `json:"pegOffsetValue"` SimpleCumQty float64 `json:"simpleCumQty"` SimpleLeavesQty float64 `json:"simpleLeavesQty"` AvgPx float64 `json:"avgPx"` Side string `json:"side"` ClOrdID string `json:"clOrdID"` Symbol bitmex.Contracts `json:"symbol"` PegPriceType string `json:"pegPriceType"` Currency bitmex.Contracts `json:"currency"` SettlCurrency bitmex.Contracts `json:"settlCurrency"` ExecInst string `json:"execInst"` ContingencyType string `json:"contingencyType"` ExDestination string `json:"exDestination"` OrdStatus string `json:"ordStatus"` Triggered string `json:"triggered"` WorkingIndicator string `json:"workingIndicator"` OrdRejReason string `json:"ordRejReason"` MultiLegReportingType string `json:"multiLegReportingType"` Text string `json:"text"` }
WSOrder - order structure
type WSPosition ¶
type WSPosition struct { Timestamp time.Time `json:"timestamp"` Symbol bitmex.Contracts `json:"symbol"` Account int64 `json:"account"` CurrentQty int64 `json:"currentQty"` MarkPrice float64 `json:"markPrice"` SimpleQty float64 `json:"simpleQty"` SimplePnl float64 `json:"simplePnl"` LiquidationPrice float64 `json:"liquidationPrice"` }
WSPosition - position structure
type WSQuote ¶
type WSQuote struct { Timestamp time.Time `json:"timestamp"` Symbol bitmex.Contracts `json:"symbol"` BidPrice float64 `json:"bidPrice"` BidSize int64 `json:"bidSize"` AskPrice float64 `json:"askPrice"` AskSize int64 `json:"askSize"` }
WSQuote - quote structure
type WSTrade ¶
type WSTrade struct { Size float64 `json:"size"` Price float64 `json:"price"` ForeignNotional float64 `json:"foreignNotional"` GrossValue float64 `json:"grossValue"` HomeNotional float64 `json:"homeNotional"` Symbol string `json:"symbol"` TickDirection string `json:"tickDirection"` Side string `json:"side"` TradeMatchID string `json:"trdMatchID"` Timestamp time.Time `json:"timestamp"` }
WSTrade - trade structure
Click to show internal directories.
Click to hide internal directories.