triple

package
v0.0.0-...-fb47a75 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Exchange hs.ExchangeConf
	Mongo    hs.MongoConf
	Strategy StrategyConf
	Log      hs.LogConf
	Robots   []hs.BroadcastConf
}

type StrategyConf

type StrategyConf struct {
	Timeframe Timeframe
}

type Timeframe

type Timeframe struct {
	Long   string
	Middle string
	Short  string
}

type Trader

type Trader struct {
	Sugar *zap.SugaredLogger
	// contains filtered or unexported fields
}

func NewTrader

func NewTrader(config Config) (*Trader, error)

func (*Trader) Clear

func (t *Trader) Clear(ctx context.Context) error

cancel all orders, clear state in database

func (*Trader) Close

func (t *Trader) Close(ctx context.Context) error

release all resource

func (*Trader) Init

func (t *Trader) Init(ctx context.Context) error

func (*Trader) Print

func (t *Trader) Print(ctx context.Context) error

print state

func (*Trader) Start

func (t *Trader) Start(ctx context.Context) error

Start serve until ctx.Done

func (*Trader) Stop

func (t *Trader) Stop(ctx context.Context) error

stop the running service if it's not

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL