mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
move side name color
This commit is contained in:
parent
62e27957c1
commit
d38c3afb40
17
types/color.go
Normal file
17
types/color.go
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
package types
|
||||||
|
|
||||||
|
import "github.com/adshao/go-binance"
|
||||||
|
|
||||||
|
const Green = "#228B22"
|
||||||
|
const Red = "#800000"
|
||||||
|
|
||||||
|
func SideToColorName(side binance.SideType) string {
|
||||||
|
if side == binance.SideTypeBuy {
|
||||||
|
return Green
|
||||||
|
}
|
||||||
|
if side == binance.SideTypeSell {
|
||||||
|
return Red
|
||||||
|
}
|
||||||
|
|
||||||
|
return "#f0f0f0"
|
||||||
|
}
|
|
@ -5,9 +5,6 @@ import (
|
||||||
"github.com/slack-go/slack"
|
"github.com/slack-go/slack"
|
||||||
)
|
)
|
||||||
|
|
||||||
const Green = "#228B22"
|
|
||||||
const Red = "#800000"
|
|
||||||
|
|
||||||
type Order struct {
|
type Order struct {
|
||||||
Symbol string
|
Symbol string
|
||||||
Side binance.SideType
|
Side binance.SideType
|
||||||
|
@ -37,13 +34,3 @@ func (o *Order) SlackAttachment() slack.Attachment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func SideToColorName(side binance.SideType) string {
|
|
||||||
if side == binance.SideTypeBuy {
|
|
||||||
return Green
|
|
||||||
}
|
|
||||||
if side == binance.SideTypeSell {
|
|
||||||
return Red
|
|
||||||
}
|
|
||||||
|
|
||||||
return "#f0f0f0"
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user