plot

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: MIT Imports: 8 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 []Order   `json:"orders"`
}

type Chart

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

func NewChart

func NewChart(options ...Option) *Chart

func (*Chart) CandlesByPair

func (c *Chart) CandlesByPair(pair string) []Candle

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 Option

type Option func(*Chart)

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