@@ -694,29 +694,27 @@ func (s *Strategy) align(ctx context.Context, sessions bbgo.ExchangeSessionMap)
694694 }
695695
696696 if s .WarningDuration > 0 && sustainedDuration >= s .WarningDuration .Duration () {
697- if s .LargeAmountAlert != nil && price .Sign () > 0 {
698- if amount .Compare (s .LargeAmountAlert .Amount ) > 0 {
699- cbd := & CriticalBalanceDiscrepancyAlert {
700- Warning : true ,
701- SlackAlert : s .LargeAmountAlert .Slack ,
702- QuoteCurrency : s .LargeAmountAlert .QuoteCurrency ,
703- AlertAmount : s .LargeAmountAlert .Amount ,
704- BaseCurrency : currency ,
705- SustainedDuration : sustainedDuration ,
706-
707- Side : s .selectAdjustmentOrderSide (q ),
708- Price : price ,
709- Delta : q ,
710- Quantity : quantity ,
711- Amount : amount ,
712- }
713- bbgo .PostLiveNote (
714- cbd ,
715- livenote .Channel (s .LargeAmountAlert .Slack .Channel ),
716- livenote .OneTimeMention (s .LargeAmountAlert .Slack .Mentions ... ),
717- cbd .Comment (),
718- )
697+ if s .LargeAmountAlert != nil && price .Sign () > 0 && amount .Compare (s .LargeAmountAlert .Amount ) > 0 {
698+ cbd := & CriticalBalanceDiscrepancyAlert {
699+ Warning : true ,
700+ SlackAlert : s .LargeAmountAlert .Slack ,
701+ QuoteCurrency : s .LargeAmountAlert .QuoteCurrency ,
702+ AlertAmount : s .LargeAmountAlert .Amount ,
703+ BaseCurrency : currency ,
704+ SustainedDuration : sustainedDuration ,
705+
706+ Side : s .selectAdjustmentOrderSide (q ),
707+ Price : price ,
708+ Delta : q ,
709+ Quantity : quantity ,
710+ Amount : amount ,
719711 }
712+ bbgo .PostLiveNote (
713+ cbd ,
714+ livenote .Channel (s .LargeAmountAlert .Slack .Channel ),
715+ livenote .OneTimeMention (s .LargeAmountAlert .Slack .Mentions ... ),
716+ cbd .WarnComment (),
717+ )
720718 }
721719 }
722720
@@ -725,28 +723,26 @@ func (s *Strategy) align(ctx context.Context, sessions bbgo.ExchangeSessionMap)
725723 }
726724 }
727725
728- if s .LargeAmountAlert != nil && price .Sign () > 0 {
729- if amount .Compare (s .LargeAmountAlert .Amount ) > 0 {
730- cbd := & CriticalBalanceDiscrepancyAlert {
731- SlackAlert : s .LargeAmountAlert .Slack ,
732- QuoteCurrency : s .LargeAmountAlert .QuoteCurrency ,
733- AlertAmount : s .LargeAmountAlert .Amount ,
734- BaseCurrency : currency ,
735- SustainedDuration : s .Duration .Duration (),
736-
737- Side : s .selectAdjustmentOrderSide (q ),
738- Price : price ,
739- Delta : q ,
740- Quantity : quantity ,
741- Amount : amount ,
742- }
743- bbgo .PostLiveNote (
744- cbd ,
745- livenote .Channel (s .LargeAmountAlert .Slack .Channel ),
746- livenote .OneTimeMention (s .LargeAmountAlert .Slack .Mentions ... ),
747- cbd .Comment (),
748- )
726+ if s .LargeAmountAlert != nil && price .Sign () > 0 && amount .Compare (s .LargeAmountAlert .Amount ) > 0 {
727+ cbd := & CriticalBalanceDiscrepancyAlert {
728+ SlackAlert : s .LargeAmountAlert .Slack ,
729+ QuoteCurrency : s .LargeAmountAlert .QuoteCurrency ,
730+ AlertAmount : s .LargeAmountAlert .Amount ,
731+ BaseCurrency : currency ,
732+ SustainedDuration : s .Duration .Duration (),
733+
734+ Side : s .selectAdjustmentOrderSide (q ),
735+ Price : price ,
736+ Delta : q ,
737+ Quantity : quantity ,
738+ Amount : amount ,
749739 }
740+ bbgo .PostLiveNote (
741+ cbd ,
742+ livenote .Channel (s .LargeAmountAlert .Slack .Channel ),
743+ livenote .OneTimeMention (s .LargeAmountAlert .Slack .Mentions ... ),
744+ cbd .Comment (),
745+ )
750746 }
751747
752748 selectedSession , submitOrder := s .selectSessionForCurrency (ctx , sessions , currency , q )
0 commit comments