Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Eniu ¶
Eniu 亿牛网数据源
func (Eniu) GetPathCode ¶
GetPathCode 返回接口 url path 中的股票代码
func (Eniu) QueryHistoricalStockPrice ¶
func (e Eniu) QueryHistoricalStockPrice(ctx context.Context, secuCode string) (RespHistoricalStockPrice, error)
QueryHistoricalStockPrice 获取历史股价,最新数据在最后,有一天的延迟
type RespHistoricalStockPrice ¶
RespHistoricalStockPrice 历史股价接口返回结构
func (RespHistoricalStockPrice) HistoricalVolatility ¶
func (p RespHistoricalStockPrice) HistoricalVolatility(ctx context.Context, period string) (float64, error)
HistoricalVolatility 计算历史波动率 历史波动率计算方法:https://goodcalculators.com/historical-volatility-calculator/ 1、从市场上获得标的股票在固定时间间隔(如每天DAY、每周WEEK或每月MONTH等)上的价格。 2、对于每个时间段,求出该时间段末的股价与该时段初的股价之比的自然对数。 3、求出这些对数值的标准差即为历史波动率的估计值 4、若将日、周等标准差转化为年标准差,需要再乘以一年中包含的时段数量的平方根(如,选取时间间隔为每天,则若扣除闭市,每年中有250个交易日,应乘以根号250)
func (RespHistoricalStockPrice) LastYearFinalPrice ¶
func (p RespHistoricalStockPrice) LastYearFinalPrice() float64
LastYearFinalPrice 获取去年12月份最后一个交易日的股价
Click to show internal directories.
Click to hide internal directories.