Browse Source

Strategy

- add `Interval() uint8`
Alexey Kim 1 tháng trước cách đây
mục cha
commit
095c43bd5f
3 tập tin đã thay đổi với 9 bổ sung0 xóa
  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