Documentation
¶
Index ¶
- type Config
- type Executor
- type TurtleExecutor
- func (t *TurtleExecutor) AmountPrecision() int32
- func (t *TurtleExecutor) Balance() (cash, currency, fee decimal.Decimal)
- func (t *TurtleExecutor) BaseCurrency() string
- func (t *TurtleExecutor) Buy(price, amount decimal.Decimal, clientId string) (hs.Order, error)
- func (t *TurtleExecutor) FeeCurrency() string
- func (t *TurtleExecutor) FeePrice() (decimal.Decimal, error)
- func (t *TurtleExecutor) MinAmount() decimal.Decimal
- func (t *TurtleExecutor) MinTotal() decimal.Decimal
- func (t *TurtleExecutor) PlaceOrder(signal *types.Signal, clientId string) (hs.Order, error)
- func (t *TurtleExecutor) Price() (decimal.Decimal, error)
- func (t *TurtleExecutor) PricePrecision() int32
- func (t *TurtleExecutor) QuoteCurrency() string
- func (t *TurtleExecutor) Sell(price, amount decimal.Decimal, clientId string) (hs.Order, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor interface { QuoteCurrency() string // BTC/USDT -> USDT BaseCurrency() string // BTC/USDT -> BTC FeeCurrency() string Balance() (cash, currency, fee decimal.Decimal) Price() (decimal.Decimal, error) FeePrice() (decimal.Decimal, error) MinAmount() decimal.Decimal MinTotal() decimal.Decimal PricePrecision() int32 AmountPrecision() int32 Buy(price, amount decimal.Decimal, clientId string) (hs.Order, error) Sell(price, amount decimal.Decimal, clientId string) (hs.Order, error) PlaceOrder(signal *types.Signal, clientId string) (hs.Order, error) }
A exchange agent for turtle use. It saves some useful variables, eg. the only symbol, base-currency, quote-currency, precisions.
type TurtleExecutor ¶
type TurtleExecutor struct {
// contains filtered or unexported fields
}
for test
func NewTurtleExecutor ¶
func NewTurtleExecutor(config Config, ex exchange.Exchange) *TurtleExecutor
func (*TurtleExecutor) AmountPrecision ¶
func (t *TurtleExecutor) AmountPrecision() int32
func (*TurtleExecutor) Balance ¶
func (t *TurtleExecutor) Balance() (cash, currency, fee decimal.Decimal)
func (*TurtleExecutor) BaseCurrency ¶
func (t *TurtleExecutor) BaseCurrency() string
BTC/USDT -> BTC
func (*TurtleExecutor) FeeCurrency ¶
func (t *TurtleExecutor) FeeCurrency() string
func (*TurtleExecutor) MinAmount ¶
func (t *TurtleExecutor) MinAmount() decimal.Decimal
func (*TurtleExecutor) MinTotal ¶
func (t *TurtleExecutor) MinTotal() decimal.Decimal
func (*TurtleExecutor) PlaceOrder ¶
func (*TurtleExecutor) Price ¶
func (t *TurtleExecutor) Price() (decimal.Decimal, error)
price of the base currency
func (*TurtleExecutor) PricePrecision ¶
func (t *TurtleExecutor) PricePrecision() int32
func (*TurtleExecutor) QuoteCurrency ¶
func (t *TurtleExecutor) QuoteCurrency() string
BTC/USDT -> USDT
Click to show internal directories.
Click to hide internal directories.