Skip to content

Commit

Permalink
移除内在价值,参考意义不大
Browse files Browse the repository at this point in the history
  • Loading branch information
axiaoxin committed Nov 25, 2021
1 parent 86ccc94 commit a6045d6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
3 changes: 1 addition & 2 deletions core/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,10 @@ func (c Checker) CheckFundamentals(ctx context.Context, stock models.Stock) (res
itemOK = true
price := stock.GetPrice()
desc = fmt.Sprintf(
"最新股价:%f</br>合理价:%.2f(%.2f%%)</br>内在价值:%.2f</br>去年合理价:%.2f,去年实际价格:%.2f",
"最新股价:%f</br>合理价:%.2f(%.2f%%)</br>去年合理价:%.2f,去年实际价格:%.2f",
price,
stock.RightPrice,
stock.PriceSpace,
stock.IntrinsicalValue,
stock.LastYearRightPrice,
stock.HistoricalPrice.LastYearFinalPrice(),
)
Expand Down
19 changes: 17 additions & 2 deletions datacenter/eastmoney/fina_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ func (h HistoricalFinaMainData) MidValue(
return goutils.MidValueFloat64(data)
}

// GetAvgRevenueIncreasingRatioByYear 获取指定年内已发布的各期财报的平均营收增长比 (%)
// GetAvgRevenueIncreasingRatioByYear 获取指定年内已发布的各期财报的平均营收同比增长比 (%)
func (h HistoricalFinaMainData) GetAvgRevenueIncreasingRatioByYear(ctx context.Context, year int) float64 {
data := h.FilterByReportYear(ctx, year)
dlen := len(data)
Expand All @@ -391,7 +391,7 @@ func (h HistoricalFinaMainData) GetAvgRevenueIncreasingRatioByYear(ctx context.C
return sum / float64(dlen)
}

// GetAvgEpsIncreasingRatioByYear 获取指定年内已发布的各期财报的平均EPS增长比 (%)
// GetAvgEpsIncreasingRatioByYear 获取指定年内已发布的各期财报的平均EPS同比增长比 (%)
func (h HistoricalFinaMainData) GetAvgEpsIncreasingRatioByYear(ctx context.Context, year int) float64 {
data := h.FilterByReportYear(ctx, year)
dlen := len(data)
Expand All @@ -406,6 +406,21 @@ func (h HistoricalFinaMainData) GetAvgEpsIncreasingRatioByYear(ctx context.Conte
return sum / float64(dlen)
}

// GetAvgParentNetprofitIncreasingRatioByYear 获取指定年内已发布的各期财报的平均归属净利润同比增长比 (%)
func (h HistoricalFinaMainData) GetAvgParentNetprofitIncreasingRatioByYear(ctx context.Context, year int) float64 {
data := h.FilterByReportYear(ctx, year)
dlen := len(data)
if dlen == 0 {
return 0
}
sum := 0.0
for _, d := range data {
sum += d.Parentnetprofittz
}

return sum / float64(dlen)
}

// RespFinaMainData 接口返回 json 结构
type RespFinaMainData struct {
Version string `json:"version"`
Expand Down
3 changes: 0 additions & 3 deletions models/exportor_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ type ExportorData struct {
RightPrice interface{} `json:"right_price" csv:"估算合理价格"`
// 合理价格与当时价的价格差(%)
PriceSpace interface{} `json:"price_space" csv:"合理价差"`
// 内在价值
IntrinsicalValue float64 `json:"intrinsical_value" csv:"内在价值"`
// 历史波动率
HV float64 `json:"hv" csv:"历史波动率"`
// 最新负债率 (%)
Expand Down Expand Up @@ -219,7 +217,6 @@ func NewExportorData(ctx context.Context, stock Stock) ExportorData {
Price: stock.GetPrice(),
RightPrice: rightPrice,
PriceSpace: priceSpace,
IntrinsicalValue: stock.IntrinsicalValue,
HV: stock.HistoricalVolatility,
ListingVolatilityYear: stock.BaseInfo.ListingVolatilityYear,
ZXFZL: fina.Zcfzl,
Expand Down
7 changes: 0 additions & 7 deletions models/stock.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ type Stock struct {
HistoricalPEList eastmoney.HistoricalPEList `json:"historical_pe_list"`
// 合理价格(年报):历史市盈率中位数 * (去年EPS * (1 + 今年各期财报的平均营收增长比))
RightPrice float64 `json:"right_price"`
// 格雷厄姆内在价值
IntrinsicalValue float64 `json:"intrinsical_value"`
// 合理价差(%)
PriceSpace float64 `json:"price_space"`
// 按前年年报算去年的合理价格:历史市盈率中位数 * (前年EPS * (1 + 去年各期财报的平均营收增长比))
Expand Down Expand Up @@ -170,11 +168,6 @@ func NewStock(ctx context.Context, baseInfo eastmoney.StockInfo) (Stock, error)
beforeLastYearReport := s.HistoricalFinaMainData.GetReport(ctx, time.Now().Year()-2, eastmoney.FinaReportTypeYear)
lastYearAvgRevIncrRatio := s.HistoricalFinaMainData.GetAvgRevenueIncreasingRatioByYear(ctx, thisYear-1)
s.LastYearRightPrice = peMidVal * (beforeLastYearReport.Epsjb * (1 + lastYearAvgRevIncrRatio/100.0))
// 内在价值 E*(2r+8.5)*4.4/Y
if AAACompanyBondSyl != 0 {
thisYearAvgEpsIncrRatio := s.HistoricalFinaMainData.GetAvgEpsIncreasingRatioByYear(ctx, thisYear)
s.IntrinsicalValue = lastYearReport.Epsjb * (2*thisYearAvgEpsIncrRatio + 8.5) * 4.4 / AAACompanyBondSyl
}
}(ctx, &s)

// 获取综合估值
Expand Down
1 change: 1 addition & 0 deletions statics/html/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ <h5 class="header">关于网站</h5>
<h5 class="header">InvesTool 解决什么问题?</h5>
<p>InvesTool 要解决的问题是,在使用东方财富选股器按设置的条件筛选出股票后,通常筛选出的股票数量较多,需要人工对每一支股票的财报指标进行分析以判断是否值得投资。</p>
<p>需要分析的指标较多,并且有一些指标无法直接获取,需要进行计算或根据历史财务数据进行计算,在大量股票需要分析的时候这是一个繁琐的工作,因此开发了 InvesTool 来让这个过程自动化。</p>
<p>如果本网站对您有帮助,您喜欢的话,请帮忙多多点击网站上的广告,感谢!</p>
</div>

<div>
Expand Down

0 comments on commit a6045d6

Please sign in to comment.