draw

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultHeight = 400
View Source
const DefaultWidth = 900

Variables

This section is empty.

Functions

func MakeHorLine

func MakeHorLine(x, y float64, r, g, b uint8) *plotter.Line

Types

type AllPriceTicks

type AllPriceTicks struct{}

func (AllPriceTicks) Ticks

func (AllPriceTicks) Ticks(min, max float64) []plot.Tick

type AllTimeTicks

type AllTimeTicks struct{}

func (AllTimeTicks) Ticks

func (AllTimeTicks) Ticks(min, max float64) []plot.Tick

type KlineTOHLCV

type KlineTOHLCV struct {
	T int64
	O float64
	H float64
	L float64
	C float64
	V float64
}

type Klines

type Klines struct {
	Klines    []KlineTOHLCV
	Last      decimal.Decimal
	Min       decimal.Decimal
	Max       decimal.Decimal
	StartTime time.Time
	Scale     string
}

func (*Klines) Len

func (k *Klines) Len() int

func (*Klines) TOHLCV

func (k *Klines) TOHLCV(i int) (t, o, h, l, c, v float64)

type KlinesOpts added in v0.1.0

type KlinesOpts struct {
	Symbol string
	T      string
}

type Plot

type Plot struct {
	Plot *plot.Plot
}

func NewPlot

func NewPlot() *Plot

func (*Plot) AddEnv

func (p *Plot) AddEnv()

func (*Plot) AddFunction

func (p *Plot) AddFunction(f formula.Formula, yMax, xMax float64)

func (*Plot) AddHelpLines

func (p *Plot) AddHelpLines(lastPrice, minPrice, maxPrice float64, startTime int64)

func (*Plot) AddRateGraph

func (p *Plot) AddRateGraph(klines *Klines)

func (*Plot) SaveToBuffer

func (p *Plot) SaveToBuffer() (*bytes.Buffer, error)

Jump to

Keyboard shortcuts

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