lib

package
v0.0.0-...-852338e Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger *logging.Logger

Logger -

Functions

This section is empty.

Types

type AssetsProvider

type AssetsProvider struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

AssetsProvider -

type Calculation

type Calculation struct {
	Strategy *Strategy
	Candles  *rates.SendPoints
	Result   *CalculationResult
}

Calculation -

func (*Calculation) GetAsset

func (cc *Calculation) GetAsset() database.Assets

GetAsset -

func (*Calculation) GetAssetID

func (cc *Calculation) GetAssetID() string

GetAssetID -

func (*Calculation) GetCurrent

func (cc *Calculation) GetCurrent(candle int) (op rates.Points)

GetCurrent -

func (*Calculation) GetIndicator

func (cc *Calculation) GetIndicator(id string) core.IIndicator

GetIndicator -

func (*Calculation) GetLogger

func (cc *Calculation) GetLogger() *logging.Logger

GetLogger -

func (*Calculation) GetPoints

func (cc *Calculation) GetPoints(opt rates.CandleRequest) (map[int][]rates.Points, error)

GetPoints -

func (*Calculation) GetSendTime

func (cc *Calculation) GetSendTime() time.Time

GetSendTime -

func (*Calculation) GetServerTime

func (cc *Calculation) GetServerTime() time.Time

GetServerTime -

func (*Calculation) GetValue

func (cc *Calculation) GetValue(tp, candle int) (op []float64)

GetValue -

func (*Calculation) GetValues

func (cc *Calculation) GetValues(lg, candle int) (op []rates.Points)

GetValues -

func (*Calculation) New

func (cc *Calculation) New()

New -

type CalculationResult

type CalculationResult struct {
	Data map[string]map[string]indicator.Result
	sync.RWMutex
}

CalculationResult -

type Database

type Database struct {
	Logger *logging.Logger
	DB     *nutsdb.DB
	Stores Stores
}

Database -

func (*Database) Del

func (cc *Database) Del(bucket, key string) (err error)

Del -

func (*Database) Get

func (cc *Database) Get(bucket, key string, autocreateBucket bool) (value []byte, err error)

Get -

func (*Database) GetAll

func (cc *Database) GetAll(bucket string) (res interface{})

GetAll -

func (*Database) Init

func (cc *Database) Init() (err error)

Init -

func (*Database) Set

func (cc *Database) Set(bucket, key string, value []byte, autocreateBucket bool) (err error)

Set -

type Stores

type Stores struct {
	Strategy sync.Map
}

Stores -

type Strategy

type Strategy struct {
	AssetsProvider *AssetsProvider

	SubChannel *SubChannel
	Data       core.StrategyOption
	// contains filtered or unexported fields
}

Strategy -

func (*Strategy) GetCallback

func (cc *Strategy) GetCallback() (data interface{})

GetCallback -

func (*Strategy) Run

func (cc *Strategy) Run(hc func() *core.HTTPClient, wsc func() *interfaces.WebsocketClient) bool

Run -

func (*Strategy) SetCallback

func (cc *Strategy) SetCallback(data interface{})

SetCallback -

type SubChannel

type SubChannel struct {
	sync.Mutex
	// contains filtered or unexported fields
}

SubChannel -

func (*SubChannel) Close

func (cc *SubChannel) Close(callback func())

Close -

Jump to

Keyboard shortcuts

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