没有项目描述
stockAnalysis的Python项目详细描述
该软件包包括库存分析工具和数据提取器,使用 雅虎金融..
安装
- pip install stockanalysis
雅虎金融S&P500 Extrator
- 方法和参数:yahoofinance(符号、范围/持续时间、间隔)
- symbol是股票代码,例如apple的“aapl”或“goog” 为谷歌。
- 范围/持续时间是查询的所需范围,允许的参数 分别是[1D、5D、1MO、3MO、6MO、1Y、2Y、5Y、10Y、YTD、MAX]。
- 间隔是报价的期望间隔,例如每5分钟, 允许参数为[1m、2m、5m、15m、30m、60m、90m、1h、1d、5d, 1周,1个月,3个月]。
用法
'''Create an instance of yahoo finance class and pass the parameters as string '''yf=YahooFinance('AAPL','6mo','1d')'''Gets all the prices within given time frame'''get_quotes=yf.CompanyQuotes()'''Populates the output data as a json file '''write_data=yf.writeOutput()'''Reads from the output file. Takes only two parameter Path and Data Series Parameter string should be [High, Low, Open , Close] '''r_data=yf.readOutput('output.json','close')'''SMA and EMA methods takes two parameters first param is Data and second is the time frame. '''get_sma=yf.sma(r_data,14)get_ema=yf.ema(r_data,14)'''RSI method takes two parameters first param is Data and second is the time frame. '''get_rsi=yf.RSI(r_data,14)'''MACD method takes three parameters first param is Data, second is the slows and third one is the fast'''get_macd=yf.macd(r_data,25,14)
联系人
这个包是由sadik erisen创建的。如果您有任何疑问或意见,请发送电子邮件至fserisen@gmail.com。
许可证
麻省理工学院