-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample_etf.py
75 lines (63 loc) · 1.8 KB
/
example_etf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Author: Fredrik Bakken
# Website: https://www.fredrikbakken.no/
from pprint import pprint
from yahoo_fs import ETF
def etf_examples():
robo = ETF('ROBO')
print(robo.get_price())
# All available commands (commented)
'''
print(robo.get_stock_exchange())
print(robo.get_currency())
print(robo.get_price())
print(robo.get_change())
print(robo.get_percent_change())
print(robo.get_previous_trade_time())
print(robo.get_trade_timezone())
print(robo.get_previous_close())
print(robo.get_open())
print(robo.get_bid())
print(robo.get_ask())
print(robo.get_day_range())
print(robo.get_52_week_range())
print(robo.get_volume())
print(robo.get_avg_daily_volume())
print(robo.get_net_assets())
print(robo.get_nav())
print(robo.get_pe_ratio())
print(robo.get_yield())
print(robo.get_ytd_return())
print(robo.get_beta())
print(robo.get_expense_ratio())
print(robo.get_inception_date())
'''
'''
print(robo.get_company_name())
print(robo.get_company_phone())
pprint(robo.get_fund_overview())
pprint(robo.get_fund_operations())
'''
'''
pprint(robo.get_historical_day('2018-02-20'))
pprint(robo.get_historical_days('2018-03-19', '2018-03-23'))
pprint(robo.get_historical_range('2018-02-01', '2018-02-15'))
'''
'''
pprint(robo.get_portfolio_composition())
pprint(robo.get_sector_weightings())
pprint(robo.get_equity_holdings())
pprint(robo.get_bond_ratings())
pprint(robo.get_top_10_holdings())
'''
'''
pprint(robo.get_trailing_returns_vs_benchmark())
pprint(robo.get_annual_total_return_history())
'''
'''
pprint(robo.get_risk_statistics())
'''
if __name__ == '__main__':
etf_examples()