plot

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2021 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Candle

type Candle struct {
	Time   time.Time `json:"time"`
	Open   float64   `json:"open"`
	Close  float64   `json:"close"`
	High   float64   `json:"high"`
	Low    float64   `json:"low"`
	Volume float64   `json:"volume"`
	Orders []Order   `json:"orders"`
}

type Chart

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

func NewChart

func NewChart(options ...Option) *Chart

func (*Chart) OnCandle

func (c *Chart) OnCandle(candle model.Candle)

func (*Chart) OnOrder

func (c *Chart) OnOrder(order model.Order)

func (*Chart) Start

func (c *Chart) Start() error

type Indicator added in v0.0.10

type Indicator interface {
	Name() string
	Overlay() bool
	Metrics() []Metric
	Load(dataframe *model.Dataframe)
}

func EMA added in v0.0.10

func EMA(period int, color string) Indicator

func RSI added in v0.0.10

func RSI(period int, color string) Indicator

func Stoch added in v0.0.10

func Stoch(k, d int, colork, colord string) Indicator

type Metric added in v0.0.10

type Metric struct {
	Name   string
	Color  string
	Style  string
	Values model.Series
	Time   []time.Time
}

type Option

type Option func(*Chart)

func WithIndicators added in v0.0.10

func WithIndicators(indicators ...Indicator) Option

func WithPort

func WithPort(port int) Option

type Order

type Order struct {
	ID       int64     `json:"id"`
	Time     time.Time `json:"time"`
	Price    float64   `json:"price"`
	Quantity float64   `json:"quantity"`
	Type     string    `json:"type"`
	Side     string    `json:"side"`
	Profit   float64   `json:"profit"`
}

Jump to

Keyboard shortcuts

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