Merge pull request #613 from c9s/bollmaker-set-exchange-fee

bollmaker: set exchange fee to position
This commit is contained in:
Yo-An Lin 2022-05-14 12:51:57 +08:00 committed by GitHub
commit d4e342123d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -551,6 +551,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
// initial required information
s.session = session
s.neutralBoll = s.StandardIndicatorSet.BOLL(s.NeutralBollinger.IntervalWindow, s.NeutralBollinger.BandWidth)
s.defaultBoll = s.StandardIndicatorSet.BOLL(s.DefaultBollinger.IntervalWindow, s.DefaultBollinger.BandWidth)
@ -573,6 +574,13 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
}
}
if s.session.MakerFeeRate.Sign() > 0 || s.session.TakerFeeRate.Sign() > 0 {
s.Position.SetExchangeFeeRate(s.session.ExchangeName, types.ExchangeFee{
MakerFeeRate: s.session.MakerFeeRate,
TakerFeeRate: s.session.TakerFeeRate,
})
}
if s.ProfitStats == nil {
if s.state != nil {
// copy profit stats