|
@@ -9,11 +9,11 @@ var Strategy = alpacaQQQ{}
|
|
|
type alpacaQQQ struct{}
|
|
|
|
|
|
func (s alpacaQQQ) Name() string {
|
|
|
- return "Alpaca: QQQ"
|
|
|
+ return "Alpaca: QQQ / SQQQ"
|
|
|
}
|
|
|
|
|
|
func (s alpacaQQQ) Model() string {
|
|
|
- return "qqq001"
|
|
|
+ return "qqq002"
|
|
|
}
|
|
|
|
|
|
func (s alpacaQQQ) MarketId() string {
|
|
@@ -94,7 +94,7 @@ func (s alpacaQQQ) Handle(market sentio.Market, proba float64) ([]sentio.Strateg
|
|
|
}
|
|
|
|
|
|
if sentio.LONG == side && proba > 1.001 {
|
|
|
- if position != nil && position.GetCurrentPrice() > position.GetAvgPrice() {
|
|
|
+ if ok && position != nil && position.GetCurrentPrice() > position.GetAvgPrice() {
|
|
|
continue
|
|
|
}
|
|
|
|
|
@@ -113,7 +113,7 @@ func (s alpacaQQQ) Handle(market sentio.Market, proba float64) ([]sentio.Strateg
|
|
|
}
|
|
|
|
|
|
if sentio.SHORT == side && proba < .9998 {
|
|
|
- if position != nil && position.GetCurrentPrice() > position.GetAvgPrice() {
|
|
|
+ if ok && position != nil && position.GetCurrentPrice() > position.GetAvgPrice() {
|
|
|
continue
|
|
|
}
|
|
|
|