|
@@ -33,10 +33,6 @@ func (s alpacaQQQ) Interval() uint8 {
|
|
}
|
|
}
|
|
|
|
|
|
func (s alpacaQQQ) Handle(market sentio.Market, proba float64) ([]sentio.StrategyOrder, error) {
|
|
func (s alpacaQQQ) Handle(market sentio.Market, proba float64) ([]sentio.StrategyOrder, error) {
|
|
- if !market.IsMarketOpened() {
|
|
|
|
- return nil, sentio.ErrMarketClosed
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
var (
|
|
var (
|
|
portfolio sentio.Portfolio
|
|
portfolio sentio.Portfolio
|
|
orders []sentio.StrategyOrder
|
|
orders []sentio.StrategyOrder
|
|
@@ -60,7 +56,7 @@ func (s alpacaQQQ) Handle(market sentio.Market, proba float64) ([]sentio.Strateg
|
|
}
|
|
}
|
|
|
|
|
|
// skip too early trades
|
|
// skip too early trades
|
|
- if t.Hour() == 14 && t.Minute() < 40 {
|
|
|
|
|
|
+ if t.Hour() == 9 && t.Minute() < 40 {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
|
|
|
|
@@ -72,7 +68,7 @@ func (s alpacaQQQ) Handle(market sentio.Market, proba float64) ([]sentio.Strateg
|
|
}
|
|
}
|
|
|
|
|
|
// Close positions before market closed
|
|
// Close positions before market closed
|
|
- if ok && t.Hour() == 20 && t.Minute() > 45 {
|
|
|
|
|
|
+ if ok && t.Hour() == 15 && t.Minute() > 45 {
|
|
orders = append(orders, sentio.StrategyOrder{
|
|
orders = append(orders, sentio.StrategyOrder{
|
|
Symbol: symbol,
|
|
Symbol: symbol,
|
|
Action: sentio.OrderSell,
|
|
Action: sentio.OrderSell,
|
|
@@ -104,7 +100,7 @@ func (s alpacaQQQ) Handle(market sentio.Market, proba float64) ([]sentio.Strateg
|
|
}}, nil
|
|
}}, nil
|
|
}
|
|
}
|
|
|
|
|
|
- if t.Hour() == 20 && t.Minute() > 35 {
|
|
|
|
|
|
+ if t.Hour() == 15 && t.Minute() > 35 {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
|
|
|