mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
grid2: fill fixedpoint.Zero for stats
This commit is contained in:
parent
ec6b170f01
commit
19e0a20c67
|
@ -50,7 +50,7 @@ exchangeStrategies:
|
|||
## triggerPrice is used for opening your grid only when the last price touches your pre-set price.
|
||||
## this is useful when you don't want to create a grid from a higher price.
|
||||
## for example, when the last price hit 17_000.0 then open a grid with the price range 13_000 to 20_000
|
||||
triggerPrice: 16_900.0
|
||||
# triggerPrice: 16_900.0
|
||||
|
||||
stopLossPrice: 16_000.0
|
||||
|
||||
|
|
|
@ -29,8 +29,16 @@ type GridProfitStats struct {
|
|||
|
||||
func newGridProfitStats(market types.Market) *GridProfitStats {
|
||||
return &GridProfitStats{
|
||||
Symbol: market.Symbol,
|
||||
Market: market,
|
||||
Symbol: market.Symbol,
|
||||
TotalBaseProfit: fixedpoint.Zero,
|
||||
TotalQuoteProfit: fixedpoint.Zero,
|
||||
FloatProfit: fixedpoint.Zero,
|
||||
GridProfit: fixedpoint.Zero,
|
||||
ArbitrageCount: 0,
|
||||
TotalFee: fixedpoint.Zero,
|
||||
Volume: fixedpoint.Zero,
|
||||
Market: market,
|
||||
ProfitEntries: nil,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -658,7 +658,7 @@ func (s *Strategy) openGrid(ctx context.Context, session *bbgo.ExchangeSession)
|
|||
Quantity: quantity,
|
||||
Market: s.Market,
|
||||
TimeInForce: types.TimeInForceGTC,
|
||||
Tag: "grid",
|
||||
Tag: "grid2",
|
||||
})
|
||||
usedBase = usedBase.Add(quantity)
|
||||
} else if i > 0 {
|
||||
|
@ -674,7 +674,7 @@ func (s *Strategy) openGrid(ctx context.Context, session *bbgo.ExchangeSession)
|
|||
Quantity: quantity,
|
||||
Market: s.Market,
|
||||
TimeInForce: types.TimeInForceGTC,
|
||||
Tag: "grid",
|
||||
Tag: "grid2",
|
||||
})
|
||||
quoteQuantity := quantity.Mul(price)
|
||||
usedQuote = usedQuote.Add(quoteQuantity)
|
||||
|
|
Loading…
Reference in New Issue
Block a user