mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
Merge pull request #6 from appleboy/patch
chore: make code more readable
This commit is contained in:
commit
38307f0f43
|
@ -44,11 +44,10 @@ func (report ProfitAndLossReport) Print() {
|
|||
}
|
||||
|
||||
func (report ProfitAndLossReport) SlackAttachment() slack.Attachment {
|
||||
var color = ""
|
||||
var color = slackstyle.Red
|
||||
|
||||
if report.UnrealizedProfit > 0 {
|
||||
color = slackstyle.Green
|
||||
} else {
|
||||
color = slackstyle.Red
|
||||
}
|
||||
|
||||
market, ok := types.FindMarket(report.Symbol)
|
||||
|
|
|
@ -32,7 +32,7 @@ func (t *LogHook) Levels() []logrus.Level {
|
|||
}
|
||||
|
||||
func (t *LogHook) Fire(e *logrus.Entry) error {
|
||||
var color = "#F0F0F0"
|
||||
var color = ""
|
||||
|
||||
switch e.Level {
|
||||
case logrus.DebugLevel:
|
||||
|
|
|
@ -30,11 +30,10 @@ type Trade struct {
|
|||
}
|
||||
|
||||
func (trade Trade) SlackAttachment() slack.Attachment {
|
||||
var color = ""
|
||||
var color = "#DC143C"
|
||||
|
||||
if trade.IsBuyer {
|
||||
color = "#228B22"
|
||||
} else {
|
||||
color = "#DC143C"
|
||||
}
|
||||
|
||||
market, ok := FindMarket(trade.Symbol)
|
||||
|
|
Loading…
Reference in New Issue
Block a user