sCandle

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Interval_1m  = Interval("1m")
	Interval_5m  = Interval("5m")
	Interval_15m = Interval("15m")
	Interval_30m = Interval("30m")
	Interval_1h  = Interval("1h")
	Interval_4h  = Interval("4h")
	Interval_D   = Interval("D")
	Interval_W   = Interval("W")
	Interval_M   = Interval("M")

	Interval_DEFAULT = Interval("DEFAULT")
)

Variables

This section is empty.

Functions

func GetIntervalMinutes

func GetIntervalMinutes(interval string) int64

func GetIntervalSeconds

func GetIntervalSeconds(interval string) int64

func GetIntervalSecondsMilli

func GetIntervalSecondsMilli(interval string) int64

func IsClosing

func IsClosing(ts int64, interval string) bool

IsClosing, ts is in seconds

func IsClosingMilli

func IsClosingMilli(ts int64, interval string) bool

IsClosingMilli, ts is in milliseconds

func IsSameMonth added in v0.2.8

func IsSameMonth(ts1, ts2 int64) bool

func NextTs added in v0.1.6

func NextTs(ts int64, interval string) int64

NextTs, ts is in seconds

func PrevTs added in v0.1.6

func PrevTs(ts int64, interval string) int64

PrevTs, ts is in seconds

func Verify added in v0.2.5

func Verify(candles Candles, interval int64) []error

func VerifyHighLow added in v0.2.5

func VerifyHighLow(obj *Candle) bool

func VerifyHighs added in v0.2.5

func VerifyHighs(obj *Candle) bool

func VerifyInterval

func VerifyInterval(obj_1, obj_2 *Candle, interval int64) bool

func VerifyLows added in v0.2.5

func VerifyLows(obj *Candle) bool

func VerifyOne added in v0.2.5

func VerifyOne(prevObj, obj *Candle, interval int64) error

func VerifyOpenClose

func VerifyOpenClose(obj_1, obj_2 *Candle) bool

func VerifyZeros

func VerifyZeros(obj *Candle) bool

Types

type Candle

type Candle struct {
	UnixTs int64 `bson:"ts" json:"ts"`
	OHLCV  `bson:",inline"`
}

func (Candle) LogReturn added in v0.4.2

func (c Candle) LogReturn() float64

func (Candle) String added in v0.5.5

func (c Candle) String(prec int) string

type Candles

type Candles []*Candle

func GetFixes added in v0.2.5

func GetFixes(prev *Candle, candles Candles, interval int64) Candles

GetFixes, prev is the previous candle, candles is the list of candles to be fixed, interval is the candle interval in seconds return de candles from next to prev to the last candle in candles

type Interval added in v0.2.3

type Interval string

func GetInterval added in v0.2.3

func GetInterval(interval string) Interval

func GetIntervals added in v0.6.0

func GetIntervals(intervals ...string) (res []Interval)

func (Interval) IsClosing added in v0.3.2

func (i Interval) IsClosing(ts int64) bool

func (Interval) IsClosingMilli added in v0.3.2

func (i Interval) IsClosingMilli(ts int64) bool

func (Interval) IsDefault added in v0.2.4

func (i Interval) IsDefault() bool

func (Interval) Minutes added in v0.3.2

func (i Interval) Minutes() int64

func (Interval) Next added in v0.3.2

func (i Interval) Next(ts int64) int64

func (Interval) Prev added in v0.3.2

func (i Interval) Prev(ts int64) int64

func (Interval) Seconds added in v0.3.2

func (i Interval) Seconds() int64

func (Interval) SecondsMilli added in v0.3.2

func (i Interval) SecondsMilli() int64

func (Interval) String added in v0.2.4

func (i Interval) String() string

type OHLC

type OHLC struct {
	Open  float64 `bson:"o" json:"o"`
	High  float64 `bson:"h" json:"h"`
	Low   float64 `bson:"l" json:"l"`
	Close float64 `bson:"c" json:"c"`
}

func (OHLC) String added in v0.5.5

func (o OHLC) String(prec int) string

type OHLCV added in v0.0.8

type OHLCV struct {
	OHLC   `bson:",inline"`
	Volume float64 `bson:"v" json:"v"`
}

func (OHLCV) String added in v0.5.5

func (o OHLCV) String(prec int) string

type OHLCVs added in v0.0.8

type OHLCVs []*OHLCV

type OHLCs added in v0.0.8

type OHLCs []*OHLC

Jump to

Keyboard shortcuts

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