mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
xfunding: move moving average config out
This commit is contained in:
parent
c6cedde8c9
commit
c176e2df5f
|
@ -34,6 +34,23 @@ const (
|
|||
PositionClosing
|
||||
)
|
||||
|
||||
type MovingAverageConfig struct {
|
||||
Interval types.Interval `json:"interval"`
|
||||
// MovingAverageType is the moving average indicator type that we want to use,
|
||||
// it could be SMA or EWMA
|
||||
MovingAverageType string `json:"movingAverageType"`
|
||||
|
||||
// MovingAverageInterval is the interval of k-lines for the moving average indicator to calculate,
|
||||
// it could be "1m", "5m", "1h" and so on. note that, the moving averages are calculated from
|
||||
// the k-line data we subscribed
|
||||
// MovingAverageInterval types.Interval `json:"movingAverageInterval"`
|
||||
//
|
||||
// // MovingAverageWindow is the number of the window size of the moving average indicator.
|
||||
// // The number of k-lines in the window. generally used window sizes are 7, 25 and 99 in the TradingView.
|
||||
// MovingAverageWindow int `json:"movingAverageWindow"`
|
||||
MovingAverageIntervalWindow types.IntervalWindow `json:"movingAverageIntervalWindow"`
|
||||
}
|
||||
|
||||
var log = logrus.WithField("strategy", ID)
|
||||
|
||||
func init() {
|
||||
|
@ -89,28 +106,6 @@ type Strategy struct {
|
|||
Low fixedpoint.Value `json:"low"`
|
||||
} `json:"shortFundingRate"`
|
||||
|
||||
SupportDetection []struct {
|
||||
Interval types.Interval `json:"interval"`
|
||||
// MovingAverageType is the moving average indicator type that we want to use,
|
||||
// it could be SMA or EWMA
|
||||
MovingAverageType string `json:"movingAverageType"`
|
||||
|
||||
// MovingAverageInterval is the interval of k-lines for the moving average indicator to calculate,
|
||||
// it could be "1m", "5m", "1h" and so on. note that, the moving averages are calculated from
|
||||
// the k-line data we subscribed
|
||||
// MovingAverageInterval types.Interval `json:"movingAverageInterval"`
|
||||
//
|
||||
// // MovingAverageWindow is the number of the window size of the moving average indicator.
|
||||
// // The number of k-lines in the window. generally used window sizes are 7, 25 and 99 in the TradingView.
|
||||
// MovingAverageWindow int `json:"movingAverageWindow"`
|
||||
|
||||
MovingAverageIntervalWindow types.IntervalWindow `json:"movingAverageIntervalWindow"`
|
||||
|
||||
MinVolume fixedpoint.Value `json:"minVolume"`
|
||||
|
||||
MinQuoteVolume fixedpoint.Value `json:"minQuoteVolume"`
|
||||
} `json:"supportDetection"`
|
||||
|
||||
SpotSession string `json:"spotSession"`
|
||||
FuturesSession string `json:"futuresSession"`
|
||||
Reset bool `json:"reset"`
|
||||
|
|
Loading…
Reference in New Issue
Block a user