mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
indicator: add VOLUME api
This commit is contained in:
parent
b29c1aa972
commit
064932ea9d
|
@ -69,6 +69,10 @@ func (i *IndicatorSet) CLOSE(interval types.Interval) *indicator.PriceStream {
|
|||
return closePrices
|
||||
}
|
||||
|
||||
func (i *IndicatorSet) VOLUME(interval types.Interval) *indicator.PriceStream {
|
||||
return indicator.Volumes(i.KLines(interval))
|
||||
}
|
||||
|
||||
func (i *IndicatorSet) RSI(iw types.IntervalWindow) *indicator.RSIStream {
|
||||
return indicator.RSI2(i.CLOSE(iw.Interval), iw.Window)
|
||||
}
|
||||
|
|
|
@ -51,3 +51,7 @@ func HighPrices(source KLineSubscription) *PriceStream {
|
|||
func OpenPrices(source KLineSubscription) *PriceStream {
|
||||
return Price(source, KLineOpenPriceMapper)
|
||||
}
|
||||
|
||||
func Volumes(source KLineSubscription) *PriceStream {
|
||||
return Price(source, KLineVolumeMapper)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user