Documentation ¶
Index ¶
- func SleepUntil(next int, dur time.Duration) time.Time
- type BiapiSpec
- type BiapiSvc
- func (s *BiapiSvc) BuyMarketMT(coin, market, quantity string) (*b.CreateOrderResponse, error)
- func (s *BiapiSvc) CancelOrder(symbol string, orderID int64) (*b.CancelOrderResponse, error)
- func (s *BiapiSvc) GetAccount() (*b.Account, error)
- func (s *BiapiSvc) GetBalance(asset string) (string, error)
- func (s *BiapiSvc) ListOpenOrders(symbol string) ([]*b.Order, error)
- func (s *BiapiSvc) ListPrices(symbol string) ([]*b.SymbolPrice, error)
- func (s *BiapiSvc) SellCoinMT(coin, market, quantity string) (*b.CreateOrderResponse, error)
- type BotSvc
- type CredSpec
- type EmailSpec
- type EmailSvc
- type EndSpec
- type EndSvc
- type Signal
- type Spec
- type SpecSvc
- type SpotSpec
- type SpotSvc
- type StratSpec
- type StratSvc
- type TaapiSpec
- type TaapiSvc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SleepUntil ¶
SleepUntil until the next timestamp rounded up to the next period (minutes). https://gist.github.com/msadakov/cdbbd979140ef7341fcfac970fc8a95b
Types ¶
type BiapiSvc ¶
func NewBiapiSvc ¶
func (*BiapiSvc) BuyMarketMT ¶
func (s *BiapiSvc) BuyMarketMT(coin, market, quantity string) (*b.CreateOrderResponse, error)
func (*BiapiSvc) CancelOrder ¶
func (*BiapiSvc) ListOpenOrders ¶
func (*BiapiSvc) ListPrices ¶
func (s *BiapiSvc) ListPrices(symbol string) ([]*b.SymbolPrice, error)
func (*BiapiSvc) SellCoinMT ¶
func (s *BiapiSvc) SellCoinMT(coin, market, quantity string) (*b.CreateOrderResponse, error)
type BotSvc ¶
type CredSpec ¶
type CredSpec struct { BiapiAk string `validate:"required" yaml:"biapi_ak"` BiapiSk string `validate:"required" yaml:"biapi_sk"` TaapiSk string `validate:"required" yaml:"taapi_sk"` EmUser string `validate:"required" yaml:"em_user"` EmPass string `validate:"required" yaml:"em_pass"` NotEm string `validate:"required" yaml:"noti_em"` }
type EmailSpec ¶
type EmailSpec struct { Server string `validate:"required" yaml:"server"` Port int `validate:"required" yaml:"port"` Name string `validate:"required" yaml:"name"` ConnTimeoutSec int `validate:"required" yaml:"conn_timeout_sec"` SendTimeoutSec int `validate:"required" yaml:"send_timeout_sec"` InsecureSkipVerify bool `validate:"required" yaml:"insecure_skip_verify"` }
type EmailSvc ¶
type EmailSvc struct { EmailSpec *EmailSpec Client *sm.SMTPServer Username string Pass string }
func NewEmailSvc ¶
type EndSvc ¶
func (*EndSvc) EndByDummyOrder ¶
type Signal ¶
type Signal string
const ( SignalNone Signal = "NONE" SignalError Signal = "ERROR " SignalBuy Signal = "BUY" SignalSell Signal = "SELL" SignalHodl Signal = "HODL" SignalLong Signal = "LONG" SignalShort Signal = "SHORT" SignalHasTrend Signal = "HAS_TREND" SignalNoTrend Signal = "NO_TREND" SignalUptrend Signal = "UPTREND" SignalDowntrend Signal = "DOWNTREND" )
type Spec ¶
type Spec struct { Name string `validate:"required" yaml:"name"` Delayed bool `yaml:"delayed"` DryRun bool `yaml:"dry_run"` EmailSpec *EmailSpec `validate:"required" yaml:"email"` BiapiSpec *BiapiSpec `validate:"required" yaml:"biapi"` TaapiSpec *TaapiSpec `validate:"required" yaml:"taapi"` StratSpec *StratSpec `validate:"required" yaml:"strategy"` SpotSpec *SpotSpec `validate:"required" yaml:"spot"` EndSpec *EndSpec `validate:"required" yaml:"end"` CredSpec *CredSpec `validate:"required" yaml:"cred"` }
type SpotSpec ¶
type SpotSpec struct { Coin string `validate:"required" yaml:"coin"` Market string `validate:"required" yaml:"market"` PeriodMin int `validate:"required" yaml:"period_min"` CoinPrecision string `validate:"required" yaml:"coin_precision"` MarketPrecision string `validate:"required" yaml:"market_precision"` }
type StratSvc ¶
func NewStratSvc ¶
Click to show internal directories.
Click to hide internal directories.