candlestick_chart

package module
v0.0.0-...-4746975 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2020 License: MIT Imports: 5 Imported by: 0

README

go-candlesticks

Provides a candlestick chart data type in Go.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuySellType

type BuySellType int
const (
	ALL BuySellType = iota
	BUY
	SELL
)

type Candle

type Candle struct {
	Count  int
	Time   time.Time
	Open   float64
	Close  float64
	High   float64
	Low    float64
	Volume float64
	Amount float64
	// contains filtered or unexported fields
}

func NewCandle

func NewCandle(cnt int, ti time.Time, value float64, volume float64, stack float64) *Candle

func (*Candle) AddCandleWithBuySell

func (candle *Candle) AddCandleWithBuySell(buysell BuySellType, value float64, volume float64, stack float64)

type CandlestickChart

type CandlestickChart struct {
	Mode             string
	Candles          []*Candle
	Resolution       string // TimeCandles: time.Duration(Nanoseconds, int64), VolumeCandles: float64, AmountCandles: float64, CountCandles: int
	TimeSeries       map[time.Time]*Candle
	LastCandle       *Candle
	CurrentCandle    *Candle
	CurrentCandleNew bool
	StartTime        time.Time
	EndTime          time.Time
	// contains filtered or unexported fields
}

func NewCandlestickChart

func NewCandlestickChart(mode string, resolution string, candleNum int) *CandlestickChart

func (*CandlestickChart) AddTrade

func (chart *CandlestickChart) AddTrade(ti time.Time, value float64, volume float64)

func (*CandlestickChart) GetLastCandleClock

func (chart *CandlestickChart) GetLastCandleClock() chan *Candle

func (*CandlestickChart) Serialized

func (chart *CandlestickChart) Serialized() []byte

Jump to

Keyboard shortcuts

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