mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
exit/protectivestoploss: works in long position
This commit is contained in:
parent
1cd48177ae
commit
b133767e47
|
@ -119,8 +119,10 @@ func (s *ProtectiveStopLoss) Bind(session *ExchangeSession, orderExecutor *Gener
|
|||
}
|
||||
|
||||
isPositionOpened := !position.IsClosed() && !position.IsDust(kline.Close)
|
||||
if isPositionOpened && position.IsShort() {
|
||||
if isPositionOpened {
|
||||
s.handleChange(context.Background(), position, kline.Close, s.orderExecutor)
|
||||
} else {
|
||||
s.stopLossPrice = fixedpoint.Zero
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user