This commit is contained in:
2026-08-24 20:53:21 +08:00
commit 6e78bba16a
287 changed files with 32443 additions and 0 deletions

19
demo/hold.go Normal file
View File

@@ -0,0 +1,19 @@
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",
})
}
},
}
}