kline

package
v0.0.0-...-1ca2487 Latest Latest
Warning

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

Go to latest
Published: May 29, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OneMin     = time.Minute
	ThreeMin   = 3 * time.Minute
	FiveMin    = 5 * time.Minute
	FifteenMin = 15 * time.Minute
	ThirtyMin  = 30 * time.Minute
	OneHour    = 1 * time.Hour
	TwoHour    = 2 * time.Hour
	FourHour   = 4 * time.Hour
	SixHour    = 6 * time.Hour
	TwelveHour = 12 * time.Hour
	OneDay     = 24 * time.Hour
	ThreeDay   = 72 * time.Hour
	OneWeek    = 168 * time.Hour
)

Consts here define basic time intervals

Variables

This section is empty.

Functions

This section is empty.

Types

type Candle

type Candle struct {
	Time   time.Time
	Open   float64
	High   float64
	Low    float64
	Close  float64
	Volume float64
}

Candle holds historic rate information.

type Item

type Item struct {
	Exchange string
	Pair     currency.Pair
	Asset    asset.Item
	Interval time.Duration
	Candles  []Candle
}

Item holds all the relevant information for internal kline elements

func CreateKline

func CreateKline(trades []order.TradeHistory, interval time.Duration, p currency.Pair, a asset.Item, exchange string) (Item, error)

CreateKline creates candles out of trade history data for a set time interval

Jump to

Keyboard shortcuts

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