mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
xmaker: add more logs
This commit is contained in:
parent
cc820d3df0
commit
7c4b3e81df
|
@ -265,7 +265,7 @@ func (s *Strategy) applySignalMargin(ctx context.Context, quote *Quote) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
s.logger.Infof("final signal: %f", signal)
|
s.logger.Infof("aggregated signal: %f", signal)
|
||||||
|
|
||||||
scale, err := s.SignalMarginScale.Scale()
|
scale, err := s.SignalMarginScale.Scale()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -274,7 +274,7 @@ func (s *Strategy) applySignalMargin(ctx context.Context, quote *Quote) error {
|
||||||
|
|
||||||
margin := scale.Call(signal)
|
margin := scale.Call(signal)
|
||||||
|
|
||||||
s.logger.Infof("signalMargin: %f", margin)
|
s.logger.Infof("signal margin: %f", margin)
|
||||||
|
|
||||||
marginFp := fixedpoint.NewFromFloat(margin)
|
marginFp := fixedpoint.NewFromFloat(margin)
|
||||||
if signal < 0.0 {
|
if signal < 0.0 {
|
||||||
|
@ -282,11 +282,15 @@ func (s *Strategy) applySignalMargin(ctx context.Context, quote *Quote) error {
|
||||||
if signal <= -2.0 {
|
if signal <= -2.0 {
|
||||||
// quote.BidMargin = fixedpoint.Zero
|
// quote.BidMargin = fixedpoint.Zero
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s.logger.Infof("adjusted bid margin: %f", quote.BidMargin.Float64())
|
||||||
} else if signal > 0.0 {
|
} else if signal > 0.0 {
|
||||||
quote.AskMargin = quote.AskMargin.Add(marginFp)
|
quote.AskMargin = quote.AskMargin.Add(marginFp)
|
||||||
if signal >= 2.0 {
|
if signal >= 2.0 {
|
||||||
// quote.AskMargin = fixedpoint.Zero
|
// quote.AskMargin = fixedpoint.Zero
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s.logger.Infof("adjusted ask margin: %f", quote.AskMargin.Float64())
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue
Block a user