Documentation
¶
Index ¶
- Variables
- func PriceByType(open, high, low, close float64, pt PriceType) float64
- type Candlestick
- type List
- func (l List) Extract(start, end time.Time, limit uint) *List
- func (l *List) FillMissing(start, end time.Time, filling Candlestick) error
- func (cl List) GetMissingRange(start, end time.Time, limit uint) []timeserie.TimeRange
- func (cl List) GetMissingTimes(start, end time.Time, limit uint) []time.Time
- func (cl List) GetUncompleteRange() []timeserie.TimeRange
- func (cl List) GetUncompleteTimes() []time.Time
- func (l *List) Merge(l2 *List, options *timeserie.MergeOptions) error
- func (l *List) MustSet(t time.Time, c Candlestick) *List
- func (l *List) ReplaceUncomplete(l2 *List)
- func (l *List) Set(t time.Time, c Candlestick) error
- func (l List) String() string
- type PriceType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPeriodMismatch = errors.New("period-mismatch") ErrCandlestickType = errors.New("struct-not-candlestick") ErrExchangeMismatch = errors.New("exchange-mismatch") ErrPairMismatch = errors.New("pair-mismatch") )
View Source
var (
ErrInvalidPriceType = errors.New("invalid-price-type")
)
View Source
var PriceTypes = []PriceType{ PriceTypeIsOpen, PriceTypeIsHigh, PriceTypeIsLow, PriceTypeIsClose, }
Functions ¶
func PriceByType ¶
Types ¶
type Candlestick ¶
type Candlestick struct { Open float64 `bson:"open" json:"open,omitempty"` High float64 `bson:"high" json:"high,omitempty"` Low float64 `bson:"low" json:"low,omitempty"` Close float64 `bson:"close" json:"close,omitempty"` Volume float64 `bson:"volume" json:"volume,omitempty"` Uncomplete bool `bson:"complete" json:"uncomplete,omitempty"` }
func (Candlestick) Equal ¶
func (cs Candlestick) Equal(b Candlestick) bool
func (Candlestick) PriceByType ¶
func (cs Candlestick) PriceByType(pt PriceType) float64
func (Candlestick) String ¶
func (cs Candlestick) String() string
type List ¶
type List struct { Exchange string Pair string Period period.Symbol timeserie.TimeSerie[Candlestick] }
func NewListFrom ¶
func (*List) FillMissing ¶
func (l *List) FillMissing(start, end time.Time, filling Candlestick) error
FillMissing will add the 'filling' candlestick at each interval between 'start' included and 'end' included when there is a missing candlestick at the tested interval.
func (List) GetMissingRange ¶
func (List) GetMissingTimes ¶
GetMissingTimes returns an array of missing time in the candlestick list
func (List) GetUncompleteRange ¶
func (List) GetUncompleteTimes ¶
GetUncompleteTimes returns an array of time from candlesticks that are marked as uncomplete (i.e. data pulled when candlestick covering time was not complete)
func (*List) ReplaceUncomplete ¶
Click to show internal directories.
Click to hide internal directories.