Versions in this module Expand all Collapse all v0 v0.0.1 May 4, 2024 Changes in this version + const CoolTradePeriod + const MaximumTradeStoreSize + const TradeExpiryTime + type OrderStore struct + AddOrderUpdate bool + C chan types.Order + RemoveCancelled bool + RemoveFilled bool + Symbol string + func NewOrderStore(symbol string) *OrderStore + func (s *OrderStore) Add(orders ...types.Order) + func (s *OrderStore) AllFilled() bool + func (s *OrderStore) BindStream(stream types.Stream) + func (s *OrderStore) Exists(oID uint64) (ok bool) + func (s *OrderStore) Get(oID uint64) (order types.Order, ok bool) + func (s *OrderStore) HandleOrderUpdate(order types.Order) + func (s *OrderStore) NumOfOrders() (num int) + func (s *OrderStore) Orders() (orders []types.Order) + func (s *OrderStore) Remove(o types.Order) + func (s *OrderStore) Update(o types.Order) bool + type TradeCollector struct + Symbol string + func NewTradeCollector(symbol string, position *types.Position, orderStore *OrderStore) *TradeCollector + func (c *TradeCollector) BindStream(stream types.Stream) + func (c *TradeCollector) BindStreamForBackground(stream types.Stream) + func (c *TradeCollector) Emit() + func (c *TradeCollector) EmitPositionUpdate(position *types.Position) + func (c *TradeCollector) EmitProfit(trade types.Trade, profit *types.Profit) + func (c *TradeCollector) EmitRecover(trade types.Trade) + func (c *TradeCollector) EmitTrade(trade types.Trade, profit fixedpoint.Value, netProfit fixedpoint.Value) + func (c *TradeCollector) OnPositionUpdate(cb func(position *types.Position)) + func (c *TradeCollector) OnProfit(cb func(trade types.Trade, profit *types.Profit)) + func (c *TradeCollector) OnRecover(cb func(trade types.Trade)) + func (c *TradeCollector) OnTrade(...) + func (c *TradeCollector) OrderStore() *OrderStore + func (c *TradeCollector) Position() *types.Position + func (c *TradeCollector) Process() bool + func (c *TradeCollector) ProcessTrade(trade types.Trade) bool + func (c *TradeCollector) QueueTrade(trade types.Trade) + func (c *TradeCollector) Recover(ctx context.Context, ex types.ExchangeTradeHistoryService, symbol string, ...) error + func (c *TradeCollector) RecoverTrade(td types.Trade) bool + func (c *TradeCollector) Run(ctx context.Context) + func (c *TradeCollector) SetPosition(position *types.Position) + func (c *TradeCollector) TradeStore() *TradeStore + type TradeFilter func(trade types.Trade) bool + type TradeStore struct + EnablePrune bool + func NewTradeStore() *TradeStore + func (s *TradeStore) Add(trades ...types.Trade) + func (s *TradeStore) BindStream(stream types.Stream) + func (s *TradeStore) Clear() + func (s *TradeStore) Exists(oID uint64) (ok bool) + func (s *TradeStore) Filter(filter TradeFilter) + func (s *TradeStore) GetAndClear() (trades []types.Trade) + func (s *TradeStore) GetOrderTrades(o types.Order) (trades []types.Trade) + func (s *TradeStore) Num() (num int) + func (s *TradeStore) Prune(curTime time.Time) + func (s *TradeStore) Trades() (trades []types.Trade)