Documentation
¶
Index ¶
- type Report
- func (r *Report) Analyzer() (err error)
- func (r *Report) CalculateEquityCurve() []float64
- func (r *Report) CalculateMetrics(metrics *ReportResult) (err error)
- func (r *Report) EndBalance() float64
- func (r *Report) ExportToDB(dbPath string) (err error)
- func (r *Report) GenHTML(w io.Writer) (err error)
- func (r *Report) GenHTMLReport(fPath string) (err error)
- func (r *Report) GenRPT(fPath string) (err error)
- func (r *Report) GetReport() (report string)
- func (r *Report) GetResult() (ret ReportResult, err error)
- func (r *Report) LoseVariance() float64
- func (r *Report) MaxDrawdown() float64
- func (r *Report) MaxDrawdownValue() float64
- func (r *Report) MaxLose() (lose float64)
- func (r *Report) OnBalanceInit(balance, fee float64) (err error)
- func (r *Report) OnTrade(t Trade)
- func (r *Report) Profit() (profit float64)
- func (r *Report) ProfitLoseRatio() float64
- func (r *Report) ProfitPercent() float64
- func (r *Report) ProfitVariance() float64
- func (r *Report) ProvideResult() (any, error)
- func (r *Report) SetFee(fee float64)
- func (r *Report) SetLever(lever float64)
- func (r *Report) SetTimeRange(start, end time.Time)
- func (r *Report) WinRate() (rate float64)
- type ReportResult
- type RptAct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Report ¶
type Report struct {
// contains filtered or unexported fields
}
func NewReportSimple ¶
func NewReportSimple() *Report
func (*Report) CalculateEquityCurve ¶ added in v0.3.3
CalculateEquityCurve 计算净值曲线
func (*Report) CalculateMetrics ¶ added in v0.3.3
func (r *Report) CalculateMetrics(metrics *ReportResult) (err error)
CalculateMetrics 计算所有指标
func (*Report) EndBalance ¶ added in v0.1.3
func (*Report) ExportToDB ¶ added in v0.1.2
func (*Report) GenHTMLReport ¶
func (*Report) GetResult ¶ added in v0.0.5
func (r *Report) GetResult() (ret ReportResult, err error)
func (*Report) LoseVariance ¶ added in v0.2.1
func (*Report) MaxDrawdown ¶
MaxDrawdown get max drawdown percent
func (*Report) MaxDrawdownValue ¶
MaxDrawdown get max drawdown value
func (*Report) OnBalanceInit ¶
func (*Report) ProfitLoseRatio ¶ added in v0.1.2
func (*Report) ProfitPercent ¶ added in v0.1.3
func (*Report) ProfitVariance ¶ added in v0.2.1
func (*Report) ProvideResult ¶ added in v0.3.3
ProvideResult implements rpt.ResultProvider interface.
func (*Report) SetTimeRange ¶ added in v0.3.3
SetTimeRange set time range for report
type ReportResult ¶ added in v0.0.5
type ReportResult struct {
TotalAction int // 总开单次数
WinRate float64 // 胜率
TotalProfit float64 // 总收益
MaxLose float64 // 最大单次亏损百分比
MaxDrawdown float64 // 最大回撤百分比
MaxDrawdownValue float64 // 最大回撤值
TotalFee float64 // 总手续费
StartBalance float64 // 起始余额
EndBalance float64 // 结束余额
ProfitPercent float64 // 收益率
ProfitVariance float64 // 盈利方差
LoseVariance float64 // 亏损方差
TotalReturn float64 // 总收益率
AnnualReturn float64 // 年化收益率
SharpeRatio float64 // 夏普比率
SortinoRatio float64 // 索提诺比率
Volatility float64 // 年化波动率
ProfitFactor float64 // 盈亏比
CalmarRatio float64 // 卡玛比率
ConsistencyScore float64 // 连续性得分
SmoothnessScore float64 // 平滑性得分
OverallScore float64 // 综合得分
LongTrades int // 做多次数
ShortTrades int // 做空次数
Actions []*RptAct `json:"-"` // 所有的操作记录
}
Click to show internal directories.
Click to hide internal directories.