Documentation ¶
Index ¶
- func CalculateKLinesEMA(allKLines []types.KLine, priceF KLinePriceMapper, window int) float64
- func KLineClosePriceMapper(k types.KLine) float64
- func KLineOpenPriceMapper(k types.KLine) float64
- func MapKLinePrice(kLines []types.KLine, f KLinePriceMapper) (prices []float64)
- type BOLL
- func (inc *BOLL) Bind(updater KLineWindowUpdater)
- func (inc *BOLL) EmitUpdate(sma float64, upBand float64, downBand float64)
- func (inc *BOLL) LastDownBand() float64
- func (inc *BOLL) LastSMA() float64
- func (inc *BOLL) LastStdDev() float64
- func (inc *BOLL) LastUpBand() float64
- func (inc *BOLL) OnUpdate(cb func(sma float64, upBand float64, downBand float64))
- type EWMA
- type Float64Slice
- type KLinePriceMapper
- type KLineWindowUpdater
- type SMA
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateKLinesEMA ¶ added in v1.3.1
func CalculateKLinesEMA(allKLines []types.KLine, priceF KLinePriceMapper, window int) float64
func KLineClosePriceMapper ¶ added in v1.2.1
func KLineOpenPriceMapper ¶ added in v1.2.1
func MapKLinePrice ¶ added in v1.2.1
func MapKLinePrice(kLines []types.KLine, f KLinePriceMapper) (prices []float64)
Types ¶
type BOLL ¶
type BOLL struct { types.IntervalWindow // times of Std, generally it's 2 K float64 SMA Float64Slice StdDev Float64Slice UpBand Float64Slice DownBand Float64Slice EndTime time.Time // contains filtered or unexported fields }
func (*BOLL) Bind ¶
func (inc *BOLL) Bind(updater KLineWindowUpdater)
func (*BOLL) EmitUpdate ¶
func (*BOLL) LastDownBand ¶
func (*BOLL) LastStdDev ¶
func (*BOLL) LastUpBand ¶
type EWMA ¶
type EWMA struct { types.IntervalWindow Values Float64Slice LastOpenTime time.Time UpdateCallbacks []func(value float64) }
func (*EWMA) Bind ¶
func (inc *EWMA) Bind(updater KLineWindowUpdater)
func (*EWMA) EmitUpdate ¶ added in v1.2.1
type Float64Slice ¶
type Float64Slice []float64
func (*Float64Slice) Push ¶
func (s *Float64Slice) Push(v float64)
type KLinePriceMapper ¶ added in v1.2.1
type KLineWindowUpdater ¶
type KLineWindowUpdater interface {
OnKLineWindowUpdate(func(interval types.Interval, window types.KLineWindow))
}
type SMA ¶
type SMA struct { types.IntervalWindow Values Float64Slice EndTime time.Time UpdateCallbacks []func(value float64) }
func (*SMA) Bind ¶
func (inc *SMA) Bind(updater KLineWindowUpdater)
func (*SMA) EmitUpdate ¶ added in v1.2.1
Click to show internal directories.
Click to hide internal directories.