state

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: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TrendUp      int = 1
	TrendDown        = -1
	TrendNeutral     = 0

	SignalWait  = 0
	SignalLong  = 1
	SignalSell  = -1
	SignalShort = -2
	SignalCover = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {

	// intermediate signal/command
	Signal int // 1: long, -1: short, 0: no signal
	// contains filtered or unexported fields
}

func (*State) Clear

func (s *State) Clear(ctx context.Context) error

func (State) Format

func (s State) Format(color bool) string

func (*State) Init

func (s *State) Init(db *mongo.Database)

func (*State) Load

func (s *State) Load(ctx context.Context) error

func (*State) Tide

func (s *State) Tide() int

func (*State) UpdateSignal

func (s *State) UpdateSignal(ctx context.Context, newSignal int) error

func (*State) UpdateTide

func (s *State) UpdateTide(ctx context.Context, newState int) error

func (*State) UpdateWave

func (s *State) UpdateWave(ctx context.Context, newWave int) error

func (*State) Wave

func (s *State) Wave() int

Jump to

Keyboard shortcuts

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