20 lines
338 B
Go
20 lines
338 B
Go
package demo
|
|
|
|
import (
|
|
"github.com/banbox/banbot/config"
|
|
"github.com/banbox/banbot/strat"
|
|
)
|
|
|
|
func Hold(pol *config.RunPolicyConfig) *strat.TradeStrat {
|
|
return &strat.TradeStrat{
|
|
EachMaxLong: 1,
|
|
OnBar: func(s *strat.StratJob) {
|
|
if len(s.LongOrders) == 0 {
|
|
s.OpenOrder(&strat.EnterReq{
|
|
Tag: "hold",
|
|
})
|
|
}
|
|
},
|
|
}
|
|
}
|