|
@@ -94,6 +94,10 @@ func (s alpacaQQQ) Handle(market sentio.Market, proba float64) ([]sentio.Strateg
|
|
}
|
|
}
|
|
|
|
|
|
if sentio.LONG == side && proba > 1.001 {
|
|
if sentio.LONG == side && proba > 1.001 {
|
|
|
|
+ if position != nil && position.GetCurrentPrice() > position.GetAvgPrice() {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
orders = append(orders, sentio.StrategyOrder{
|
|
orders = append(orders, sentio.StrategyOrder{
|
|
Symbol: symbol,
|
|
Symbol: symbol,
|
|
Action: sentio.OrderBuy,
|
|
Action: sentio.OrderBuy,
|
|
@@ -109,6 +113,10 @@ func (s alpacaQQQ) Handle(market sentio.Market, proba float64) ([]sentio.Strateg
|
|
}
|
|
}
|
|
|
|
|
|
if sentio.SHORT == side && proba < .9998 {
|
|
if sentio.SHORT == side && proba < .9998 {
|
|
|
|
+ if position != nil && position.GetCurrentPrice() > position.GetAvgPrice() {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
orders = append(orders, sentio.StrategyOrder{
|
|
orders = append(orders, sentio.StrategyOrder{
|
|
Symbol: symbol,
|
|
Symbol: symbol,
|
|
Action: sentio.OrderBuy,
|
|
Action: sentio.OrderBuy,
|