report

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

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 NewReport

func NewReport(trades []Trade, balanceInit float64) *Report

func NewReportSimple

func NewReportSimple() *Report

func (*Report) Analyzer

func (r *Report) Analyzer() (err error)

func (*Report) EndBalance added in v0.1.3

func (r *Report) EndBalance() float64

func (*Report) ExportToDB added in v0.1.2

func (r *Report) ExportToDB(dbPath string) (err error)

func (*Report) GenHTML

func (r *Report) GenHTML(w io.Writer) (err error)

func (*Report) GenHTMLReport

func (r *Report) GenHTMLReport(fPath string) (err error)

func (*Report) GenRPT

func (r *Report) GenRPT(fPath string) (err error)

func (*Report) GetReport

func (r *Report) GetReport() (report string)

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 (r *Report) LoseVariance() float64

func (*Report) MaxDrawdown

func (r *Report) MaxDrawdown() float64

MaxDrawdown get max drawdown percent

func (*Report) MaxDrawdownValue

func (r *Report) MaxDrawdownValue() float64

MaxDrawdown get max drawdown value

func (*Report) MaxLose

func (r *Report) MaxLose() (lose float64)

MaxLose max total lose

func (*Report) OnBalanceInit

func (r *Report) OnBalanceInit(balance, fee float64) (err error)

func (*Report) OnTrade

func (r *Report) OnTrade(t Trade)

func (*Report) Profit

func (r *Report) Profit() (profit float64)

func (*Report) ProfitLoseRatio added in v0.1.2

func (r *Report) ProfitLoseRatio() float64

func (*Report) ProfitPercent added in v0.1.3

func (r *Report) ProfitPercent() float64

func (*Report) ProfitVariance added in v0.2.1

func (r *Report) ProfitVariance() float64

func (*Report) SetFee added in v0.0.5

func (r *Report) SetFee(fee float64)

func (*Report) SetLever added in v0.2.1

func (r *Report) SetLever(lever float64)

func (*Report) WinRate

func (r *Report) WinRate() (rate float64)

type ReportResult added in v0.0.5

type ReportResult struct {
	TotalAction      int
	WinRate          float64
	Profit           float64
	MaxLose          float64
	MaxDrawdown      float64
	MaxDrawDownValue float64
	Actions          []*RptAct `json:"-"`
	TotalFee         float64
	StartBalance     float64
	EndBalance       float64
	ProfitPercent    float64
	ProfitVariance   float64
	LoseVariance     float64
}

type RptAct added in v0.0.5

type RptAct struct {
	Trade       `xorm:"extends"`
	Total       float64
	TotalProfit float64 // total profit,sum of all history profits,if action is open, total profit is zero
	Profit      float64 // profit, if action is open, profit is zero
	Fee         float64
	IsFinish    bool
}

Jump to

Keyboard shortcuts

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