mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
grid2: check price
This commit is contained in:
parent
9d62720111
commit
bce004106c
|
@ -35,8 +35,8 @@ exchangeStrategies:
|
|||
grid2:
|
||||
symbol: BTCUSDT
|
||||
upperPrice: 18_000.0
|
||||
lowerPrice: 13_000.0
|
||||
gridNumber: 100
|
||||
lowerPrice: 15_000.0
|
||||
gridNumber: 30
|
||||
|
||||
## compound is used for buying more inventory when the profit is made by the filled SELL order.
|
||||
## when compound is disabled, fixed quantity is used for each grid order.
|
||||
|
|
|
@ -497,6 +497,10 @@ func (s *Strategy) newTriggerPriceHandler(ctx context.Context, session *bbgo.Exc
|
|||
return
|
||||
}
|
||||
|
||||
if s.grid != nil {
|
||||
return
|
||||
}
|
||||
|
||||
s.logger.Infof("the last price %f hits triggerPrice %f, opening grid", k.Close.Float64(), s.TriggerPrice.Float64())
|
||||
if err := s.openGrid(ctx, session); err != nil {
|
||||
s.logger.WithError(err).Errorf("failed to setup grid orders")
|
||||
|
|
Loading…
Reference in New Issue
Block a user