Kaynağa Gözat

Strategy

- ppo
Alexey Kim 2 gün önce
ebeveyn
işleme
e9bc863389
1 değiştirilmiş dosya ile 3 ekleme ve 2 silme
  1. 3 2
      strategy/alpaca/ppo/strategy.go

+ 3 - 2
strategy/alpaca/ppo_20250709/strategy.go → strategy/alpaca/ppo/strategy.go

@@ -78,13 +78,14 @@ func (strategy qqq) Handle(turn *sentio.Turn, market sentio.Market, rs sentio.Ri
 
 	for i := range orders {
 		shouldClose := false
+		side := util.SideOf(orders[i].GetIntent())
 
 		if orders[i].GetSymbol() == strategy.PositionSymbols()[sentio.LONG] && sentio.Action_SELL == turn.Action {
 			shouldClose = true
 		}
 
 		if orders[i].GetSymbol() == strategy.PositionSymbols()[sentio.BASE] &&
-			sentio.LONG == orders[i].Intent() && sentio.Action_SELL == turn.Action {
+			sentio.LONG == side && sentio.Action_SELL == turn.Action {
 			shouldClose = true
 		}
 
@@ -93,7 +94,7 @@ func (strategy qqq) Handle(turn *sentio.Turn, market sentio.Market, rs sentio.Ri
 		}
 
 		if orders[i].GetSymbol() == strategy.PositionSymbols()[sentio.BASE] &&
-			sentio.SHORT == orders[i].Intent() && sentio.Action_BUY == turn.Action {
+			sentio.SHORT == side && sentio.Action_BUY == turn.Action {
 			shouldClose = true
 		}