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

35
ptn/hammer/v3.go Normal file
View File

@@ -0,0 +1,35 @@
package hammer
import (
"github.com/banbox/banbot/config"
"github.com/banbox/banbot/strat"
)
const (
v3AtrLen = 14
v3WatchMin = 5 // 入场后观察后续蜡烛的最少个数
v3WatchMax = 100 // 入场后观察后续蜡烛的最多个数
v3RefNum = 20 // 回顾历史回撤的数量
)
func MainV3(pol *config.RunPolicyConfig) *strat.TradeStrat {
return &strat.TradeStrat{
Version: 1,
WarmupNum: 3000,
MinTfScore: 0.75,
DrawDownExit: true,
StopEnterBars: 10,
OnStartUp: func(s *strat.StratJob) {
s.More = &MoreHammer{
odInfos: map[int64]*OdInfo{},
}
},
OnBar: makeOnBar(v3AtrLen, v3RefNum, v3WatchMin, v3WatchMax, 3),
OnOrderChange: onOrderChange,
GetDrawDownExitRate: makeDrawDownExit(0.8, [][2]float64{
{0.625, 0.25},
{0.3, 0.37},
{0.15, 0.5},
}),
}
}