Documentation ¶
Index ¶
- Constants
- func Analyse(_ context.Context, assets *v1.Assets, opts Options) (report.Report, error)
- type CheckpointReport
- type Goods
- type Options
- type Report
- func (r *Report) AddGoodsInfo(goodsInfos ...v1.GoodsInfo)
- func (r *Report) AllGoods() []Goods
- func (r *Report) Checkpoints() []CheckpointReport
- func (r *Report) Complete() error
- func (r *Report) GoodsInfo(name string) (v1.GoodsInfo, bool)
- func (r *Report) HoldingGoods() []Goods
- func (r *Report) Risks() []Goods
- func (r *Report) Text(w io.Writer, opts report.TextOptions) error
- func (r *Report) TotalProfitAndLoss() (profitAndLoss, rateOfReturn, annualizedRateOfReturn decimal.Decimal)
- func (r *Report) TotalValue() decimal.Decimal
Constants ¶
View Source
const (
InternalBaseGoods = "InternalBaseGoods"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CheckpointReport ¶
CheckpointReport 检查点报告
func (*CheckpointReport) Complete ¶
func (r *CheckpointReport) Complete(lastCheckpoint *CheckpointReport) error
Complete 补充完成
type Goods ¶
type Goods struct { // 商品名 Name string `json:"name" yaml:"name"` // 代号 Code string `json:"code,omitempty" yaml:"code,omitempty"` // 托管机构 Custodian string `json:"custodian,omitempty" yaml:"custodian,omitempty"` // 数量 Quantity decimal.Decimal `json:"quantity" yaml:"quantity"` // 单价 Price decimal.Decimal `json:"price" yaml:"price"` // 风险 Risk v1.RiskLevel `json:"risk,omitempty" yaml:"risk,omitempty"` // 总价值 Value decimal.Decimal `json:"value,omitempty" yaml:"value,omitempty"` // 占比 Ratio decimal.Decimal `json:"ratio,omitempty" yaml:"ratio,omitempty"` // 损益 ProfitAndLoss decimal.Decimal `json:"profitAndLoss,omitempty" yaml:"profitAndLoss,omitempty"` // 收益率 RateOfReturn decimal.Decimal `json:"rateOfReturn,omitempty" yaml:"rateOfReturn,omitempty"` // 年化收益率 AnnualizedRateOfReturn decimal.Decimal `json:"annualizedRateOfReturn,omitempty" yaml:"annualizedRateOfReturn,omitempty"` // 是否基础商品(货币) Base bool `json:"base,omitempty" yaml:"base,omitempty"` // 是否忽略收益 IgnoreReturn bool `json:"ignoreReturn,omitempty" yaml:"ignoreReturn,omitempty"` // contains filtered or unexported fields }
Goods 商品
type Report ¶
type Report struct {
// contains filtered or unexported fields
}
Report 资产报告
func (*Report) AddGoodsInfo ¶
AddGoodsInfo 添加商品信息
func (*Report) Checkpoints ¶
func (r *Report) Checkpoints() []CheckpointReport
Checkpoints 返回所有检查点报告
func (*Report) TotalProfitAndLoss ¶
func (r *Report) TotalProfitAndLoss() (profitAndLoss, rateOfReturn, annualizedRateOfReturn decimal.Decimal)
TotalProfitAndLoss 返回总体损益情况
Click to show internal directories.
Click to hide internal directories.