mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
add 1m subscribe to RoiTakeProfit
This commit is contained in:
parent
1ca7e0d032
commit
9302474d51
|
@ -9,12 +9,18 @@ import (
|
|||
|
||||
// RoiTakeProfit force takes the profit by the given ROI percentage.
|
||||
type RoiTakeProfit struct {
|
||||
Symbol string `json:"symbol"`
|
||||
Percentage fixedpoint.Value `json:"percentage"`
|
||||
|
||||
session *ExchangeSession
|
||||
orderExecutor *GeneralOrderExecutor
|
||||
}
|
||||
|
||||
func (s *RoiTakeProfit) Subscribe(session *ExchangeSession) {
|
||||
// use 1m kline to handle roi stop
|
||||
session.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: types.Interval1m})
|
||||
}
|
||||
|
||||
func (s *RoiTakeProfit) Bind(session *ExchangeSession, orderExecutor *GeneralOrderExecutor) {
|
||||
s.session = session
|
||||
s.orderExecutor = orderExecutor
|
||||
|
|
Loading…
Reference in New Issue
Block a user