mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
types: use pointer receiver for submit order
Signed-off-by: c9s <yoanlin93@gmail.com>
This commit is contained in:
parent
94ad8a5096
commit
dfdfd6b85e
|
@ -134,7 +134,7 @@ type SubmitOrder struct {
|
|||
ClosePosition bool `json:"closePosition" db:"close_position"`
|
||||
}
|
||||
|
||||
func (o SubmitOrder) String() string {
|
||||
func (o *SubmitOrder) String() string {
|
||||
switch o.Type {
|
||||
case OrderTypeMarket:
|
||||
return fmt.Sprintf("SubmitOrder %s %s %s %s", o.Symbol, o.Type, o.Side, o.Quantity.String())
|
||||
|
@ -143,7 +143,7 @@ func (o SubmitOrder) String() string {
|
|||
return fmt.Sprintf("SubmitOrder %s %s %s %s @ %s", o.Symbol, o.Type, o.Side, o.Quantity.String(), o.Price.String())
|
||||
}
|
||||
|
||||
func (o SubmitOrder) PlainText() string {
|
||||
func (o *SubmitOrder) PlainText() string {
|
||||
switch o.Type {
|
||||
case OrderTypeMarket:
|
||||
return fmt.Sprintf("SubmitOrder %s %s %s %s", o.Symbol, o.Type, o.Side, o.Quantity.String())
|
||||
|
@ -152,7 +152,7 @@ func (o SubmitOrder) PlainText() string {
|
|||
return fmt.Sprintf("SubmitOrder %s %s %s %s @ %s", o.Symbol, o.Type, o.Side, o.Quantity.String(), o.Price.String())
|
||||
}
|
||||
|
||||
func (o SubmitOrder) SlackAttachment() slack.Attachment {
|
||||
func (o *SubmitOrder) SlackAttachment() slack.Attachment {
|
||||
var fields = []slack.AttachmentField{
|
||||
{Title: "Symbol", Value: o.Symbol, Short: true},
|
||||
{Title: "Side", Value: string(o.Side), Short: true},
|
||||
|
|
Loading…
Reference in New Issue
Block a user