mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
indicator: move doc
This commit is contained in:
parent
bcf77141ca
commit
a994235300
|
@ -27,22 +27,6 @@ type MACDConfig struct {
|
|||
LongPeriod int `json:"long"`
|
||||
}
|
||||
|
||||
/*
|
||||
klines := kLines(marketDataStream)
|
||||
closePrices := closePrices(klines)
|
||||
macd := MACD(klines, {Fast: 12, Slow: 10})
|
||||
|
||||
equals to:
|
||||
|
||||
klines := KLines(marketDataStream)
|
||||
closePrices := ClosePrice(klines)
|
||||
fastEMA := EMA(closePrices, 7)
|
||||
slowEMA := EMA(closePrices, 25)
|
||||
macd := Subtract(fastEMA, slowEMA)
|
||||
signal := EMA(macd, 16)
|
||||
histogram := Subtract(macd, signal)
|
||||
*/
|
||||
|
||||
//go:generate callbackgen -type MACD
|
||||
type MACD struct {
|
||||
MACDConfig
|
||||
|
|
|
@ -5,6 +5,24 @@ import (
|
|||
"github.com/c9s/bbgo/pkg/types"
|
||||
)
|
||||
|
||||
/*
|
||||
NEW INDICATOR DESIGN:
|
||||
|
||||
klines := kLines(marketDataStream)
|
||||
closePrices := closePrices(klines)
|
||||
macd := MACD(klines, {Fast: 12, Slow: 10})
|
||||
|
||||
equals to:
|
||||
|
||||
klines := KLines(marketDataStream)
|
||||
closePrices := ClosePrice(klines)
|
||||
fastEMA := EMA(closePrices, 7)
|
||||
slowEMA := EMA(closePrices, 25)
|
||||
macd := Subtract(fastEMA, slowEMA)
|
||||
signal := EMA(macd, 16)
|
||||
histogram := Subtract(macd, signal)
|
||||
*/
|
||||
|
||||
//go:generate callbackgen -type KLineStream
|
||||
type KLineStream struct {
|
||||
updateCallbacks []func(k types.KLine)
|
||||
|
|
Loading…
Reference in New Issue
Block a user