Documentation ¶
Index ¶
- type Balance
- type Book
- func (b *Book) AddAsk(price string, ask *BookOrder)
- func (b *Book) AddBid(price string, bid *BookOrder)
- func (b *Book) AddBoughtCost(v *big.Float)
- func (b *Book) AddBoughtVolume(v *big.Float)
- func (b *Book) AddProfit(v *big.Float)
- func (b *Book) DeleteAsk(price string)
- func (b *Book) DeleteBid(price string)
- func (b *Book) GetAsk(price string) *BookOrder
- func (b *Book) GetBid(price string) *BookOrder
- func (b *Book) GetBoughtCost() *big.Float
- func (b *Book) GetBoughtVolume() *big.Float
- func (b *Book) GetMaxBid() *BookOrder
- func (b *Book) GetMaxBidPrice() *big.Float
- func (b *Book) GetMinAsk() *BookOrder
- func (b *Book) GetMinAskPrice() *big.Float
- func (b *Book) GetProfit() *big.Float
- func (b *Book) GetSpread() *big.Float
- func (b *Book) NewBuySession(buyVolume *big.Float) *buy.Session
- func (b *Book) NewSpreadSession(buyVolume *big.Float) *spread.Session
- func (b *Book) SetSpread(spread *big.Float)
- func (b *Book) SubProfit(v *big.Float)
- func (b *Book) UpdateMaxBidPrice() bool
- func (b *Book) UpdateMinAskPrice() bool
- type BookOrder
- type DumpStorage
- func (d *DumpStorage) DumpStorage(path string) error
- func (v DumpStorage) MarshalEasyJSON(w *jwriter.Writer)
- func (v DumpStorage) MarshalJSON() ([]byte, error)
- func (d *DumpStorage) Recover(path string) error
- func (v *DumpStorage) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *DumpStorage) UnmarshalJSON(data []byte) error
- type Order
- type Pair
- type Storage
- func (s *Storage) AppendDeals(deals ...*response.Deal)
- func (s *Storage) CleanUpOldOrders() int
- func (s *Storage) GetBalance(currency string) *Balance
- func (s *Storage) GetOrderBook(base, quoted string) *Book
- func (s *Storage) GetPair(pairName string) *Pair
- func (s *Storage) GetUserOrder(id int64) *Order
- func (s *Storage) GetUserOrders() map[int64]*Order
- func (s *Storage) RegisterOrderBook(pair *Pair, orderBookEventBroker *broker.Broker) *Book
- func (s *Storage) UpdatePairs(pairs []*Pair)
- func (s *Storage) UpsertBalance(currency string, balance *Balance)
- func (s *Storage) UpsertUserOrder(order *Order)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Book ¶
type Book struct { LastPrice string Spread *big.Float SpreadSessions map[string]*spread.Session `json:"spread_sessions"` BuySessions map[string]*buy.Session `json:"buy_sessions"` SpreadActiveSessionID goAtomic.String BuyActiveSessionID goAtomic.String Profit *big.Float `json:"profit"` BoughtVolume *big.Float `json:"bought_volume"` BoughtCost *big.Float `json:"bought_cost"` OrderBookEventBroker *broker.Broker // contains filtered or unexported fields }
func ResetDumpedBook ¶
func (*Book) AddBoughtCost ¶
func (*Book) AddBoughtVolume ¶
func (*Book) GetBoughtCost ¶
func (*Book) GetBoughtVolume ¶
func (*Book) GetMaxBidPrice ¶
func (*Book) GetMinAskPrice ¶
func (*Book) NewSpreadSession ¶
func (*Book) UpdateMaxBidPrice ¶
func (*Book) UpdateMinAskPrice ¶
type DumpStorage ¶
type DumpStorage struct { UserOrders map[int64]*Order `json:"user_orders"` Deals []*response.Deal `json:"deals"` OrderBooks map[string]map[string]*Book `json:"order_books"` // contains filtered or unexported fields }
func NewDumpStorage ¶
func NewDumpStorage(st *Storage) *DumpStorage
func (*DumpStorage) DumpStorage ¶
func (d *DumpStorage) DumpStorage(path string) error
func (DumpStorage) MarshalEasyJSON ¶
func (v DumpStorage) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DumpStorage) MarshalJSON ¶
func (v DumpStorage) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DumpStorage) Recover ¶
func (d *DumpStorage) Recover(path string) error
func (*DumpStorage) UnmarshalEasyJSON ¶
func (v *DumpStorage) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DumpStorage) UnmarshalJSON ¶
func (v *DumpStorage) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Order ¶
type Order struct { ID int64 TradeTimestamp string CreatedTimestamp time.Time State int Modifier int Pair string TradeIntent int OrderedVolume *big.Float LimitPrice *big.Float TotalSellVolume *big.Float TotalBuyVolume *big.Float TotalFeeQuoted *big.Float TotalFeeExt string Activated string TpActivateLevel string TrailDistance string TpSubmitLevel string TpLimitPrice string SlSubmitLevel string SlLimitPrice string StopTimestamp string TriggeredSide string }
func NewOrderByResponse ¶
func NewOrderByResponse(r *response.AccountingOrder) (*Order, error)
type Pair ¶
type Pair struct { BaseCurrency string QuoteCurrency string Price string Price24hChange string Volume24hChange string Amount24hChange string LowPrice24h string HighPrice24h string PriceScale int QuantityScale int VolumeScale int MinQuantity string MinVolume *big.Float State int }
func (*Pair) GetPairName ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func NewStorage() *Storage
func (*Storage) AppendDeals ¶
func (*Storage) CleanUpOldOrders ¶
func (*Storage) GetBalance ¶
func (*Storage) GetOrderBook ¶
func (*Storage) GetUserOrder ¶
func (*Storage) GetUserOrders ¶
func (*Storage) RegisterOrderBook ¶
func (*Storage) UpdatePairs ¶
func (*Storage) UpsertBalance ¶
func (*Storage) UpsertUserOrder ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.