plot

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 17 Imported by: 0

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 []model.Order `json:"orders"`
}

type Chart

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

func NewChart

func NewChart(options ...Option) (*Chart, error)

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

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

type IndicatorMetric

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

type Option

type Option func(*Chart)

func WithCustomIndicators

func WithCustomIndicators(indicators ...Indicator) Option

func WithDebug

func WithDebug() Option

WithDebug starts chart without compress

func WithPaperWallet

func WithPaperWallet(paperWallet *exchange.PaperWallet) Option

func WithPort

func WithPort(port int) Option

func WithStrategyIndicators

func WithStrategyIndicators(strategy strategy.Strategy) Option

type Shape

type Shape struct {
	StartX time.Time `json:"x0"`
	EndX   time.Time `json:"x1"`
	StartY float64   `json:"y0"`
	EndY   float64   `json:"y1"`
	Color  string    `json:"color"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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