Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Broken ETF functionalities #1976

Merged
merged 7 commits into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions openbb_terminal/etf/etf_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,13 @@ def call_compare(self, other_args):
if other_args and "-" not in other_args[0][0]:
other_args.insert(0, "-e")

# to allow inputs with spaces in between them instead of commas (inputs with spaces are not parsed correctly)

if len(other_args) > 2:
for i in range(2, len(other_args)):
other_args[1] += "," + other_args[i]
del other_args[2 : len(other_args)]

ns_parser = self.parse_known_args_and_warn(
parser, other_args, export_allowed=EXPORT_ONLY_RAW_DATA_ALLOWED
)
Expand Down
4 changes: 2 additions & 2 deletions openbb_terminal/etf/stockanalysis_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def get_all_names_symbols() -> Tuple[List[str], List[str]]:
"https://stockanalysis.com/etf/", headers={"User-Agent": get_user_agent()}
)
soup2 = bs(r.text, "html.parser")
script = soup2.find("script", {"id": "__NEXT_DATA__"})
script = soup2.find("script", {"type": "application/json"})

etfs = pd.DataFrame(json.loads(script.string)["props"]["pageProps"]["stocks"])
etfs = pd.DataFrame(json.loads(script.string)["data"])
etf_symbols = etfs.s.to_list()
etf_names = etfs.n.to_list()
return etf_symbols, etf_names
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
,ARKQ,ARKW
Assets,$1.90B,$3.12B
NAV,$70.82,$103.00
Expense Ratio,0.75%,0.79%
Assets,$1.22B,$1.38B
NAV,$51.58,$50.72
Expense Ratio,0.75%,0.83%
PE Ratio,28.59,50.48
Shares Out,26.80M,30.25M
Shares Out,23.70M,27.30M
Dividend (ttm),$0.61,$3.12
Dividend Yield,0.87%,3.04%
Volume,"621,151","2,026,375"
Open,69.50,100.61
Previous Close,70.76,102.98
52-Week Low,68.66,98.75
52-Week High,68.66,98.75
Beta,1.30,1.41
Holdings,39,43
Dividend Yield,1.17%,5.74%
Volume,"108,090","1,297,050"
Open,64.31,51.64
Previous Close,51.48,51.13
52-Week Low,56.88,45.10
52-Week High,90.28,162.04
Beta,1.31,1.43
Holdings,39,36
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
,ARKK,ARKF
Assets,$13.23B,$1.77B
NAV,$80.08,$35.37
Assets,$7.55B,$815.79M
NAV,$40.45,$15.93
Expense Ratio,0.75%,0.75%
PE Ratio,n/a,43.05
Shares Out,165.25M,50.10M
Shares Out,186.70M,51.20M
Dividend (ttm),$0.26,n/a
Dividend Yield,0.34%,n/a
Volume,"23,301,484","1,527,657"
Open,78.74,34.10
Previous Close,80.24,35.02
52-Week Low,76.91,33.30
52-Week High,76.91,33.30
Beta,1.58,1.24
Holdings,44,39
Dividend Yield,0.59%,n/a
Volume,"33,040,871","1,344,180"
Open,41.63,16.21
Previous Close,41.11,16.02
52-Week Low,35.10,14.64
52-Week High,132.50,55.28
Beta,1.60,1.29
Holdings,36,31
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
,% Of Etf,Shares
TSLA,10.65%,"196,846"
PATH,7.75%,"3,927,868"
TRMB,7.16%,"1,797,163"
KTOS,6.58%,"7,253,960"
IRDM,4.86%,"2,459,364"
KMTUY,4.49%,"3,260,777"
DE,3.90%,"195,439"
DDD,3.62%,"3,525,947"
U,3.37%,"550,713"
TSP,2.80%,"2,092,013"
MG.TO,2.78%,"592,172"
MKFG,2.61%,"9,605,894"
AVAV,2.60%,"815,916"
PLTR,2.49%,"2,970,570"
NIU,2.37%,"3,072,134"
TER,2.31%,"278,592"
BLDE,2.11%,"5,968,836"
GOOG,1.99%,"13,632"
ACHR,1.90%,"9,011,467"
ESLT.TA,1.82%,"197,474"
XPEV,1.69%,"677,301"
CAT,1.65%,"138,503"
VLD,1.61%,"5,500,431"
NNDM,1.60%,"8,408,342"
BIDU,1.58%,"197,014"
LMT,1.53%,"79,724"
MTLS,1.38%,"1,277,435"
TDY,1.35%,"60,980"
SSYS,1.26%,"1,008,786"
PRLB,1.22%,"466,428"
ISRG,1.19%,"72,533"
ANSS,1.14%,"61,571"
VUZI,1.09%,"2,718,273"
SNPS,1.08%,"62,760"
BYDDY,1.03%,"296,935"
n/a,0.75%,"14,298,046"
TWOU,0.65%,"759,559"
JD,0.03%,"7,070"
ONVO,0.02%,"113,180"
TSLA,9.73%,"155,386"
KTOS,7.84%,"6,403,572"
TRMB,7.32%,"1,412,011"
PATH,6.70%,"3,951,824"
KMTUY,5.39%,"2,676,674"
IRDM,5.30%,"1,623,932"
DE,4.65%,"160,399"
AVAV,4.63%,"637,782"
ACHR,3.25%,"8,020,688"
TER,2.94%,"365,158"
BLDE,2.69%,"5,884,128"
DDD,2.48%,"2,894,336"
XPEV,2.47%,"933,920"
BYDDY,2.44%,"359,834"
ESLT.TA,2.35%,"133,597"
GOOG,2.22%,"11,232"
MKFG,1.90%,"9,755,762"
TSP,1.90%,"2,948,109"
NNDM,1.88%,"6,902,236"
MG.TO,1.86%,"371,434"
VUZI,1.80%,"3,053,436"
CAT,1.76%,"101,737"
NIU,1.74%,"2,434,228"
PRLB,1.73%,"431,661"
SSYS,1.59%,"960,731"
U,1.49%,"452,025"
SNPS,1.37%,"51,517"
MTLS,1.26%,"1,048,578"
TDY,1.17%,"36,553"
VLD,1.14%,"7,180,737"
ANSS,1.05%,"50,531"
LMT,1.04%,"28,098"
NIO,0.77%,"383,431"
ISRG,0.76%,"44,252"
TWOU,0.50%,"656,109"
GM,0.43%,"149,031"
MTTR,0.33%,"936,228"
n/a,0.13%,"1,434,529"
ONVO,0.02%,"92,838"
Original file line number Diff line number Diff line change
@@ -1,44 +1,37 @@
,% Of Etf,Shares
COIN,7.63%,"1,052,066"
TSLA,7.22%,"220,222"
GBTC,6.59%,"6,803,551"
ZM,5.51%,"1,069,741"
SPOT,5.36%,"744,393"
ROKU,5.33%,"996,120"
TDOC,4.95%,"1,985,632"
TWTR,4.89%,"3,980,112"
TWLO,4.47%,"648,097"
SHOP,3.69%,"109,216"
SQ,3.59%,"825,403"
U,3.36%,"907,280"
DKNG,3.26%,"4,234,973"
RBLX,3.24%,"1,272,235"
SPLK,3.18%,"830,456"
PATH,2.92%,"2,445,211"
SE,1.94%,"338,001"
HOOD,1.88%,"3,872,355"
PLTR,1.86%,"3,651,842"
PD,1.56%,"1,597,777"
DIS,1.23%,"249,662"
SKLZ,1.23%,"6,431,438"
ETSY,1.21%,"228,448"
MELI,1.19%,"33,062"
OKTA,1.19%,"185,045"
NET,1.16%,"367,665"
VUZI,1.15%,"4,742,098"
n/a,1.07%,"33,720,971"
CND,1.06%,"3,317,062"
VCYT,1.05%,"1,123,022"
GENI,1.05%,"4,994,787"
NNDM,1.00%,"8,651,809"
KIND,0.92%,"4,585,586"
ADYEY,0.89%,"1,292,951"
TWOU,0.65%,"1,255,439"
EDR,0.54%,"529,921"
NU,0.49%,"1,794,527"
MNDY,0.45%,"64,807"
DOCU,0.01%,"2,421"
PTON,0.01%,"9,636"
SNAP,0.01%,"7,810"
LPSN,0.00%,272
SNOW,0.00%,91
ZM,9.32%,"1,111,489"
ROKU,9.14%,"1,393,999"
TSLA,8.07%,"154,124"
COIN,6.12%,"1,445,502"
GBTC,5.98%,"6,016,411"
SQ,5.85%,"1,311,674"
TWLO,5.08%,"809,977"
PATH,4.60%,"3,244,371"
SHOP,4.53%,"187,484"
TDOC,4.12%,"1,775,430"
DKNG,3.84%,"4,280,168"
RBLX,3.39%,"1,554,102"
U,2.87%,"1,041,899"
SPOT,2.70%,"361,725"
PD,2.68%,"1,486,161"
SE,2.26%,"420,512"
HOOD,2.13%,"3,833,256"
VUZI,2.07%,"4,193,424"
MNDY,1.93%,"246,311"
MELI,1.59%,"32,838"
CRWD,1.45%,"119,236"
NNDM,1.36%,"5,992,316"
KIND,1.29%,"5,037,976"
NVDA,1.25%,"102,435"
VCYT,1.22%,"948,087"
ADYEY,1.13%,"1,143,342"
NET,1.03%,"319,262"
GENI,0.99%,"5,213,031"
TWOU,0.74%,"1,160,499"
EDR,0.69%,"468,617"
NU,0.45%,"1,586,870"
n/a,0.14%,"1,844,091"
OKTA,0.01%,"1,609"
DIS,0.01%,"1,456"
TWTR,0.00%,241
PTON,0.00%,"1,795"
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
,ARKQ
Assets,$1.90B
NAV,$70.82
Assets,$1.22B
NAV,$51.58
Expense Ratio,0.75%
PE Ratio,28.59
Shares Out,26.80M
Shares Out,23.70M
Dividend (ttm),$0.61
Dividend Yield,0.87%
Volume,"531,687"
Open,70.02
Previous Close,70.76
52-Week Low,69.25
52-Week High,69.25
Beta,1.30
Dividend Yield,1.17%
Volume,"108,090"
Open,64.31
Previous Close,51.48
52-Week Low,56.88
52-Week High,90.28
Beta,1.31
Holdings,39
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
,ARKW
Assets,$3.12B
NAV,$103.00
Expense Ratio,0.79%
Assets,$1.38B
NAV,$50.72
Expense Ratio,0.83%
PE Ratio,50.48
Shares Out,30.25M
Shares Out,27.30M
Dividend (ttm),$3.12
Dividend Yield,3.04%
Volume,"1,623,554"
Open,102.28
Previous Close,102.98
52-Week Low,99.98
52-Week High,99.98
Beta,1.41
Holdings,43
Dividend Yield,5.74%
Volume,"1,297,050"
Open,51.64
Previous Close,51.13
52-Week Low,45.10
52-Week High,162.04
Beta,1.43
Holdings,36
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
10,IEZ,iShares U.S. Oil Equipment & Services ETF
11,OIH,VanEck Vectors Oil Services ETF
12,OILK,ProShares K-1 Free Crude Oil Strategy ETF
13,PXJ,Invesco Dynamic Oil & Gas Services ETF
14,SCO,ProShares UltraShort Bloomberg Crude Oil
15,UCO,ProShares Ultra Bloomberg Crude Oil
16,USL,United States 12 Month Oil Fund
17,USO,United States Oil Fund
18,XES,SPDR S&P Oil & Gas Equipment & Services ETF
19,XOP,SPDR S&P Oil & Gas Exploration & Production ETF
13,ONG,Direxion Daily Oil Services Bull 2X Shares
14,PXJ,Invesco Dynamic Oil & Gas Services ETF
15,SCO,ProShares UltraShort Bloomberg Crude Oil
16,UCO,ProShares Ultra Bloomberg Crude Oil
17,USL,United States 12 Month Oil Fund
18,USO,United States Oil Fund
19,XES,SPDR S&P Oil & Gas Equipment & Services ETF
20,XOP,SPDR S&P Oil & Gas Exploration & Production ETF

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Empty DataFrame
Columns: [Symbol, Name]
Index: []

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Empty DataFrame
Columns: [Symbol, Name]
Index: []

Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
ARKQ ARKF
Assets $1.90B $1.77B
NAV $70.82 $35.37
Assets $1.22B $815.79M
NAV $51.58 $15.93
Expense Ratio 0.75% 0.75%
PE Ratio 28.59 43.05
Shares Out 26.80M 50.10M
Shares Out 23.70M 51.20M
Dividend (ttm) $0.61 n/a
Dividend Yield 0.87% n/a
Volume 621,151 1,539,052
Open 69.50 34.10
Previous Close 70.76 35.02
52-Week Low 68.66 33.30
52-Week High 68.66 33.30
Beta 1.30 1.24
Holdings 39 39

Dividend Yield 1.17% n/a
Volume 108,090 1,344,180
Open 64.31 16.21
Previous Close 51.48 16.02
52-Week Low 56.88 14.64
52-Week High 90.28 55.28
Beta 1.31 1.29
Holdings 39 31
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
ARKW ARKK
Assets $3.12B $13.23B
NAV $103.00 $80.08
Expense Ratio 0.79% 0.75%
Assets $1.38B $7.55B
NAV $50.72 $40.45
Expense Ratio 0.83% 0.75%
PE Ratio 50.48 n/a
Shares Out 30.25M 165.25M
Shares Out 27.30M 186.70M
Dividend (ttm) $3.12 $0.26
Dividend Yield 3.04% 0.34%
Volume 2,026,375 23,379,144
Open 100.61 78.74
Previous Close 102.98 80.24
52-Week Low 98.75 76.91
52-Week High 98.75 76.91
Beta 1.41 1.58
Holdings 43 44

Dividend Yield 5.74% 0.59%
Volume 1,297,050 33,040,871
Open 51.64 41.63
Previous Close 51.13 41.11
52-Week Low 45.10 35.10
52-Week High 162.04 132.50
Beta 1.43 1.60
Holdings 36 36
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
% Of Etf Shares
TSLA 10.65% 196,846
PATH 7.75% 3,927,868
TRMB 7.16% 1,797,163
KTOS 6.58% 7,253,960
IRDM 4.86% 2,459,364

% Of Etf Shares
TSLA 9.73% 155,386
KTOS 7.84% 6,403,572
TRMB 7.32% 1,412,011
PATH 6.70% 3,951,824
KMTUY 5.39% 2,676,674
Loading