mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
bollmaker: separate bidSpread and askSpread
This commit is contained in:
parent
2e7621ca55
commit
eb5064ccfe
|
@ -288,8 +288,18 @@ func (s *Strategy) getCurrentAllowedExposurePosition(bandPercentage float64) (fi
|
|||
}
|
||||
|
||||
func (s *Strategy) placeOrders(ctx context.Context, orderExecutor bbgo.OrderExecutor, midPrice fixedpoint.Value, kline *types.KLine) {
|
||||
askPrice := midPrice.Mul(one + s.Spread)
|
||||
bidPrice := midPrice.Mul(one - s.Spread)
|
||||
bidSpread := s.Spread
|
||||
if s.BidSpread > 0 {
|
||||
bidSpread = s.BidSpread
|
||||
}
|
||||
|
||||
askSpread := s.Spread
|
||||
if s.AskSpread > 0 {
|
||||
askSpread = s.AskSpread
|
||||
}
|
||||
|
||||
askPrice := midPrice.Mul(one + askSpread)
|
||||
bidPrice := midPrice.Mul(one - bidSpread)
|
||||
base := s.state.Position.GetBase()
|
||||
balances := s.session.Account.Balances()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user