Skip to content

Commit

Permalink
Merge pull request #6 from giansalex/hotfix/trailing-init
Browse files Browse the repository at this point in the history
Fix missing field in traling init
  • Loading branch information
giansalex authored Jul 27, 2021
2 parents 4dc2e26 + 6776ae7 commit 69301a3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions stoploss/trailing.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func NewTrailing(exchange Exchange, notify notify.SingleNotify, logNotify notify
tlg := &Trailing{
exchange: exchange,
notify: notify,
config: config,
sLog: logNotify,
market: pair[0] + pair[1],
baseCoin: pair[0],
Expand Down Expand Up @@ -80,8 +81,9 @@ func (tlg *Trailing) runSell() bool {
tlg.notify.Send("Cannot create sell order, error:" + err.Error())
} else {
msgFmt := "📉 ## <b>SELL</b> ##\n<i>Market:</i> <code>%s</code>\n<i>Amount:</i> %s <code>%s</code> \n<i>Price:</i> %.6f <code>%s</code>\n<i>Order:</i> %s"
tlg.notify.Send(fmt.Sprintf(msgFmt, tlg.config.Market, quantity, tlg.baseCoin, marketPrice, tlg.countCoin, order))
tlg.sLog.Send(msgFmt)
msg := fmt.Sprintf(msgFmt, tlg.config.Market, quantity, tlg.baseCoin, marketPrice, tlg.countCoin, order)
tlg.notify.Send(msg)
tlg.sLog.Send(msg)
}

return true
Expand Down Expand Up @@ -117,8 +119,9 @@ func (tlg *Trailing) runBuy() bool {
tlg.notify.Send("Cannot create buy order, error:" + err.Error())
} else {
msgFmt := "📈 ## <b>BUY</b> ##\n<i>Market:</i> <code>%s</code>\n<i>Amount:</i> %s <code>%s</code> \n<i>Price:</i> %.6f <code>%s</code>\n<i>Order:</i> %s"
tlg.notify.Send(fmt.Sprintf(msgFmt, tlg.config.Market, quantity, tlg.baseCoin, marketPrice, tlg.countCoin, order))
tlg.sLog.Send(msgFmt)
msg := fmt.Sprintf(msgFmt, tlg.config.Market, quantity, tlg.baseCoin, marketPrice, tlg.countCoin, order)
tlg.notify.Send(msg)
tlg.sLog.Send(msg)
}

return true
Expand Down

0 comments on commit 69301a3

Please sign in to comment.