本文整理汇总了Python中analyzer.Analyzer.hist_daily_return方法的典型用法代码示例。如果您正苦于以下问题:Python Analyzer.hist_daily_return方法的具体用法?Python Analyzer.hist_daily_return怎么用?Python Analyzer.hist_daily_return使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类analyzer.Analyzer
的用法示例。
在下文中一共展示了Analyzer.hist_daily_return方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_report
# 需要导入模块: from analyzer import Analyzer [as 别名]
# 或者: from analyzer.Analyzer import hist_daily_return [as 别名]
def get_report(symbols, start, end):
header('Technical Report for Individual Stocks', 1)
# initialize the analyzer
# examine the performance since past one year from today
analyzer = Analyzer(symbols, start, end)
index = analyzer.index
analyzer.plot_normalized()
print 'The historical prices compared with HSI index. \n' \
'All stock prices are normalized to 1 at the beginning of the time for easier comparison.\n'
for symbol in symbols[1:]:
header('{}'.format(symbol), 3)
# 20-day moving average
analyzer.show_bollinger(symbol, 20)
print 'The Bollinger Bands for both stocks with 20-day moving average and 1 standard deviation.\n'
analyzer.hist_daily_return(symbol)
print 'Daily returns throughout the year plotted as histograms.\n'\
'White dashed line denotes the mean and the red ones are standard deviations.\n'
analyzer.hist_compare_return(index, symbol)
print 'Daily returns of each stock against which of the HSI index.\n'
analyzer.scatter_daily_return(symbol)
print 'Beta, alpha and correlation of each stock.\n'