plot

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 12 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, 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 added in v0.0.10

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

type IndicatorMetric added in v0.0.11

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

type Option

type Option func(*Chart)

func WithDebug added in v0.0.12

func WithDebug() Option

WithDebug starts chart without compress

func WithIndicators added in v0.0.10

func WithIndicators(indicators ...Indicator) Option

func WithPaperWallet added in v0.0.14

func WithPaperWallet(paperWallet *exchange.PaperWallet) Option

func WithPort

func WithPort(port int) Option

type Order

type Order struct {
	ID        int64     `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Status    string    `json:"status"`
	Price     float64   `json:"price"`
	Quantity  float64   `json:"quantity"`
	Type      string    `json:"type"`
	Side      string    `json:"side"`
	Profit    float64   `json:"profit"`

	// Only for OCO Orders
	Stop     *float64 `json:"stop"`
	OCOGroup *int64   `json:"oco_group"`
	RefPrice float64  `json:"ref_price"`
}

type Shape added in v0.0.12

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