mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 08:15:15 +00:00
bbgo: introduce ENABLE_MARKET_TRADE_STOP env var
This commit is contained in:
parent
5afd23b5c7
commit
b5f2f57678
|
@ -8,8 +8,17 @@ import (
|
|||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/c9s/bbgo/pkg/dynamic"
|
||||
"github.com/c9s/bbgo/pkg/util"
|
||||
)
|
||||
|
||||
var enableMarketTradeStop = true
|
||||
|
||||
func init() {
|
||||
if v, defined := util.GetEnvVarBool("ENABLE_MARKET_TRADE_STOP"); defined {
|
||||
enableMarketTradeStop = v
|
||||
}
|
||||
}
|
||||
|
||||
type ExitMethodSet []ExitMethod
|
||||
|
||||
func (s *ExitMethodSet) SetAndSubscribe(session *ExchangeSession, parent interface{}) {
|
||||
|
|
|
@ -9,8 +9,6 @@ import (
|
|||
"github.com/c9s/bbgo/pkg/types"
|
||||
)
|
||||
|
||||
const enableMarketTradeStop = true
|
||||
|
||||
// ProtectiveStopLoss provides a way to protect your profit but also keep a room for the price volatility
|
||||
// Set ActivationRatio to 1% means if the price is away from your average cost by 1%, we will activate the protective stop loss
|
||||
// and the StopLossRatio is the minimal profit ratio you want to keep for your position.
|
||||
|
|
Loading…
Reference in New Issue
Block a user