optmize

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2024 License: AGPL-3.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShowNum = 600
)

Variables

This section is empty.

Functions

func CollectOptLog

func CollectOptLog(args *config.CmdArgs) *errs.Error

CollectOptLog Collect and analyze the logs generated by RunOptimize Sorts all policy tasks in reverse score order of output. 收集分析RunOptimize生成的日志 将所有策略任务按分数倒序排列输出。

func CompareExgBTOrders

func CompareExgBTOrders(args []string)

CompareExgBTOrders Compare the exchange export order records with the backtest order records. 对比交易所导出订单记录和回测订单记录。

func RunBTOverOpt

func RunBTOverOpt(args *config.CmdArgs) *errs.Error

RunBTOverOpt Backtesting mode based on continuous parameter tuning. Approach the real situation and avoid using future information to adjust parameters for backtesting. 基于持续调参的回测模式。接近实盘情况,避免使用未来信息调参回测。

func RunOptimize

func RunOptimize(args *config.CmdArgs) *errs.Error

Types

type BTResult

type BTResult struct {
	MaxOpenOrders   int
	MinReal         float64
	MaxReal         float64 // Maximum Assets 最大资产
	MaxDrawDownPct  float64 // Maximum drawdown percentage 最大回撤百分比
	ShowDrawDownPct float64 // Displays the maximum drawdown percentage 显示最大回撤百分比
	BarNum          int
	TimeNum         int
	OrderNum        int

	Plots        *PlotData
	StartMS      int64
	EndMS        int64
	PlotEvery    int
	TotalInvest  float64
	OutDir       string
	PairGrps     []*RowItem
	TotProfitPct float64
	SharpeRatio  float64
	SortinoRatio float64
	// contains filtered or unexported fields
}

func NewBTResult

func NewBTResult() *BTResult

type BackTest

type BackTest struct {
	biz.Trader
	*BTResult
	// contains filtered or unexported fields
}

func NewBackTest

func NewBackTest() *BackTest

func (*BackTest) FeedKLine

func (b *BackTest) FeedKLine(bar *orm.InfoKline)

func (*BackTest) Init

func (b *BackTest) Init() *errs.Error

func (*BackTest) Run

func (b *BackTest) Run()

type FuncOptTask

type FuncOptTask func(params map[string]float64) (float64, *errs.Error)

type GroupScore

type GroupScore struct {
	Items []*config.RunPolicyConfig
	Score float64
}

type OptGroup

type OptGroup struct {
	Items []*OptInfo
	Score float64
	Name  string
	Pair  string
	TFStr string
}

type OptInfo

type OptInfo struct {
	Dirt  string
	Score float64
	Param string
	OdNum int
}

type PlotData

type PlotData struct {
	Labels        []string
	OdNum         []int
	Real          []float64
	Available     []float64
	UnrealizedPOL []float64
	WithDraw      []float64
	// contains filtered or unexported fields
}

type RowItem

type RowItem struct {
	Title string
	RowPart
}

type RowPart

type RowPart struct {
	WinCount     int
	ProfitSum    float64
	ProfitPctSum float64
	CostSum      float64
	Durations    []int
	Orders       []*orm.InOutOrder
	Sharpe       float64 // 夏普比率
	Sortino      float64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL