Documentation ¶
Index ¶
- type MockExchange
- func (m *MockExchange) AmendOrder(id string, price, amount float64) (ex.Order, error)
- func (m *MockExchange) CancelOrder(id string) error
- func (m *MockExchange) Init() error
- func (m *MockExchange) LimitBuy(price, amount float64) ex.Order
- func (m *MockExchange) LimitSell(price, amount float64) ex.Order
- func (m *MockExchange) MarketBuy(amount float64) ex.Order
- func (m *MockExchange) MarketSell(amount float64) ex.Order
- func (m *MockExchange) OpenOrders() []ex.Order
- func (m *MockExchange) QuoteUpdate(askPrice, bidPrice float64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockExchange ¶
type MockExchange struct { Symbol string //交易对 OrderDic map[string]ex.Order //订单薄 Record bool //是否用日志记录交易记录 Hold float64 // 持仓 CostPrice float64 //持仓成本 Profit float64 //盈利 TradeAmount float64 //累计交易额 TotalFee float64 //累计手续费 MarkerFeeRate float64 //挂单费率 TakerFeeRate float64 //吃单费率 AskPrice float64 //卖一价格 BidPrice float64 //买一价格 }
MockExchange 模拟交易所对象.
func (*MockExchange) AmendOrder ¶
AmendOrder 修改订单.
func (*MockExchange) CancelOrder ¶
func (m *MockExchange) CancelOrder(id string) error
CancelOrder 取消订单id.
func (*MockExchange) LimitBuy ¶
func (m *MockExchange) LimitBuy(price, amount float64) ex.Order
LimitBuy 限价单买.
func (*MockExchange) LimitSell ¶
func (m *MockExchange) LimitSell(price, amount float64) ex.Order
LimitSell 限价单卖.
func (*MockExchange) MarketBuy ¶
func (m *MockExchange) MarketBuy(amount float64) ex.Order
MarketBuy 市价买.
func (*MockExchange) MarketSell ¶
func (m *MockExchange) MarketSell(amount float64) ex.Order
MarketSell 市价卖.
func (*MockExchange) QuoteUpdate ¶
func (m *MockExchange) QuoteUpdate(askPrice, bidPrice float64) error
QuoteUpdate 行情更新.
Click to show internal directories.
Click to hide internal directories.