浏览代码

Strategy

- add `Interval() uint8`
Alexey Kim 1 月之前
父节点
当前提交
095c43bd5f
共有 3 个文件被更改,包括 9 次插入0 次删除
  1. 1 0
      strategy.go
  2. 4 0
      strategy/alpaca/qqq12f/strategy.go
  3. 4 0
      strategy/alpaca/qqq13/strategy.go

+ 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