candle

package
v1.0.24 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrNoCandleDataFound returns when no candle data is found
	ErrNoCandleDataFound = errors.New("no candle data found")
)

Functions

func DeleteCandles

func DeleteCandles(in *Item) (int64, error)

DeleteCandles will delete all existing matching candles

func Insert

func Insert(in *Item) (uint64, error)

Insert series of candles

func InsertFromCSV

func InsertFromCSV(exchangeName, base, quote string, interval int64, asset, file string) (uint64, error)

InsertFromCSV load a CSV list of candle data and insert into database

Types

type Candle

type Candle struct {
	Timestamp        time.Time
	Open             float64
	High             float64
	Low              float64
	Close            float64
	Volume           float64
	SourceJobID      string
	ValidationJobID  string
	ValidationIssues string
}

Candle holds each interval

type Item

type Item struct {
	ID         string
	ExchangeID string
	Base       string
	Quote      string
	Interval   int64
	Asset      string
	Candles    []Candle
}

Item generic candle holder for modelPSQL & modelSQLite

func Series

func Series(exchangeName, base, quote string, interval int64, asset string, start, end time.Time) (out Item, err error)

Series returns candle data

Jump to

Keyboard shortcuts

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