Kaynağa Gözat

Strategy

- add `Interval() uint8`
Alexey Kim 1 ay önce
ebeveyn
işleme
095c43bd5f

+ 1 - 0
strategy.go

@@ -8,6 +8,7 @@ type Strategy interface {
 	Model() string
 	MarketId() string
 	PositionSymbols() map[Side]string
+	Interval() uint8
 
 	Handle(market Market, proba float64) ([]StrategyOrder, error)
 }

+ 4 - 0
strategy/alpaca/qqq12f/strategy.go

@@ -28,6 +28,10 @@ func (s alpacaQQQ) PositionSymbols() map[sentio.Side]string {
 	}
 }
 
+func (s alpacaQQQ) Interval() uint8 {
+	return 15
+}
+
 func (s alpacaQQQ) Handle(market sentio.Market, proba float64) ([]sentio.StrategyOrder, error) {
 	if !market.IsMarketOpened() {
 		return nil, sentio.ErrMarketClosed

+ 4 - 0
strategy/alpaca/qqq13/strategy.go

@@ -28,6 +28,10 @@ func (s alpacaQQQ) PositionSymbols() map[sentio.Side]string {
 	}
 }
 
+func (s alpacaQQQ) Interval() uint8 {
+	return 5
+}
+
 func (s alpacaQQQ) Handle(market sentio.Market, proba float64) ([]sentio.StrategyOrder, error) {
 	if !market.IsMarketOpened() {
 		return nil, sentio.ErrMarketClosed