Documentation ¶
Overview ¶
Package models 定义数据库 model
Index ¶
- Constants
- type ExportorData
- type ExportorDataList
- type Fund
- type FundAssetsProportion
- type FundDividend
- type FundIndustryProportion
- type FundList
- type FundManager
- type FundMaxRetracement
- type FundPerformance
- type FundSharp
- type FundSortType
- type FundStddev
- type FundStock
- type ParamFundListFilter
- type Stock
- type StockList
Constants ¶
View Source
const ( // FundSortTypeWeek 按最近一周收益率排序 FundSortTypeWeek = iota // FundSortTypeMonth1 按最近一月收益率排序 FundSortTypeMonth1 // FundSortTypeMonth3 按最新三月收益率排序 FundSortTypeMonth3 // FundSortTypeMonth6 按最新六月收益率排序 FundSortTypeMonth6 // FundSortTypeYear1 按最近一年收益率排序 FundSortTypeYear1 // FundSortTypeYear2 按最近两年收益率排序 FundSortTypeYear2 // FundSortTypeYear3 按最近三年收益率排序 FundSortTypeYear3 // FundSortTypeYear5 按最近五年收益率排序 FundSortTypeYear5 // FundSortTypeThisYear 按今年来收益率排序 FundSortTypeThisYear // FundSortTypeHistorical 按成立来收益率排序 FundSortTypeHistorical // FundSortTypeStddev135Avg 按1,3,5年波动率平均值排序 FundSortTypeStddev135Avg // FundSortTypeMaxRetr135Avg 按1,3,5年最大回撤率平均值排序 FundSortTypeMaxRetr135Avg // FundSortTypeSharp135Avg 按1,3,5年夏普比率平均值排序 FundSortTypeSharp135Avg )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExportorData ¶
type ExportorData struct { // 股票名 Name string `json:"name" csv:"股票名"` // 股票代码 Code string `json:"code" csv:"股票代码"` // 所属行业 Industry string `json:"industry" csv:"所属行业"` // 题材关键词 // Keywords string `json:"keywords" csv:"题材关键词"` // 公司信息 // CompanyProfile string `json:"company_profile" csv:"公司信息"` // 主营构成 MainForms string `json:"main_forms" csv:"主营构成"` // 本业营收比 // BYYSRatio float64 `json:"byys_ration" csv:"本业营收比"` // 财报年份-类型 // ReportDateName string `json:"report_date_name" csv:"数据源"` // 财报审计意见 // ReportOpinion interface{} `json:"report_opinion" csv:"财报审计意见"` // 价值评估 JZPG string `json:"jzpg" csv:"价值评估"` // 当前 ROE // LatestROE float64 `json:"latest_roe" csv:"当前 ROE"` // 最近财报 ROE // LatestFinaROE float64 `json:"latest_fina_roe" csv:"最新财报 ROE"` // ROE 同比增长 // ROETBZZ float64 `json:"roe_tbzz" csv:"ROE 同比增长 (%)"` // 近五年 ROE ROE5Y []float64 `json:"roe_5y" csv:"近五年 ROE"` // 最新一期 EPS // LatestEPS float64 `json:"latest_eps" csv:"最新一期 EPS"` // EPS 同比增长 // EPSTBZZ float64 `json:"eps_tbzz" csv:"EPS 同比增长 (%)"` // 近五年 EPS EPS5Y []float64 `json:"eps_5y" csv:"近五年 EPS"` // 营业总收入 TotalIncome interface{} `json:"total_income" csv:"营业总收入"` // 营业总收入同比增长 TotalIncomeTBZZ float64 `json:"total_income_tbzz" csv:"营业总收入同比增长 (%)"` // 近五年营收 TotalIncome5Y []string `json:"total_income_5y" csv:"近五年营收"` // 归属净利润 NetProfit interface{} `json:"net_profit" csv:"归属净利润(元)"` // 归属净利润同比增长 (%) NetProfitTBZZ float64 `json:"net_profit_tbzz" csv:"归属净利润同比增长 (%)"` // 近五年净利润 NetProfit5Y []string `json:"net_profit_5y" csv:"近五年净利润"` // 最新股息率 (%) ZXGXL float64 `json:"zxgxl" csv:"最新股息率 (%)"` // 财报披露日期 // FinaReportDate string `json:"fina_report_date" csv:"财报披露日期"` // 预约财报披露日期 // FinaAppointPublishDate string `json:"fina_appoint_publish_date" csv:"预约财报披露日期"` // 实际财报披露日期 // FinaActualPublishDate string `json:"fina_actual_publish_date" csv:"实际财报披露日期"` // 总市值(字符串) TotalMarketCap interface{} `json:"total_market_cap" csv:"总市值"` // 当时价格 Price float64 `json:"price" csv:"价格"` // 估算合理价格 RightPrice interface{} `json:"right_price" csv:"估算合理价格"` // 合理价格与当时价的价格差(%) // PriceSpace interface{} `json:"price_space" csv:"合理价差"` // 历史波动率 // HV float64 `json:"hv" csv:"历史波动率"` // 最新负债率 (%) ZXFZL float64 `json:"zxfzl" csv:"最新负债率 (%)"` // 负债流动比 FZLDB float64 `json:"fzldb" csv:"负债流动比"` // 净利润 3 年复合增长率 (%) // NetprofitGrowthrate3Y float64 `json:"netprofit_growthrate_3_y" csv:"净利润 3 年复合增长率 (%)"` // 营收 3 年复合增长率 (%) // IncomeGrowthrate3Y float64 `json:"income_growthrate_3_y" csv:"营收 3 年复合增长率 (%)"` // 上市以来年化收益率 (%) ListingYieldYear float64 `json:"listing_yield_year" csv:"上市以来年化收益率 (%)"` // 上市以来年化波动率 (%) // ListingVolatilityYear float64 `json:"listing_volatility_year" csv:"年化波动率 (%)"` // 市盈率 PE float64 `json:"pe" csv:"市盈率"` // PEG PEG float64 `json:"peg" csv:"PEG"` // 机构评级 // OrgRating string `json:"org_rating" csv:"机构评级"` // 盈利预测 ProfitPredict string `json:"profit_predict" csv:"盈利预测"` // 市盈率估值 // ValuationSYL string `json:"valuation_syl" csv:"市盈率估值"` // 市净率估值 // ValuationSJL string `json:"valuation_sjl" csv:"市净率估值"` // 市销率估值 // ValuationSXOL string `json:"valuation_sxol" csv:"市销率估值"` // 市现率估值 // ValuationSXNL string `json:"valuation_sxnl" csv:"市现率估值"` // 行业均值水平 HYJZSP string `json:"hyjzsp" csv:"行业均值水平"` // 整体质地 // ZTZD string `json:"ztzd" csv:"整体质地"` // 近五年毛利率 MLL5Y []float64 `json:"mll_5y" csv:"近五年毛利率"` // 近五年净利率 JLL5Y []float64 `json:"jll_5y" csv:"近五年净利率"` // 上市时间 ListingDate string `json:"listing_date" csv:"上市时间"` // 最新经营活动产生的现金流量净额 NetcashOperate string `json:"netcash_operate" csv:"经营现金流净额"` // 最新投资活动产生的现金流量净额 NetcashInvest string `json:"netcash_invest" csv:"投资现金流净额"` // 最新筹资活动产生的现金流量净额 NetcashFinance string `json:"netcash_finance" csv:"筹资现金流净额"` // 自由现金流 NetcashFree string `json:"netcash_free" csv:"自由现金流"` // 十大流通股东 FreeHoldersTop10 string `json:"free_holders_top_10" csv:"十大流通股东"` }
ExportorData 数据模板
func NewExportorData ¶
func NewExportorData(ctx context.Context, stock Stock) ExportorData
NewExportorData 创建 ExportotData 对象
func (ExportorData) GetHeaderValueMap ¶
func (d ExportorData) GetHeaderValueMap() map[string]interface{}
GetHeaderValueMap 获取以 csv tag 为 key 的 Data map
func (ExportorData) GetHeaders ¶
func (d ExportorData) GetHeaders() []string
GetHeaders 获取 csv tag 列表
type ExportorDataList ¶
type ExportorDataList []ExportorData
ExportorDataList 要导出的数据列表
func NewExportorDataList ¶
func NewExportorDataList(ctx context.Context, stocks StockList) (result ExportorDataList)
NewExportorDataList 创建要导出的数据列表
func (ExportorDataList) ChunkedBySize ¶
func (d ExportorDataList) ChunkedBySize(chunkSize int) []ExportorDataList
ChunkedBySize 将 stock 列表按大小切割分组
func (ExportorDataList) GetIndustryList ¶
func (d ExportorDataList) GetIndustryList() []string
GetIndustryList 获取行业分类列表
func (ExportorDataList) SortByZXGXL ¶
func (d ExportorDataList) SortByZXGXL()
SortByZXGXL 股票列表按最新股息率排序
type Fund ¶
type Fund struct { // 基金代码 Code string `json:"code"` // 基金名称 Name string `json:"name"` // 基金类型 Type string `json:"type"` // 成立时间 EstablishedDate string `json:"established_date"` // 最新基金净资产规模(元) NetAssetsScale float64 `json:"net_assets_scale"` // 跟踪标的代码 IndexCode string `json:"index_code"` // 跟踪标的名称 IndexName string `json:"index_name"` // 购买费率 Rate string `json:"rate"` // 定投状态 FixedInvestmentStatus string `json:"fixed_investment_status"` // 波动率 Stddev FundStddev `json:"stddev"` // 最大回撤率 MaxRetracement FundMaxRetracement `json:"max_retracement"` // 夏普比率 Sharp FundSharp `json:"sharp"` // 绩效 Performance FundPerformance `json:"performance"` // 持仓股票 Stocks []FundStock `json:"stocks"` // 基金经理 Manager FundManager `json:"manager"` // 历史分红送配 HistoricalDividends []FundDividend `json:"historical_dividends"` // 资产占比 AssetsProportion FundAssetsProportion `json:"assets_proportion"` // 行业占比 IndustryProportions []FundIndustryProportion `json:"industry_proportions"` }
Fund 基金
func NewFund ¶
func NewFund(ctx context.Context, efund *eastmoney.RespFundInfo) *Fund
NewFund 创建 Fund 实例
func (Fund) NetAssetsScaleHuman ¶
NetAssetsScaleHuman 净资产数字转换为亿、万单位
type FundAssetsProportion ¶
type FundAssetsProportion struct { // 公布日期 PubDate string `json:"pub_date"` // 股票占比(%) Stock string `json:"stock"` // 债券占比(%) Bond string `json:"bond"` // 现金占比(%) Cash string `json:"cash"` // 其他占比(%) Other string `json:"other"` // 净资产(亿元) NetAssets string `json:"net_assets"` }
FundAssetsProportion 资产占比
type FundDividend ¶
type FundDividend struct { // 权益登记日 RegDate string `json:"reg_date"` // 每份分红(元) Value float64 `json:"value"` // 分红发放日 RationDate string `json:"ration_date"` }
FundDividend 分红送配
type FundIndustryProportion ¶
type FundIndustryProportion struct { // 公布日期 PubDate string `json:"pub_date"` // 行业名 Industry string `json:"industry"` // 对应占比列表(%) Prop string `json:"prop"` }
FundIndustryProportion 行业占比
type FundList ¶
type FundList []*Fund
FundList list
func (FundList) Filter ¶
func (f FundList) Filter(ctx context.Context, p ParamFundListFilter) FundList
Filter 按参数过滤
func (FundList) FilterByType ¶
FilterByType 按 type 字段过滤
type FundManager ¶
type FundManager struct { // ID ID string `json:"id"` // 基金经理名字 Name string `json:"name"` // 从业时间(天) WorkingDays float64 `json:"working_days"` // 管理该基金时间(天) ManageDays float64 `json:"manage_days"` // 任职回报(%) ManageRepay float64 `json:"manage_repay"` // 年均回报(%) YearsAvgRepay float64 `json:"years_avg_repay"` }
FundManager 基金经理
type FundMaxRetracement ¶
type FundMaxRetracement struct { // 近1年最大回撤(%) Year1 float64 `json:"year_1"` // 近3年最大回撤(%) Year3 float64 `json:"year_3"` // 近5年最大回撤(%) Year5 float64 `json:"year_5"` // 1,3,5年均值 Avg135 float64 `json:"avg_135"` }
FundMaxRetracement 最大回撤
type FundPerformance ¶
type FundPerformance struct { // 近一周收益率 WeekProfitRatio float64 `json:"week_profit_ratio"` // 近一周涨跌幅 WeekAmplitude float64 `json:"week_amplitude"` // 近一周同类均值 WeekKindAvg float64 `json:"week_kind_avg"` // 近一周同类排名 WeekRankNum float64 `json:"week_rank_num"` // 近一周同类排名百分比 WeekRankRatio float64 `json:"week_rank_ratio"` // 近一周同类总数 WeekRankTotalCount float64 `json:"week_rank_total_count"` // 近一月收益率 Month1ProfitRatio float64 `json:"month_1_profit_ratio"` // 近一月涨跌幅 Month1Amplitude float64 `json:"month_1_amplitude"` // 近一月同类均值 Month1KindAvg float64 `json:"month_1_kind_avg"` // 近一月同类排名 Month1RankNum float64 `json:"month_1_rank_num"` // 近一月同类排名百分比 Month1RankRatio float64 `json:"month_1_rank_ratio"` // 近一月同类总数 Month1RankTotalCount float64 `json:"month_1_rank_total_count"` // 近三月收益率 Month3ProfitRatio float64 `json:"month_3_profit_ratio"` // 近三月涨跌幅 Month3Amplitude float64 `json:"month_3_amplitude"` // 近三月同类均值 Month3KindAvg float64 `json:"month_3_kind_avg"` // 近三月同类排名 Month3RankNum float64 `json:"month_3_rank_num"` // 近三月同类排名百分比 Month3RankRatio float64 `json:"month_3_rank_ratio"` // 近三月同类总数 Month3RankTotalCount float64 `json:"month_3_rank_total"` // 近六月收益率 Month6ProfitRatio float64 `json:"month_6_profit_ratio"` // 近六月涨跌幅 Month6Amplitude float64 `json:"month_6_amplitude"` // 近六月同类均值 Month6KindAvg float64 `json:"month_6_kind_avg"` // 近六月同类排名 Month6RankNum float64 `json:"month_6_rank_num"` // 近六月同类排名百分比 Month6RankRatio float64 `json:"month_6_rank_ratio"` // 近六月同类总数 Month6RankTotalCount float64 `json:"month_6_rank_total_count"` // 近一年收益率 Year1ProfitRatio float64 `json:"year_1_profit_ratio"` // 近一年涨跌幅 Year1Amplitude float64 `json:"year_1_amplitude"` // 近一年同类均值 Year1KindAvg float64 `json:"year_1_kind_avg"` // 近一年同类排名 Year1RankNum float64 `json:"year_1_rank_num"` // 近一年同类排名百分比 Year1RankRatio float64 `json:"year_1_rank_ratio"` // 近一年同类总数 Year1RankTotalCount float64 `json:"year_1_rank_total_count"` // 近两年收益率 Year2ProfitRatio float64 `json:"year_2_profit_ratio"` // 近两年涨跌幅 Year2Amplitude float64 `json:"year_2_amplitude"` // 近两年同类均值 Year2KindAvg float64 `json:"year_2_kind_avg"` // 近两年同类排名 Year2RankNum float64 `json:"year_2_rank_num"` // 近两年同类排名百分比 Year2RankRatio float64 `json:"year_2_rank_ratio"` // 近两年同类总数 Year2RankTotalCount float64 `json:"year_2_rank_total_count"` // 近三年收益率 Year3ProfitRatio float64 `json:"year_3_profit_ratio"` // 近三年涨跌幅 Year3Amplitude float64 `json:"year_3_amplitude"` // 近三年同类均值 Year3KindAvg float64 `json:"year_3_kind_avg"` // 近三年同类排名 Year3RankNum float64 `json:"year_3_rank_num"` // 近三年同类排名百分比 Year3RankRatio float64 `json:"year_3_rank_ratio"` // 近三年同类总数 Year3RankTotalCount float64 `json:"year_3_rank_total_count"` // 近五年收益率 Year5ProfitRatio float64 `json:"year_5_profit_ratio"` // 近五年涨跌幅 Year5Amplitude float64 `json:"year_5_amplitude"` // 近五年同类均值 Year5KindAvg float64 `json:"year_5_kind_avg"` // 近五年同类排名 Year5RankNum float64 `json:"year_5_rank_num"` // 近五年同类排名百分比 Year5RankRatio float64 `json:"year_5_rank_ratio"` // 近五年同类总数 Year5RankTotalCount float64 `json:"year_5_rank_total_count"` // 今年来收益率 ThisYearProfitRatio float64 `json:"this_year_profit_ratio"` // 今年来涨跌幅 ThisYearAmplitude float64 `json:"this_year_amplitude"` // 今年来同类均值 ThisYearKindAvg float64 `json:"this_year_kind_avg"` // 今年来同类排名 ThisYearRankNum float64 `json:"this_year_rank_num"` // 今年来同类排名百分比 ThisYearRankRatio float64 `json:"this_year_rank_ratio"` // 今年来同类总数 ThisYearRankTotalCount float64 `json:"this_year_rank_total_count"` // 成立以来收益率 HistoricalProfitRatio float64 `json:"historical_profit_ratio"` // 成立以来涨跌幅 HistoricalAmplitude float64 `json:"historical_amplitude"` // 成立以来同类均值 HistoricalKindAvg float64 `json:"historical_kind_avg"` // 成立以来同类排名 HistoricalRankNum float64 `json:"historical_rank_num"` // 成立以来同类排名百分比 HistoricalRankRatio float64 `json:"historical_rank_ratio"` // 成立以来同类总数 HistoricalRankTotalCount float64 `json:"historical_rank_total_count"` }
FundPerformance 基金绩效
type FundSharp ¶
type FundSharp struct { // 近1年夏普比率 Year1 float64 `json:"year_1"` // 近3年夏普比率 Year3 float64 `json:"year_3"` // 近5年夏普比率 Year5 float64 `json:"year_5"` // 1,3,5年均值 Avg135 float64 `json:"avg_135"` }
FundSharp 夏普比率
type FundStddev ¶
type FundStddev struct { // 近1年波动率(%) Year1 float64 `json:"year_1"` // 近3年波动率(%) Year3 float64 `json:"year_3"` // 近5年波动率(%) Year5 float64 `json:"year_5"` // 1,3,5年均值 Avg135 float64 `json:"avg_135"` }
FundStddev 波动率
type FundStock ¶
type FundStock struct { // 股票代码 Code string `json:"code"` // 股票名称 Name string `json:"name"` // 交易所代号 ExCode string `json:"ex_code"` // 股票行业 Industry string `json:"industry"` // 持仓占比(%) HoldRatio float64 `json:"hold_ratio"` // 较上期调仓比例 AdjustRatio float64 `json:"adjust_ratio"` }
FundStock 基金持仓股票
type ParamFundListFilter ¶
type ParamFundListFilter struct { // 类型 Types []string `json:"types" form:"types"` // 基金规模最小值(亿) MinScale float64 `json:"min_scale" form:"min_scale"` // 基金规模最大值(亿) MaxScale float64 `json:"max_scale" form:"max_scale"` // 基金经理管理该基金最低年限 MinManagerYears float64 `json:"min_manager_years" form:"min_manager_years"` // 最近一年收益率排名比 Year1RankRatio float64 `json:"year_1_rank_ratio" form:"year_1_rank_ratio"` // 今年来、最近两年、最近三年、最近五年收益率排名比 ThisYear235RankRatio float64 `json:"this_year_235_rank_ratio" form:"this_year_235_rank_ratio"` // 最近六月收益率排名比 Month6RankRatio float64 `json:"month_6_rank_ratio" form:"month_6_rank_ratio"` // 最近三月收益率排名比 Month3RankRatio float64 `json:"month_3_rank_ratio" form:"month_3_rank_ratio"` // 1,3,5年波动率平均值的最大值 Max135AvgStddev float64 `json:"max_135_avg_stddev" form:"max_135_avg_stddev"` // 1,3,5年夏普比率平均值的最小值 Min135AvgSharp float64 `json:"min_135_avg_sharp" form:"min_135_avg_sharp"` // 1,3,5年最大回撤率平均值的最大值 Max135AvgRetr float64 `json:"max_135_avg_retr" form:"max_135_avg_retr"` // 最低成立年限 MinEstabYears float64 `json:"min_estab_years" form:"min_estab_years"` }
ParamFundListFilter Filter 参数
type Stock ¶
type Stock struct { // 东方财富接口返回的基本信息 BaseInfo eastmoney.StockInfo `json:"base_info"` // 历史财报信息 HistoricalFinaMainData eastmoney.HistoricalFinaMainData `json:"historical_fina_main_data"` // 市盈率、市净率、市销率、市现率估值 ValuationMap map[string]string `json:"valuation_map"` // 历史市盈率 HistoricalPEList eastmoney.HistoricalPEList `json:"historical_pe_list"` // 合理价格:历史市盈率中位数 * (去年EPS * (1 + 今年 Q1 营收增长比)) RightPrice float64 `json:"right_price"` // 历史股价 HistoricalPrice eniu.RespHistoricalStockPrice `json:"historical_price"` // 历史波动率 HistoricalVolatility float64 `json:"historical_volatility"` // 公司资料 CompanyProfile eastmoney.CompanyProfile `json:"company_profile"` // 预约财报披露日期 FinaAppointPublishDate string `json:"fina_appoint_publish_date"` // 实际财报披露日期 FinaActualPublishDate string `json:"fina_actual_publish_date"` // 财报披露日期 FinaReportDate string `json:"fina_report_date"` // 机构评级 OrgRatingList eastmoney.OrgRatingList `json:"org_rating_list"` // 盈利预测 ProfitPredictList eastmoney.ProfitPredictList `json:"profit_predict_list"` // 价值评估 JZPG eastmoney.JZPG `json:"jzpg"` // PEG=PE/净利润复合增长率 PEG float64 `json:"peg"` // 历史利润表 HistoricalGincomeList eastmoney.GincomeDataList `json:"historical_gincome_list"` // 本业营收比=营业利润/(营业利润+营业外收入) BYYSRatio float64 `json:"byys_ratio"` // 最新财报审计意见 FinaReportOpinion string `json:"fina_report_opinion"` // 历史现金流量表 HistoricalCashflowList eastmoney.CashflowDataList `json:"historical_cashdlow_list"` // 最新经营活动产生的现金流量净额 NetcashOperate float64 `json:"netcash_operate"` // 最新投资活动产生的现金流量净额 NetcashInvest float64 `json:"netcash_invest"` // 最新筹资活动产生的现金流量净额 NetcashFinance float64 `json:"netcash_finance"` // 自由现金流 NetcashFree float64 `json:"netcash_free"` // 十大流通股东 FreeHoldersTop10 eastmoney.FreeHolderList `json:"free_holders_top_10"` // 主力资金净流入 MainMoneyNetInflows zszx.NetInflowList `json:"main_money_net_inflows"` }
Stock 接口返回的股票信息结构
Click to show internal directories.
Click to hide internal directories.