mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-13 02:23:51 +00:00
31 lines
490 B
Go
31 lines
490 B
Go
package buyandhold
|
|
|
|
import (
|
|
"github.com/c9s/bbgo/pkg/bbgo"
|
|
"github.com/c9s/bbgo/pkg/types"
|
|
)
|
|
|
|
type Strategy struct {
|
|
symbol string
|
|
}
|
|
|
|
func New(symbol string) *Strategy {
|
|
return &Strategy{
|
|
symbol: symbol,
|
|
}
|
|
}
|
|
|
|
func (s *Strategy) Run(trader types.Trader, session *bbgo.ExchangeSession) error {
|
|
session.Subscribe(types.KLineChannel, s.symbol, types.SubscribeOptions{})
|
|
session.Stream.OnKLineClosed(func(kline types.KLine) {
|
|
// trader.SubmitOrder(ctx, ....)
|
|
})
|
|
|
|
return nil
|
|
}
|
|
|
|
|
|
|
|
|
|
|