Documentation ¶
Index ¶
- Variables
- func PriceByType(open, high, low, close float64, pt PriceType) float64
- type Candlestick
- type List
- func (l *List) Delete(t ...time.Time)
- func (l List) ExchangeName() string
- func (l List) Extract(start, end time.Time, limit uint) *List
- func (l List) First() (TimedCandlestick, bool)
- func (l List) FirstN(limit uint) *List
- func (l List) Get(t time.Time) (Candlestick, bool)
- func (l *List) HasUncomplete() bool
- func (l List) ID() ListID
- func (l List) Last() (TimedCandlestick, bool)
- func (l List) Len() int
- func (l List) LoadFromProtoBuf(cs []*proto.Candlestick) error
- func (l *List) Loop(callback func(t time.Time, cs Candlestick) (bool, error)) error
- func (l *List) Merge(l2 List, options *timeserie.MergeOptions) error
- func (l *List) MergeTimeSeries(ts timeserie.TimeSerie, options *timeserie.MergeOptions) error
- func (l List) PairSymbol() string
- func (l List) Period() period.Symbol
- func (l *List) ReplaceUncomplete(l2 List) error
- func (l *List) Set(t time.Time, c Candlestick) error
- func (l List) String() string
- type ListID
- type PriceType
- type TimedCandlestick
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 FromProtoBuf ¶
func FromProtoBuf(pbc *proto.Candlestick) (time.Time, Candlestick, error)
func (Candlestick) Equal ¶
func (cs Candlestick) Equal(b Candlestick) bool
func (Candlestick) PriceByType ¶
func (cs Candlestick) PriceByType(pt PriceType) float64
func (Candlestick) ToProfoBuff ¶
func (cs Candlestick) ToProfoBuff(t time.Time) *proto.Candlestick
type List ¶
type List struct {
// contains filtered or unexported fields
}
func NewEmptyList ¶
func (List) ExchangeName ¶
func (List) First ¶
func (l List) First() (TimedCandlestick, bool)
func (*List) HasUncomplete ¶
func (List) Last ¶
func (l List) Last() (TimedCandlestick, bool)
func (List) LoadFromProtoBuf ¶
func (l List) LoadFromProtoBuf(cs []*proto.Candlestick) error
func (*List) MergeTimeSeries ¶
func (List) PairSymbol ¶
func (*List) ReplaceUncomplete ¶
type TimedCandlestick ¶
type TimedCandlestick struct { Time time.Time Candlestick }
func MergeListIntoOneCandlestick ¶
func MergeListIntoOneCandlestick(csl *List, per period.Symbol) TimedCandlestick
Click to show internal directories.
Click to hide internal directories.