mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
support: check target quantity and min notional
This commit is contained in:
parent
9aaad2d28c
commit
f28cc18ce4
|
@ -11,7 +11,6 @@ import (
|
|||
"github.com/c9s/bbgo/pkg/types"
|
||||
)
|
||||
|
||||
// support -- support and targets
|
||||
const ID = "support"
|
||||
|
||||
var log = logrus.WithField("strategy", ID)
|
||||
|
@ -148,6 +147,16 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
|||
for _, target := range s.Targets {
|
||||
targetPrice := closePrice * (1.0 + target.ProfitPercentage)
|
||||
targetQuantity := quantity * target.QuantityPercentage
|
||||
targetQuoteQuantity := targetPrice * targetQuantity
|
||||
|
||||
if targetQuoteQuantity <= market.MinNotional {
|
||||
continue
|
||||
}
|
||||
|
||||
if targetQuantity <= market.MinQuantity {
|
||||
continue
|
||||
}
|
||||
|
||||
targetOrders = append(targetOrders, types.SubmitOrder{
|
||||
Symbol: kline.Symbol,
|
||||
Market: market,
|
||||
|
|
Loading…
Reference in New Issue
Block a user