# 金融大數據期末 ###### tags: `school` ## 對任意股票做K線以及布林通道 並觀察該股與美股4大指標漲跌相迄度 將全部台股與昨天52家美股資料做相迄度比較 ### 詳細講解影片可於[**我的雲端**](https://drive.google.com/file/d/1ZqYulynKzBEPhfIkqm710_iswaJ_LNPS/view?usp=sharing)觀看 ### 抓取特定台股股價 <font size=4 >我們將 [**yahoo finance**](https://finance.yahoo.com/)上的資料抓下來 然後做圖表方便觀測</font> ![](https://i.imgur.com/5FAVCxC.png) <font size = 4>先利用requests.gets發現回來的訊號為404異常 去看檢查 </font> ![](https://i.imgur.com/w0JIoZk.png) <font size=4>發現有問題 利用headers解決</font> ```python= import requests import urllib as ur from bs4 import BeautifulSoup import pandas number=input("任意檔股票號碼:(ex:台積電 輸入 2330)") twurl = 'https://finance.yahoo.com/quote/'+str(number)+'.TW/history?p='+str(number)+'.TW' headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36'} res = requests.get(twurl,headers = headers) soup = BeautifulSoup(res.text, "html.parser") a = soup.prettify()#變成html形式 a=pandas.read_html(a)#a 為list格式 a[0] ``` ![](https://i.imgur.com/wfAIVF6.png) ### 抓取股票名子 <font size=4>因為a為list形式 用find函數為error 且a中並無股票名子或號碼</font> ```python= name = soup.find('h1',class_='D(ib) Fz(18px)')#要的資料位置 name = str(name) name = name[name.find('data-reactid')+16:name.find('/h1')-1] name = name.strip('<>') ``` ### 將資料做分類 ```python= DATE=[] opening = [] top = [] lowest = [] closing = [] updown = [] updownpercent = [] fakedate = [] a[0]['updown'] = 0 for i in range(len(a[0]['Date'])-1): if a[0]['Date'][i] not in DATE: DATE.append(a[0]['Date'][i]) closing.append(a[0]['Close*'][i]) for i in range(len(a[0]['Date'])-1): if a[0]['Date'][i] not in fakedate:#因為有配息日 會有重複資料 opening.append(a[0]['Open'][i]) top.append(a[0]['High'][i]) lowest.append(a[0]['Low'][i]) if a[0]['Date'][i] not in fakedate:#算長還跌 這裡是看兩天的close 判斷 資料有配息日要跳過 if float(a[0]['Open'][i])<=float(a[0]['Close*'][i]): a[0]['updown'][i] = True if float(a[0]['Open'][i])>float(a[0]['Close*'][i]): a[0]['updown'][i] = False fakedate.append(a[0]['Date'][i]) ``` ![](https://i.imgur.com/16ZJwUh.png) ```python= DATE = list(map(str, reversed(DATE))) opening = list(map(float, reversed(opening)))#因為資料為倒敘 且類型為str 轉換成float好做運算 top = list(map(float, reversed(top))) lowest = list(map(float, reversed(lowest))) closing = list(map(float, reversed(closing))) ``` ### 算平均數做均線以及標準差 ```python= subclosing =0 calculatedays = 20#可自行更改多少天算均線及準差 closing_average= [] squareclosing=0 closing_stander=[] plusvarience=[] subtractvarience=[] for i in range(calculatedays-1,len(DATE),1): subclosing =0 squareclosing=0 for j in range(0,calculatedays,1): subclosing+=(closing[i-j]) squareclosing+=closing[i-j]**2 closing_average.append(subclosing/calculatedays) closing_stander.append((squareclosing/calculatedays-(subclosing/calculatedays)**2)**(1/2)) for i in range(len(closing_average)): plusvarience.append(closing_average[i]+2*closing_stander[i])#平均加2倍標準差 for i in range(len(closing_average)): subtractvarience.append(closing_average[i]-2*closing_stander[i]) ``` ### 做K線以及布林通道 ```python= import matplotlib.pyplot as plt X_TICK=[] fig = plt.figure(figsize=(15,5)) fig ax = fig.add_subplot(111) ax.patch.set_facecolor('black') for i in range (0,len(DATE)-2,1): if opening[i]>=closing[i]: plt.plot([DATE[i],DATE[i]],[closing[i],opening[i]],color = 'green',linewidth=5) plt.plot([DATE[i],DATE[i]],[top[i],lowest[i]],color = 'green',linewidth=2) if opening[i]<closing[i]: plt.plot([DATE[i],DATE[i]],[closing[i],opening[i]],color = 'red',linewidth=5) plt.plot([DATE[i],DATE[i]],[top[i],lowest[i]],color = 'red',linewidth=2) plt.plot(DATE[calculatedays-1:len(DATE)],closing_average,color='darkorange',label='Moving Average') plt.plot(DATE[calculatedays-1:len(DATE)],plusvarience,color='gold',label='Resistance line') plt.plot(DATE[calculatedays-1:len(DATE)],subtractvarience,color='gold',label='Resistance line') for i in range(0,len(DATE)-1,10): X_TICK.append(int(i)) plt.xticks(X_TICK) plt.title(name,fontsize=23) plt.xlabel('Date',fontsize=20) plt.ylabel('price',fontsize=20) plt.legend() plt.show() ``` ![](https://i.imgur.com/czud8RX.png) ## 將特定股與美國4大指數比較 ### 抓取道瓊指數 ```python= djiurl = 'https://finance.yahoo.com/quote/%5EDJI/history?p=%5EDJI' djiheaders = {'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36'} djires = requests.get(djiurl,headers = djiheaders) djisoup = BeautifulSoup(djires.text, "html.parser") djia = djisoup.prettify() djia=pandas.read_html(djia) ``` ```python= djiDATE=[] djiclosing = [] fakedate = [] djia[0]['updown'] = 0 for i in range(len(djia[0]['Date'])-3): if djia[0]['Date'][i] not in fakedate:#算長還跌 這裡是看兩天的close 判斷 資料有配息日要跳過 if float(djia[0]['Open'][i])<=float(djia[0]['Close*'][i]): djia[0]['updown'][i] = True if float(djia[0]['Open'][i])>float(djia[0]['Close*'][i]): djia[0]['updown'][i] = False fakedate.append(djia[0]['Date'][i]) ``` ### 標普500 ```python= sandpurl = 'https://finance.yahoo.com/quote/%5EDJI/history?p=%5EDJI' sandpheaders = {'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36'} sandpres = requests.get(sandpurl,headers = sandpheaders) sandpsoup = BeautifulSoup(sandpres.text, "html.parser") sandpa = sandpsoup.prettify() sandpa=pandas.read_html(sandpa) ``` ```python= sandpDATE=[] sandpclosing = [] fakedate = [] sandpa[0]['updown'] = 0 for i in range(len(sandpa[0]['Date'])-1): if sandpa[0]['Date'][i] not in fakedate:#算長還跌 這裡是看兩天的close 判斷 資料有配息日要跳過 if float(sandpa[0]['Open'][i])<=float(sandpa[0]['Close*'][i]): sandpa[0]['updown'][i] = True if float(sandpa[0]['Open'][i])>float(sandpa[0]['Close*'][i]): sandpa[0]['updown'][i] = False fakedate.append(sandpa[0]['Date'][i]) ``` ### 那斯達克 ```python= ndxurl = 'https://finance.yahoo.com/quote/%5ENDX/history?p=%5ENDX' ndxheaders = {'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36'} ndxres = requests.get(ndxurl,headers = ndxheaders) ndxsoup = BeautifulSoup(ndxres.text, "html.parser") ndxa = ndxsoup.prettify() ndxa=pandas.read_html(ndxa) ``` ```python= ndxDATE=[] ndxclosing = [] fakedate = [] ndxa[0]['updown'] = 0 for i in range(len(ndxa[0]['Date'])-1): if ndxa[0]['Date'][i] not in fakedate:#算長還跌 這裡是看兩天的close 判斷 資料有配息日要跳過 if float(ndxa[0]['Open'][i])<=float(ndxa[0]['Close*'][i]): ndxa[0]['updown'][i] = True if float(ndxa[0]['Open'][i])>float(ndxa[0]['Close*'][i]): ndxa[0]['updown'][i] = False fakedate.append(ndxa[0]['Date'][i]) ``` ### 費城半導體 ```python= soxurl = 'https://finance.yahoo.com/quote/%5ESOX/history?p=%5ESOX' soxheaders = {'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36'} soxres = requests.get(soxurl,headers = ndxheaders) soxsoup = BeautifulSoup(soxres.text, "html.parser") soxa = soxsoup.prettify() soxa=pandas.read_html(soxa) ``` ```python= soxDATE=[] soxclosing = [] fakedate = [] soxa[0]['updown'] = 0 for i in range(len(soxa[0]['Date'])-1): if soxa[0]['Date'][i] not in fakedate:#算長還跌 這裡是看兩天的close 判斷 資料有配息日要跳過 if float(soxa[0]['Open'][i])<=float(soxa[0]['Close*'][i]): soxa[0]['updown'][i] = True if float(soxa[0]['Open'][i])>float(soxa[0]['Close*'][i]): soxa[0]['updown'][i] = False fakedate.append(soxa[0]['Date'][i]) soxa[0] ``` ## 計算相似度即顯示出來 ```python= stockanddjipercent = 0 stockandsandppercent = 0 stockandndxpercent = 0 stockandsoxpercent = 0 fakedate = [] for i in range(len(djia[0]['Date'])): if djia[0]['Date'][i] not in fakedate:#算長還跌 這裡是看兩天的close 判斷 資料有配息日要跳過 if a[0]['updown'][i] == djia[0]['updown'][i]: stockanddjipercent+=1 fakedate.append(djia[0]['Date'][i]) stockanddjipercent = stockanddjipercent/((len(fakedate))-1) stockanddjipercent = round(stockanddjipercent,5) fakedate = [] for i in range(len(sandpa[0]['Date'])): if sandpa[0]['Date'][i] not in fakedate:#算長還跌 這裡是看兩天的close 判斷 資料有配息日要跳過 if a[0]['updown'][i] == sandpa[0]['updown'][i]: stockandsandppercent+=1 fakedate.append(sandpa[0]['Date'][i]) stockandsandppercent = stockandsandppercent/((len(fakedate))-1) stockandsandppercent = round(stockandsandppercent,5) fakedate = [] for i in range(len(ndxa[0]['Date'])): if ndxa[0]['Date'][i] not in fakedate:#算長還跌 這裡是看兩天的close 判斷 資料有配息日要跳過 if a[0]['updown'][i] == ndxa[0]['updown'][i]: stockandndxpercent+=1 fakedate.append(ndxa[0]['Date'][i]) stockandndxpercent = stockandndxpercent/((len(fakedate))-1) stockandndxpercent = round(stockandndxpercent,5) fakedate = [] for i in range(len(soxa[0]['Date'])): if soxa[0]['Date'][i] not in fakedate:#算長還跌 這裡是看兩天的close 判斷 資料有配息日要跳過 if a[0]['updown'][i] == soxa[0]['updown'][i]: stockandsoxpercent+=1 fakedate.append(soxa[0]['Date'][i]) stockandsoxpercent = stockandsoxpercent/((len(fakedate))-1) stockandsoxpercent = round(stockandsoxpercent,5) index = ['dji','s&p','ndx','sox'] withindexpercent = [stockanddjipercent ,stockandsandppercent,stockandndxpercent,stockandsoxpercent ] for i in range(len(index)): print(name,'與',index[i],'相砌度為:', withindexpercent [i]) ``` ![](https://i.imgur.com/RpJGkSj.png) # 來看可不可以因為美國跟台灣時間差 進行套利(看有沒有相似度超過0.6的台股) ## 收集全台灣股票代碼 抓取此<font size = 5>[**網站**](https://www.tej.com.tw/webtej/doc/uid.htm)</font>的代碼 ```python= import requests import urllib as ur from bs4 import BeautifulSoup import pandas allstocknumberurl = 'https://www.tej.com.tw/webtej/doc/uid.htm' res = requests.get(allstocknumberurl) soup = BeautifulSoup(res.text, "html.parser") c = soup.prettify() d=pandas.read_html(c) ``` ![](https://i.imgur.com/b40X6v7.png) ![](https://i.imgur.com/jahpbra.png) ```python= allstocknumber = [] numberal = ['1','2','3','4','5','6','7','8','9','0',""] realallstocknumber = [] really = [] for p in range(2,len(d)-1): k,l = d[p].shape for i in range(l): for j in range(k): if len(str(d[p][i][j]))>3 : allstocknumber.append(d[p][i][j][:4])#d裡面全部都抓下來 for i in range(len(allstocknumber)-1): for j in range(len(allstocknumber[i])): if allstocknumber[i][j] not in numberal: realallstocknumber.append(allstocknumber[i])#d裡面不要的 for i in range(len(allstocknumber)-1): if allstocknumber[i] not in realallstocknumber: really.append(allstocknumber[i])#d裡面要的 really = list(map(int,really)) really = sorted(really) really = list(map(str,really)) ``` ## 刪除不對的號碼 ```python= really = [] for number in badreally: twurl = 'https://finance.yahoo.com/quote/'+str(number)+'.TW/history?p='+str(number)+'.TW' headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36'} res = requests.get(twurl,headers = headers) soup = BeautifulSoup(res.text, "html.parser") a = soup.prettify() a=pandas.read_html(a) if a[0].columns[0] == 'Date' : really.append(badreally[badreally.index('number')]) ``` <font color='red' size=6>!!!</font>這裡建議大家可去[**台灣證券交易所**](http://moneydj.emega.com.tw/js/StockTable.htm)下載台灣股市的資料就可以直接讀資料然後分析了 但因為我的excel壞掉了 所以才上網抓不是只有台股編號的資料 ## 將號碼與美股4大指標比較(相似度設0.6) ```python= threeormorebigger= [ ] twobiger = [] onebiger = [] for number in really: twurl = 'https://finance.yahoo.com/quote/'+str(number)+'.TW/history?p='+str(number)+'.TW' headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36'} res = requests.get(twurl,headers = headers) soup = BeautifulSoup(res.text, "html.parser") a = soup.prettify() a=pandas.read_html(a) if len(a[0])>95: name = soup.find('h1',class_='D(ib) Fz(18px)') name = str(name) name = name[name.find('data-reactid')+16:name.find('/h1')-1] name = name.strip('<>>') fakedate = [] a[0]['updown'] = 0 for i in range(len(a[0]['Date'])-1): if a[0]['Date'][i] not in fakedate: if float(a[0]['Open'][i]) > float(a[0]['Close*'][i]): a[0]['updown'][i] = False if float(a[0]['Open'][i]) <= float(a[0]['Close*'][i]): a[0]['updown'][i] = True fakedate.append(a[0]['Date'][i]) fakedate = [] stockanddjipercent = 0 stockandsandppercent = 0 stockandndxpercent = 0 stockandsoxpercent = 0 r = 0 for i in range(len(a[0]['Date'])-1): if a[0]['Date'][i] not in fakedate: if a[0]['Date'][i] not in fakedate: if a[0]['updown'][i] == djia[0]['updown'][r]: stockanddjipercent += 1 r+=1 fakedate.append(a[0]['Date'][i]) stockanddjipercent = stockanddjipercent/len(fakedate) stockanddjipercent = round(stockanddjipercent,5) fakedate = [] r = 0 for i in range(len(a[0]['Date'])-1): if a[0]['Date'][i] not in fakedate: if a[0]['Date'][i] not in fakedate: if a[0]['updown'][i] == sandpa[0]['updown'][r]: stockandsandppercent += 1 r+=1 fakedate.append(a[0]['Date'][i]) stockandsandppercent = stockandsandppercent/len(fakedate) stockandsandppercent = round(stockandsandppercent,5) fakedate = [] r = 0 for i in range(len(a[0]['Date'])-1): if a[0]['Date'][i] not in fakedate: if a[0]['Date'][i] not in fakedate: if a[0]['updown'][i] == ndxa[0]['updown'][r]: stockandndxpercent += 1 r+=1 fakedate.append(a[0]['Date'][i]) stockandndxpercent = stockandndxpercent/len(fakedate) stockandndxpercent = round(stockandndxpercent,5) fakedate = [] r = 0 for i in range(len(a[0]['Date'])-1): if a[0]['Date'][i] not in fakedate: if a[0]['Date'][i] not in fakedate: if a[0]['updown'][i] == soxa[0]['updown'][r]: stockandsoxpercent += 1 r+=1 fakedate.append(a[0]['Date'][i]) stockandsoxpercent = stockandsoxpercent/len(fakedate) stockandsoxpercent = round(stockandsoxpercent,5) index = ['dji','s&p','ndx','sox'] withindexpercent = [stockanddjipercent ,stockandsandppercent,stockandndxpercent,stockandsoxpercent ] for i in range(len(index)): print(name,'與',index[i],'相砌度為:', withindexpercent [i]) ``` ``` . . . China Petrochemical Development Corporation (1314.TW) 與 dji 相砌度為: 0.53 China Petrochemical Development Corporation (1314.TW) 與 s&p 相砌度為: 0.55 China Petrochemical Development Corporation (1314.TW) 與 ndx 相砌度為: 0.47 China Petrochemical Development Corporation (1314.TW) 與 sox 相砌度為: 0.54 Tah Hsin Industrial Corporation (1315.TW) 與 dji 相砌度為: 0.40816 Tah Hsin Industrial Corporation (1315.TW) 與 s&p 相砌度為: 0.46939 Tah Hsin Industrial Corporation (1315.TW) 與 ndx 相砌度為: 0.44898 Tah Hsin Industrial Corporation (1315.TW) 與 sox 相砌度為: 0.5 Sun Yad Construction Co.,Ltd (1316.TW) 與 dji 相砌度為: 0.51 Sun Yad Construction Co.,Ltd (1316.TW) 與 s&p 相砌度為: 0.55 Sun Yad Construction Co.,Ltd (1316.TW) 與 ndx 相砌度為: 0.53 Sun Yad Construction Co.,Ltd (1316.TW) 與 sox 相砌度為: 0.56 Tong Yang Industry Co., Ltd. (1319.TW) 與 dji 相砌度為: 0.48485 Tong Yang Industry Co., Ltd. (1319.TW) 與 s&p 相砌度為: 0.50505 Tong Yang Industry Co., Ltd. (1319.TW) 與 ndx 相砌度為: 0.50505 Tong Yang Industry Co., Ltd. (1319.TW) 與 sox 相砌度為: 0.49495 Ocean Plastics Co., Ltd. (1321.TW) 與 dji 相砌度為: 0.51515 Ocean Plastics Co., Ltd. (1321.TW) 與 s&p 相砌度為: 0.49495 Ocean Plastics Co., Ltd. (1321.TW) 與 ndx 相砌度為: 0.45455 Ocean Plastics Co., Ltd. (1321.TW) 與 sox 相砌度為: 0.50505 Yonyu Plastics Co., Ltd. (1323.TW) 與 dji 相砌度為: 0.45455 Yonyu Plastics Co., Ltd. (1323.TW) 與 s&p 相砌度為: 0.49495 Yonyu Plastics Co., Ltd. (1323.TW) 與 ndx 相砌度為: 0.47475 Yonyu Plastics Co., Ltd. (1323.TW) 與 sox 相砌度為: 0.46465 Globe Industries Corporation (1324.TW) 與 dji 相砌度為: 0.49495 Globe Industries Corporation (1324.TW) 與 s&p 相砌度為: 0.53535 Globe Industries Corporation (1324.TW) 與 ndx 相砌度為: 0.53535 Globe Industries Corporation (1324.TW) 與 sox 相砌度為: 0.54545 Universal Incorporation (1325.TW) 與 dji 相砌度為: 0.44444 Universal Incorporation (1325.TW) 與 s&p 相砌度為: 0.44444 Universal Incorporation (1325.TW) 與 ndx 相砌度為: 0.46465 Universal Incorporation (1325.TW) 與 sox 相砌度為: 0.47475 Formosa Chemicals &amp; Fibre Corporation (1326.TW) 與 dji 相砌度為: 0.43434 Formosa Chemicals &amp; Fibre Corporation (1326.TW) 與 s&p 相砌度為: 0.45455 Formosa Chemicals &amp; Fibre Corporation (1326.TW) 與 ndx 相砌度為: 0.41414 Formosa Chemicals &amp; Fibre Corporation (1326.TW) 與 sox 相砌度為: 0.48485 Far Eastern New Century Corporation (1402.TW) 與 dji 相砌度為: 0.50505 Far Eastern New Century Corporation (1402.TW) 與 s&p 相砌度為: 0.60606 Far Eastern New Century Corporation (1402.TW) 與 ndx 相砌度為: 0.52525 Far Eastern New Century Corporation (1402.TW) 與 sox 相砌度為: 0.55556 Shinkong Synthetic Fibers Corporation (1409.TW) 與 dji 相砌度為: 0.58586 Shinkong Synthetic Fibers Corporation (1409.TW) 與 s&p 相砌度為: 0.60606 Shinkong Synthetic Fibers Corporation (1409.TW) 與 ndx 相砌度為: 0.52525 Shinkong Synthetic Fibers Corporation (1409.TW) 與 sox 相砌度為: 0.57576 ) Fz(18px)">Nan Yang Dyeing &amp; Finishing Co.,Ltd (1410.TW) 與 dji 相砌度為: 0.53535 ) Fz(18px)">Nan Yang Dyeing &amp; Finishing Co.,Ltd (1410.TW) 與 s&p 相砌度為: 0.57576 ) Fz(18px)">Nan Yang Dyeing &amp; Finishing Co.,Ltd (1410.TW) 與 ndx 相砌度為: 0.55556 ) Fz(18px)">Nan Yang Dyeing &amp; Finishing Co.,Ltd (1410.TW) 與 sox 相砌度為: 0.56566 Hung Chou Fiber Ind. Co., Ltd (1413.TW) 與 dji 相砌度為: 0.46 Hung Chou Fiber Ind. Co., Ltd (1413.TW) 與 s&p 相砌度為: 0.48 Hung Chou Fiber Ind. Co., Ltd (1413.TW) 與 ndx 相砌度為: 0.48 Hung Chou Fiber Ind. Co., Ltd (1413.TW) 與 sox 相砌度為: 0.49 Tung Ho Textile Co., Ltd. (1414.TW) 與 dji 相砌度為: 0.50505 Tung Ho Textile Co., Ltd. (1414.TW) 與 s&p 相砌度為: 0.52525 Tung Ho Textile Co., Ltd. (1414.TW) 與 ndx 相砌度為: 0.50505 Tung Ho Textile Co., Ltd. (1414.TW) 與 sox 相砌度為: 0.47475 Kwong Fong Industries Corporation (1416.TW) 與 dji 相砌度為: 0.47475 Kwong Fong Industries Corporation (1416.TW) 與 s&p 相砌度為: 0.49495 Kwong Fong Industries Corporation (1416.TW) 與 ndx 相砌度為: 0.47475 Kwong Fong Industries Corporation (1416.TW) 與 sox 相砌度為: 0.54545 Carnival Industrial Corporation (1417.TW) 與 dji 相砌度為: 0.5102 Carnival Industrial Corporation (1417.TW) 與 s&p 相砌度為: 0.55102 Carnival Industrial Corporation (1417.TW) 與 ndx 相砌度為: 0.44898 Carnival Industrial Corporation (1417.TW) 與 sox 相砌度為: 0.47959 Tong-Hwa Synthetic Fiber Company Limited (1418.TW) 與 dji 相砌度為: 0.51 Tong-Hwa Synthetic Fiber Company Limited (1418.TW) 與 s&p 相砌度為: 0.51 Tong-Hwa Synthetic Fiber Company Limited (1418.TW) 與 ndx 相砌度為: 0.51 Tong-Hwa Synthetic Fiber Company Limited (1418.TW) 與 sox 相砌度為: 0.46 Shinkong Textile Co., Ltd. (1419.TW) 與 dji 相砌度為: 0.49495 Shinkong Textile Co., Ltd. (1419.TW) 與 s&p 相砌度為: 0.51515 Shinkong Textile Co., Ltd. (1419.TW) 與 ndx 相砌度為: 0.49495 Shinkong Textile Co., Ltd. (1419.TW) 與 sox 相砌度為: 0.42424 Reward Wool Industry Corporation (1423.TW) 與 dji 相砌度為: 0.44444 Reward Wool Industry Corporation (1423.TW) 與 s&p 相砌度為: 0.46465 Reward Wool Industry Corporation (1423.TW) 與 ndx 相砌度為: 0.50505 Reward Wool Industry Corporation (1423.TW) 與 sox 相砌度為: 0.49495 TRK Corporation (1432.TW) 與 dji 相砌度為: 0.46 TRK Corporation (1432.TW) 與 s&p 相砌度為: 0.44 TRK Corporation (1432.TW) 與 ndx 相砌度為: 0.42 TRK Corporation (1432.TW) 與 sox 相砌度為: 0.47 Formosa Taffeta Co., Ltd. (1434.TW) 與 dji 相砌度為: 0.49495 Formosa Taffeta Co., Ltd. (1434.TW) 與 s&p 相砌度為: 0.49495 Formosa Taffeta Co., Ltd. (1434.TW) 與 ndx 相砌度為: 0.47475 Formosa Taffeta Co., Ltd. (1434.TW) 與 sox 相砌度為: 0.38384 Chung Fu Tex-International Corporation (1435.TW) 與 dji 相砌度為: 0.54 Chung Fu Tex-International Corporation (1435.TW) 與 s&p 相砌度為: 0.5 Chung Fu Tex-International Corporation (1435.TW) 與 ndx 相砌度為: 0.5 Chung Fu Tex-International Corporation (1435.TW) 與 sox 相砌度為: 0.43 ) Fz(18px)">Hua Yu Lien Development Co., Ltd (1436.TW) 與 dji 相砌度為: 0.49495 ) Fz(18px)">Hua Yu Lien Development Co., Ltd (1436.TW) 與 s&p 相砌度為: 0.45455 ) Fz(18px)">Hua Yu Lien Development Co., Ltd (1436.TW) 與 ndx 相砌度為: 0.49495 ) Fz(18px)">Hua Yu Lien Development Co., Ltd (1436.TW) 與 sox 相砌度為: 0.56566 GTM Holdings Corporation (1437.TW) 與 dji 相砌度為: 0.47475 GTM Holdings Corporation (1437.TW) 與 s&p 相砌度為: 0.51515 GTM Holdings Corporation (1437.TW) 與 ndx 相砌度為: 0.51515 GTM Holdings Corporation (1437.TW) 與 sox 相砌度為: 0.48485 ) Fz(18px)">SanDi Properties Co.,Ltd. (1438.TW) 與 dji 相砌度為: 0.51 ) Fz(18px)">SanDi Properties Co.,Ltd. (1438.TW) 與 s&p 相砌度為: 0.53 ) Fz(18px)">SanDi Properties Co.,Ltd. (1438.TW) 與 ndx 相砌度為: 0.51 ) Fz(18px)">SanDi Properties Co.,Ltd. (1438.TW) 與 sox 相砌度為: 0.48 SanDi Properties Co.,Ltd. (1438.TW) 與 dji 相砌度為: 0.51 SanDi Properties Co.,Ltd. (1438.TW) 與 s&p 相砌度為: 0.53 SanDi Properties Co.,Ltd. (1438.TW) 與 ndx 相砌度為: 0.51 SanDi Properties Co.,Ltd. (1438.TW) 與 sox 相砌度為: 0.48 Chuwa Wool Industry Co., (Taiwan) Ltd. (1439.TW) 與 dji 相砌度為: 0.47 Chuwa Wool Industry Co., (Taiwan) Ltd. (1439.TW) 與 s&p 相砌度為: 0.55 Chuwa Wool Industry Co., (Taiwan) Ltd. (1439.TW) 與 ndx 相砌度為: 0.57 Chuwa Wool Industry Co., (Taiwan) Ltd. (1439.TW) 與 sox 相砌度為: 0.54 Tainan Spinning Co., Ltd. (1440.TW) 與 dji 相砌度為: 0.54545 Tainan Spinning Co., Ltd. (1440.TW) 與 s&p 相砌度為: 0.58586 Tainan Spinning Co., Ltd. (1440.TW) 與 ndx 相砌度為: 0.54545 Tainan Spinning Co., Ltd. (1440.TW) 與 sox 相砌度為: 0.57576 Tah Tong Textile Co., Ltd. (1441.TW) 與 dji 相砌度為: 0.51 Tah Tong Textile Co., Ltd. (1441.TW) 與 s&p 相砌度為: 0.55 Tah Tong Textile Co., Ltd. (1441.TW) 與 ndx 相砌度為: 0.51 Tah Tong Textile Co., Ltd. (1441.TW) 與 sox 相砌度為: 0.52 Advancetek Enterprise Co.,Ltd. (1442.TW) 與 dji 相砌度為: 0.46939 Advancetek Enterprise Co.,Ltd. (1442.TW) 與 s&p 相砌度為: 0.44898 Advancetek Enterprise Co.,Ltd. (1442.TW) 與 ndx 相砌度為: 0.42857 Advancetek Enterprise Co.,Ltd. (1442.TW) 與 sox 相砌度為: 0.45918 Lily Textile Co., Ltd. (1443.TW) 與 dji 相砌度為: 0.51 Lily Textile Co., Ltd. (1443.TW) 與 s&p 相砌度為: 0.57 Lily Textile Co., Ltd. (1443.TW) 與 ndx 相砌度為: 0.57 Lily Textile Co., Ltd. (1443.TW) 與 sox 相砌度為: 0.52 Lealea Enterprise Co., Ltd. (1444.TW) 與 dji 相砌度為: 0.47 Lealea Enterprise Co., Ltd. (1444.TW) 與 s&p 相砌度為: 0.49 Lealea Enterprise Co., Ltd. (1444.TW) 與 ndx 相砌度為: 0.49 Lealea Enterprise Co., Ltd. (1444.TW) 與 sox 相砌度為: 0.52 Universal Textile Co., Ltd. (1445.TW) 與 dji 相砌度為: 0.50505 Universal Textile Co., Ltd. (1445.TW) 與 s&p 相砌度為: 0.52525 Universal Textile Co., Ltd. (1445.TW) 與 ndx 相砌度為: 0.48485 Universal Textile Co., Ltd. (1445.TW) 與 sox 相砌度為: 0.51515 Hong Ho Precision Textile Co.,Ltd. (1446.TW) 與 dji 相砌度為: 0.43434 Hong Ho Precision Textile Co.,Ltd. (1446.TW) 與 s&p 相砌度為: 0.45455 Hong Ho Precision Textile Co.,Ltd. (1446.TW) 與 ndx 相砌度為: 0.47475 Hong Ho Precision Textile Co.,Ltd. (1446.TW) 與 sox 相砌度為: 0.52525 Li Peng Enterprise Co., Ltd. (1447.TW) 與 dji 相砌度為: 0.54 Li Peng Enterprise Co., Ltd. (1447.TW) 與 s&p 相砌度為: 0.54 Li Peng Enterprise Co., Ltd. (1447.TW) 與 ndx 相砌度為: 0.54 Li Peng Enterprise Co., Ltd. (1447.TW) 與 sox 相砌度為: 0.53 Chia Her Industrial Co., Ltd. (1449.TW) 與 dji 相砌度為: 0.52 Chia Her Industrial Co., Ltd. (1449.TW) 與 s&p 相砌度為: 0.54 Chia Her Industrial Co., Ltd. (1449.TW) 與 ndx 相砌度為: 0.52 Chia Her Industrial Co., Ltd. (1449.TW) 與 sox 相砌度為: 0.51 Nien Hsing Textile Co., Ltd. (1451.TW) 與 dji 相砌度為: 0.51515 Nien Hsing Textile Co., Ltd. (1451.TW) 與 s&p 相砌度為: 0.47475 Nien Hsing Textile Co., Ltd. (1451.TW) 與 ndx 相砌度為: 0.53535 Nien Hsing Textile Co., Ltd. (1451.TW) 與 sox 相砌度為: 0.54545 Hong Yi Fiber Ind. Co., Ltd. (1452.TW) 與 dji 相砌度為: 0.42424 Hong Yi Fiber Ind. Co., Ltd. (1452.TW) 與 s&p 相砌度為: 0.46465 Hong Yi Fiber Ind. Co., Ltd. (1452.TW) 與 ndx 相砌度為: 0.46465 Hong Yi Fiber Ind. Co., Ltd. (1452.TW) 與 sox 相砌度為: 0.51515 Ta Jiang Co., Ltd. (1453.TW) 與 dji 相砌度為: 0.49 Ta Jiang Co., Ltd. (1453.TW) 與 s&p 相砌度為: 0.53 Ta Jiang Co., Ltd. (1453.TW) 與 ndx 相砌度為: 0.51 Ta Jiang Co., Ltd. (1453.TW) 與 sox 相砌度為: 0.54 Taiwan Taffeta Fabric Co., Ltd. (1454.TW) 與 dji 相砌度為: 0.49495 Taiwan Taffeta Fabric Co., Ltd. (1454.TW) 與 s&p 相砌度為: 0.49495 Taiwan Taffeta Fabric Co., Ltd. (1454.TW) 與 ndx 相砌度為: 0.47475 Taiwan Taffeta Fabric Co., Ltd. (1454.TW) 與 sox 相砌度為: 0.54545 Zig Sheng Industrial Co., Ltd. (1455.TW) 與 dji 相砌度為: 0.47475 Zig Sheng Industrial Co., Ltd. (1455.TW) 與 s&p 相砌度為: 0.47475 Zig Sheng Industrial Co., Ltd. (1455.TW) 與 ndx 相砌度為: 0.45455 Zig Sheng Industrial Co., Ltd. (1455.TW) 與 sox 相砌度為: 0.46465 I-HWA Industrial Co.,Ltd (1456.TW) 與 dji 相砌度為: 0.51 I-HWA Industrial Co.,Ltd (1456.TW) 與 s&p 相砌度為: 0.51 I-HWA Industrial Co.,Ltd (1456.TW) 與 ndx 相砌度為: 0.49 I-HWA Industrial Co.,Ltd (1456.TW) 與 sox 相砌度為: 0.54 Yi Jinn Industrial Co., Ltd. (1457.TW) 與 dji 相砌度為: 0.54 Yi Jinn Industrial Co., Ltd. (1457.TW) 與 s&p 相砌度為: 0.54 Yi Jinn Industrial Co., Ltd. (1457.TW) 與 ndx 相砌度為: 0.52 Yi Jinn Industrial Co., Ltd. (1457.TW) 與 sox 相砌度為: 0.53 Lan Fa Textile Co.,Ltd. (1459.TW) 與 dji 相砌度為: 0.6 Lan Fa Textile Co.,Ltd. (1459.TW) 與 s&p 相砌度為: 0.62 Lan Fa Textile Co.,Ltd. (1459.TW) 與 ndx 相砌度為: 0.54 Lan Fa Textile Co.,Ltd. (1459.TW) 與 sox 相砌度為: 0.61 Everest Textile Co., Ltd. (1460.TW) 與 dji 相砌度為: 0.48485 Everest Textile Co., Ltd. (1460.TW) 與 s&p 相砌度為: 0.52525 Everest Textile Co., Ltd. (1460.TW) 與 ndx 相砌度為: 0.50505 Everest Textile Co., Ltd. (1460.TW) 與 sox 相砌度為: 0.45455 Chyang Sheng Dyeing &amp; Finishing Co., Ltd. (1463.TW) 與 dji 相砌度為: 0.51515 Chyang Sheng Dyeing &amp; Finishing Co., Ltd. (1463.TW) 與 s&p 相砌度為: 0.53535 Chyang Sheng Dyeing &amp; Finishing Co., Ltd. (1463.TW) 與 ndx 相砌度為: 0.45455 Chyang Sheng Dyeing &amp; Finishing Co., Ltd. (1463.TW) 與 sox 相砌度為: 0.52525 De Licacy Industrial Co., Ltd. (1464.TW) 與 dji 相砌度為: 0.47475 De Licacy Industrial Co., Ltd. (1464.TW) 與 s&p 相砌度為: 0.49495 De Licacy Industrial Co., Ltd. (1464.TW) 與 ndx 相砌度為: 0.43434 De Licacy Industrial Co., Ltd. (1464.TW) 與 sox 相砌度為: 0.50505 Wisher Industrial Co., Ltd. (1465.TW) 與 dji 相砌度為: 0.52525 Wisher Industrial Co., Ltd. (1465.TW) 與 s&p 相砌度為: 0.54545 Wisher Industrial Co., Ltd. (1465.TW) 與 ndx 相砌度為: 0.50505 Wisher Industrial Co., Ltd. (1465.TW) 與 sox 相砌度為: 0.55556 Acelon Chemicals &amp; Fiber Corporation (1466.TW) 與 dji 相砌度為: 0.51 Acelon Chemicals &amp; Fiber Corporation (1466.TW) 與 s&p 相砌度為: 0.51 Acelon Chemicals &amp; Fiber Corporation (1466.TW) 與 ndx 相砌度為: 0.51 Acelon Chemicals &amp; Fiber Corporation (1466.TW) 與 sox 相砌度為: 0.52 Tex-Ray Industrial Co., Ltd. (1467.TW) 與 dji 相砌度為: 0.42424 Tex-Ray Industrial Co., Ltd. (1467.TW) 與 s&p 相砌度為: 0.50505 Tex-Ray Industrial Co., Ltd. (1467.TW) 與 ndx 相砌度為: 0.48485 Tex-Ray Industrial Co., Ltd. (1467.TW) 與 sox 相砌度為: 0.51515 Chang-Ho Fibre Corporation (1468.TW) 與 dji 相砌度為: 0.51 Chang-Ho Fibre Corporation (1468.TW) 與 s&p 相砌度為: 0.57 Chang-Ho Fibre Corporation (1468.TW) 與 ndx 相砌度為: 0.49 Chang-Ho Fibre Corporation (1468.TW) 與 sox 相砌度為: 0.52 evertex fabrinology limited (1470.TW) 與 dji 相砌度為: 0.48485 evertex fabrinology limited (1470.TW) 與 s&p 相砌度為: 0.50505 evertex fabrinology limited (1470.TW) 與 ndx 相砌度為: 0.50505 evertex fabrinology limited (1470.TW) 與 sox 相砌度為: 0.45455 Solytech Enterprise Corporation (1471.TW) 與 dji 相砌度為: 0.41 Solytech Enterprise Corporation (1471.TW) 與 s&p 相砌度為: 0.45 Solytech Enterprise Corporation (1471.TW) 與 ndx 相砌度為: 0.49 Solytech Enterprise Corporation (1471.TW) 與 sox 相砌度為: 0.48 Triocean Industrial Corporation Co., Ltd. (1472.TW) 與 dji 相砌度為: 0.50505 Triocean Industrial Corporation Co., Ltd. (1472.TW) 與 s&p 相砌度為: 0.50505 Triocean Industrial Corporation Co., Ltd. (1472.TW) 與 ndx 相砌度為: 0.44444 Triocean Industrial Corporation Co., Ltd. (1472.TW) 與 sox 相砌度為: 0.51515 Tainan Enterprises Co.,Ltd (1473.TW) 與 dji 相砌度為: 0.52525 Tainan Enterprises Co.,Ltd (1473.TW) 與 s&p 相砌度為: 0.52525 Tainan Enterprises Co.,Ltd (1473.TW) 與 ndx 相砌度為: 0.48485 Tainan Enterprises Co.,Ltd (1473.TW) 與 sox 相砌度為: 0.47475 Honmyue Enterprise Co., Ltd. (1474.TW) 與 dji 相砌度為: 0.54545 Honmyue Enterprise Co., Ltd. (1474.TW) 與 s&p 相砌度為: 0.54545 Honmyue Enterprise Co., Ltd. (1474.TW) 與 ndx 相砌度為: 0.42424 Honmyue Enterprise Co., Ltd. (1474.TW) 與 sox 相砌度為: 0.49495 Big Sun Shine CO., LTD. (1475.TW) 與 dji 相砌度為: 0.51 Big Sun Shine CO., LTD. (1475.TW) 與 s&p 相砌度為: 0.57 Big Sun Shine CO., LTD. (1475.TW) 與 ndx 相砌度為: 0.51 Big Sun Shine CO., LTD. (1475.TW) 與 sox 相砌度為: 0.52 Eclat Textile Co., Ltd. (1476.TW) 與 dji 相砌度為: 0.40404 Eclat Textile Co., Ltd. (1476.TW) 與 s&p 相砌度為: 0.40404 Eclat Textile Co., Ltd. (1476.TW) 與 ndx 相砌度為: 0.46465 Eclat Textile Co., Ltd. (1476.TW) 與 sox 相砌度為: 0.47475 Makalot Industrial Co., Ltd. (1477.TW) 與 dji 相砌度為: 0.49 Makalot Industrial Co., Ltd. (1477.TW) 與 s&p 相砌度為: 0.45 Makalot Industrial Co., Ltd. (1477.TW) 與 ndx 相砌度為: 0.49 Makalot Industrial Co., Ltd. (1477.TW) 與 sox 相砌度為: 0.54 Shihlin Electric &amp; Engineering Corporation (1503.TW) 與 dji 相砌度為: 0.48485 Shihlin Electric &amp; Engineering Corporation (1503.TW) 與 s&p 相砌度為: 0.54545 Shihlin Electric &amp; Engineering Corporation (1503.TW) 與 ndx 相砌度為: 0.58586 Shihlin Electric &amp; Engineering Corporation (1503.TW) 與 sox 相砌度為: 0.55556 TECO Electric &amp; Machinery Co., Ltd. (1504.TW) 與 dji 相砌度為: 0.56 TECO Electric &amp; Machinery Co., Ltd. (1504.TW) 與 s&p 相砌度為: 0.56 TECO Electric &amp; Machinery Co., Ltd. (1504.TW) 與 ndx 相砌度為: 0.5 TECO Electric &amp; Machinery Co., Ltd. (1504.TW) 與 sox 相砌度為: 0.55 ) Fz(18px)">Right Way Industrial Co.,Ltd (1506.TW) 與 dji 相砌度為: 0.45 ) Fz(18px)">Right Way Industrial Co.,Ltd (1506.TW) 與 s&p 相砌度為: 0.47 ) Fz(18px)">Right Way Industrial Co.,Ltd (1506.TW) 與 ndx 相砌度為: 0.55 ) Fz(18px)">Right Way Industrial Co.,Ltd (1506.TW) 與 sox 相砌度為: 0.54 Yungtay Engineering Co., Ltd. (1507.TW) 與 dji 相砌度為: 0.49495 Yungtay Engineering Co., Ltd. (1507.TW) 與 s&p 相砌度為: 0.47475 Yungtay Engineering Co., Ltd. (1507.TW) 與 ndx 相砌度為: 0.51515 Yungtay Engineering Co., Ltd. (1507.TW) 與 sox 相砌度為: 0.52525 Jui Li Enterprise Co., Ltd. (1512.TW) 與 dji 相砌度為: 0.45 Jui Li Enterprise Co., Ltd. (1512.TW) 與 s&p 相砌度為: 0.49 Jui Li Enterprise Co., Ltd. (1512.TW) 與 ndx 相砌度為: 0.53 Jui Li Enterprise Co., Ltd. (1512.TW) 與 sox 相砌度為: 0.56 Chung-Hsin Electric and Machinery Manufacturing Corp. (1513.TW) 與 dji 相砌度為: 0.44444 Chung-Hsin Electric and Machinery Manufacturing Corp. (1513.TW) 與 s&p 相砌度為: 0.42424 Chung-Hsin Electric and Machinery Manufacturing Corp. (1513.TW) 與 ndx 相砌度為: 0.46465 Chung-Hsin Electric and Machinery Manufacturing Corp. (1513.TW) 與 sox 相砌度為: 0.51515 Allis Electric Co.,Ltd. (1514.TW) 與 dji 相砌度為: 0.47959 Allis Electric Co.,Ltd. (1514.TW) 與 s&p 相砌度為: 0.52041 Allis Electric Co.,Ltd. (1514.TW) 與 ndx 相砌度為: 0.5 Allis Electric Co.,Ltd. (1514.TW) 與 sox 相砌度為: 0.57143 Rexon Industrial Corp.,Ltd (1515.TW) 與 dji 相砌度為: 0.5 Rexon Industrial Corp.,Ltd (1515.TW) 與 s&p 相砌度為: 0.48 Rexon Industrial Corp.,Ltd (1515.TW) 與 ndx 相砌度為: 0.44 Rexon Industrial Corp.,Ltd (1515.TW) 與 sox 相砌度為: 0.45 Falcon Power Co., Ltd. (1516.TW) 與 dji 相砌度為: 0.46939 Falcon Power Co., Ltd. (1516.TW) 與 s&p 相砌度為: 0.55102 Falcon Power Co., Ltd. (1516.TW) 與 ndx 相砌度為: 0.5102 Falcon Power Co., Ltd. (1516.TW) 與 sox 相砌度為: 0.43878 Leechi Machinery Industry Ltd. Co. (1517.TW) 與 dji 相砌度為: 0.53535 Leechi Machinery Industry Ltd. Co. (1517.TW) 與 s&p 相砌度為: 0.53535 Leechi Machinery Industry Ltd. Co. (1517.TW) 與 ndx 相砌度為: 0.47475 Leechi Machinery Industry Ltd. Co. (1517.TW) 與 sox 相砌度為: 0.56566 Fortune Electric Co., Ltd. (1519.TW) 與 dji 相砌度為: 0.49495 Fortune Electric Co., Ltd. (1519.TW) 與 s&p 相砌度為: 0.43434 Fortune Electric Co., Ltd. (1519.TW) 與 ndx 相砌度為: 0.47475 Fortune Electric Co., Ltd. (1519.TW) 與 sox 相砌度為: 0.50505 Ta Yih Industrial Co., Ltd. (1521.TW) 與 dji 相砌度為: 0.47475 Ta Yih Industrial Co., Ltd. (1521.TW) 與 s&p 相砌度為: 0.49495 Ta Yih Industrial Co., Ltd. (1521.TW) 與 ndx 相砌度為: 0.51515 Ta Yih Industrial Co., Ltd. (1521.TW) 與 sox 相砌度為: 0.54545 TYC Brother Industrial Co., Ltd. (1522.TW) 與 dji 相砌度為: 0.48485 TYC Brother Industrial Co., Ltd. (1522.TW) 與 s&p 相砌度為: 0.46465 TYC Brother Industrial Co., Ltd. (1522.TW) 與 ndx 相砌度為: 0.50505 TYC Brother Industrial Co., Ltd. (1522.TW) 與 sox 相砌度為: 0.47475 Gordon Auto Body Parts Co., Ltd. (1524.TW) 與 dji 相砌度為: 0.55 Gordon Auto Body Parts Co., Ltd. (1524.TW) 與 s&p 相砌度為: 0.57 Gordon Auto Body Parts Co., Ltd. (1524.TW) 與 ndx 相砌度為: 0.53 Gordon Auto Body Parts Co., Ltd. (1524.TW) 與 sox 相砌度為: 0.56 Kian Shen Corporation (1525.TW) 與 dji 相砌度為: 0.48485 Kian Shen Corporation (1525.TW) 與 s&p 相砌度為: 0.46465 Kian Shen Corporation (1525.TW) 與 ndx 相砌度為: 0.52525 Kian Shen Corporation (1525.TW) 與 sox 相砌度為: 0.53535 Sun Race Sturmey-Archer Inc. (1526.TW) 與 dji 相砌度為: 0.50505 Sun Race Sturmey-Archer Inc. (1526.TW) 與 s&p 相砌度為: 0.48485 Sun Race Sturmey-Archer Inc. (1526.TW) 與 ndx 相砌度為: 0.50505 Sun Race Sturmey-Archer Inc. (1526.TW) 與 sox 相砌度為: 0.51515 Basso Industry Corp. (1527.TW) 與 dji 相砌度為: 0.45455 Basso Industry Corp. (1527.TW) 與 s&p 相砌度為: 0.47475 Basso Industry Corp. (1527.TW) 與 ndx 相砌度為: 0.53535 Basso Industry Corp. (1527.TW) 與 sox 相砌度為: 0.58586 Anderson Industrial Corporation (1528.TW) 與 dji 相砌度為: 0.49495 Anderson Industrial Corporation (1528.TW) 與 s&p 相砌度為: 0.51515 Anderson Industrial Corporation (1528.TW) 與 ndx 相砌度為: 0.47475 Anderson Industrial Corporation (1528.TW) 與 sox 相砌度為: 0.50505 Klingon Aerospace Inc. (1529.TW) 與 dji 相砌度為: 0.43434 Klingon Aerospace Inc. (1529.TW) 與 s&p 相砌度為: 0.47475 Klingon Aerospace Inc. (1529.TW) 與 ndx 相砌度為: 0.49495 Klingon Aerospace Inc. (1529.TW) 與 sox 相砌度為: 0.52525 Awea mechantronic co.,ltd (1530.TW) 與 dji 相砌度為: 0.49495 Awea mechantronic co.,ltd (1530.TW) 與 s&p 相砌度為: 0.53535 Awea mechantronic co.,ltd (1530.TW) 與 ndx 相砌度為: 0.49495 Awea mechantronic co.,ltd (1530.TW) 與 sox 相砌度為: 0.54545 ) Fz(18px)">Kaulin Mfg. Co., Ltd. (1531.TW) 與 dji 相砌度為: 0.46465 ) Fz(18px)">Kaulin Mfg. Co., Ltd. (1531.TW) 與 s&p 相砌度為: 0.48485 ) Fz(18px)">Kaulin Mfg. Co., Ltd. (1531.TW) 與 ndx 相砌度為: 0.46465 ) Fz(18px)">Kaulin Mfg. Co., Ltd. (1531.TW) 與 sox 相砌度為: 0.45455 China Metal Products Co., Ltd. (1532.TW) 與 dji 相砌度為: 0.49495 China Metal Products Co., Ltd. (1532.TW) 與 s&p 相砌度為: 0.51515 China Metal Products Co., Ltd. (1532.TW) 與 ndx 相砌度為: 0.49495 China Metal Products Co., Ltd. (1532.TW) 與 sox 相砌度為: 0.50505 Mobiletron Electronics Co.,Ltd. (1533.TW) 與 dji 相砌度為: 0.47 Mobiletron Electronics Co.,Ltd. (1533.TW) 與 s&p 相砌度為: 0.47 Mobiletron Electronics Co.,Ltd. (1533.TW) 與 ndx 相砌度為: 0.49 Mobiletron Electronics Co.,Ltd. (1533.TW) 與 sox 相砌度為: 0.48 China Ecotek Corporation (1535.TW) 與 dji 相砌度為: 0.47475 China Ecotek Corporation (1535.TW) 與 s&p 相砌度為: 0.45455 China Ecotek Corporation (1535.TW) 與 ndx 相砌度為: 0.43434 China Ecotek Corporation (1535.TW) 與 sox 相砌度為: 0.42424 Hota Industrial Mfg. Co., Ltd. (1536.TW) 與 dji 相砌度為: 0.40404 Hota Industrial Mfg. Co., Ltd. (1536.TW) 與 s&p 相砌度為: 0.46465 Hota Industrial Mfg. Co., Ltd. (1536.TW) 與 ndx 相砌度為: 0.54545 Hota Industrial Mfg. Co., Ltd. (1536.TW) 與 sox 相砌度為: 0.51515 Kung Long Batteries Industrial Co.,Ltd (1537.TW) 與 dji 相砌度為: 0.52525 Kung Long Batteries Industrial Co.,Ltd (1537.TW) 與 s&p 相砌度為: 0.48485 Kung Long Batteries Industrial Co.,Ltd (1537.TW) 與 ndx 相砌度為: 0.48485 Kung Long Batteries Industrial Co.,Ltd (1537.TW) 與 sox 相砌度為: 0.47475 Jenn Feng Industrial Co., Ltd. (1538.TW) 與 dji 相砌度為: 0.54 Jenn Feng Industrial Co., Ltd. (1538.TW) 與 s&p 相砌度為: 0.56 Jenn Feng Industrial Co., Ltd. (1538.TW) 與 ndx 相砌度為: 0.6 Jenn Feng Industrial Co., Ltd. (1538.TW) 與 sox 相砌度為: 0.53 Chiu Ting Machinery Co., Ltd. (1539.TW) 與 dji 相砌度為: 0.47 Chiu Ting Machinery Co., Ltd. (1539.TW) 與 s&p 相砌度為: 0.49 Chiu Ting Machinery Co., Ltd. (1539.TW) 與 ndx 相砌度為: 0.51 Chiu Ting Machinery Co., Ltd. (1539.TW) 與 sox 相砌度為: 0.56 Roundtop Machinery Industries Co., Ltd. (1540.TW) 與 dji 相砌度為: 0.49495 Roundtop Machinery Industries Co., Ltd. (1540.TW) 與 s&p 相砌度為: 0.47475 Roundtop Machinery Industries Co., Ltd. (1540.TW) 與 ndx 相砌度為: 0.41414 Roundtop Machinery Industries Co., Ltd. (1540.TW) 與 sox 相砌度為: 0.50505 CHANG TYPE Industrial Co., Ltd. (1541.TW) 與 dji 相砌度為: 0.56566 CHANG TYPE Industrial Co., Ltd. (1541.TW) 與 s&p 相砌度為: 0.52525 CHANG TYPE Industrial Co., Ltd. (1541.TW) 與 ndx 相砌度為: 0.54545 CHANG TYPE Industrial Co., Ltd. (1541.TW) 與 sox 相砌度為: 0.53535 China Wire &amp; Cable Co., Ltd. (1603.TW) 與 dji 相砌度為: 0.43434 China Wire &amp; Cable Co., Ltd. (1603.TW) 與 s&p 相砌度為: 0.51515 China Wire &amp; Cable Co., Ltd. (1603.TW) 與 ndx 相砌度為: 0.55556 China Wire &amp; Cable Co., Ltd. (1603.TW) 與 sox 相砌度為: 0.54545 Sampo Corporation (1604.TW) 與 dji 相砌度為: 0.51515 Sampo Corporation (1604.TW) 與 s&p 相砌度為: 0.53535 Sampo Corporation (1604.TW) 與 ndx 相砌度為: 0.53535 . . . ``` 資料太多且不好看, 將最後面判斷的地方加一些限制 ```python= z = 0 for i in withindexpercent: if i>0.6: z+=1 if z == 1: onebiger.append(name) onebiger.append(withindexpercent) if z ==2: twobiger.append(name) twobiger.append(withindexpercent) if z >=3: threeormorebigger.append(name) threeormorebigger.append(withindexpercent) print("三種以上超過目標值的編號有:\n") if len(threeormorebigger) == 0: print("沒有\n") for i in range(len(threeormorebigger)): if i %2 != 0 : for j in range(0,4,1): print('與',index[j],'相砌度為:', threeormorebigger[i][j]) if i%2 == 0: print(threeormorebigger[i]) print("兩種超過目標值的編號有:\n") if len(twobiger) == 0: print("沒有\n") for i in range(len(twobiger)): if i %2 != 0 : for j in range(0,4,1): print('與',index[j],'相砌度為:', twobiger[i][j]) if i%2 == 0: print(twobiger[i]) print("一種超過目標值的編號有:\n") if len(onebiger) == 0: print("沒有\n") for i in range(len(onebiger)): if i %2 != 0 : for j in range(0,4,1): print('與',index[j],'相砌度為:', onebiger[i][j]) if i%2 == 0: print(onebiger[i]) ``` ``` 三種以上超過目標值的編號有: 沒有 兩種超過目標值的編號有: ) Fz(18px)">Lan Fa Textile Co.,Ltd. (1459.TW) 與 dji 相砌度為: 0.6 與 s&p 相砌度為: 0.62 與 ndx 相砌度為: 0.54 與 sox 相砌度為: 0.61 Taichung Commercial Bank Co., Ltd. (2812.TW) 與 dji 相砌度為: 0.60204 與 s&p 相砌度為: 0.60204 與 ndx 相砌度為: 0.58163 與 sox 相砌度為: 0.55102 Test Research, Inc. (3030.TW) 與 dji 相砌度為: 0.56566 與 s&p 相砌度為: 0.60606 與 ndx 相砌度為: 0.58586 與 sox 相砌度為: 0.61616 Kung Sing Engineering Corporation (5521.TW) 與 dji 相砌度為: 0.62245 與 s&p 相砌度為: 0.64286 與 ndx 相砌度為: 0.58163 與 sox 相砌度為: 0.57143 一種超過目標值的編號有: Southeast Cement Co.,Ltd. (1110.TW) 與 dji 相砌度為: 0.52525 與 s&p 相砌度為: 0.54545 與 ndx 相砌度為: 0.52525 與 sox 相砌度為: 0.63636 Asia Polymer Corporation (1308.TW) 與 dji 相砌度為: 0.56122 與 s&p 相砌度為: 0.60204 與 ndx 相砌度為: 0.54082 與 sox 相砌度為: 0.59184 Far Eastern New Century Corporation (1402.TW) 與 dji 相砌度為: 0.50505 與 s&p 相砌度為: 0.60606 與 ndx 相砌度為: 0.52525 與 sox 相砌度為: 0.55556 Shinkong Synthetic Fibers Corporation (1409.TW) 與 dji 相砌度為: 0.58586 與 s&p 相砌度為: 0.60606 與 ndx 相砌度為: 0.52525 與 sox 相砌度為: 0.57576 Hua Eng Wire &amp; Cable Co., Ltd. (1608.TW) 與 dji 相砌度為: 0.54545 與 s&p 相砌度為: 0.58586 與 ndx 相砌度為: 0.54545 與 sox 相砌度為: 0.61616 Ta Ya Electric Wire &amp; Cable (1609.TW) 與 dji 相砌度為: 0.46939 與 s&p 相砌度為: 0.5102 與 ndx 相砌度為: 0.5102 與 sox 相砌度為: 0.62245 First Copper Technology Co., Ltd. (2009.TW) 與 dji 相砌度為: 0.46465 與 s&p 相砌度為: 0.50505 與 ndx 相砌度為: 0.50505 與 sox 相砌度為: 0.61616 E-Lead Electronic Co., Ltd. (2497.TW) 與 dji 相砌度為: 0.48 與 s&p 相砌度為: 0.5 與 ndx 相砌度為: 0.52 與 sox 相砌度為: 0.61 Pacific Construction Co., Ltd (2506.TW) 與 dji 相砌度為: 0.56566 與 s&p 相砌度為: 0.58586 與 ndx 相砌度為: 0.60606 與 sox 相砌度為: 0.59596 Pacific Construction Co., Ltd (2506.TW) 與 dji 相砌度為: 0.56566 與 s&p 相砌度為: 0.58586 與 ndx 相砌度為: 0.60606 與 sox 相砌度為: 0.59596 Bank of Kaohsiung Co., Ltd. (2836.TW) 與 dji 相砌度為: 0.58163 與 s&p 相砌度為: 0.60204 與 ndx 相砌度為: 0.56122 與 sox 相砌度為: 0.5102 Chenming Electronic Technology Corporation (3013.TW) 與 dji 相砌度為: 0.58586 與 s&p 相砌度為: 0.60606 與 ndx 相砌度為: 0.56566 與 sox 相砌度為: 0.59596 Action Electronics Co., Ltd. (3024.TW) 與 dji 相砌度為: 0.53535 與 s&p 相砌度為: 0.57576 與 ndx 相砌度為: 0.57576 與 sox 相砌度為: 0.60606 Novatek Microelectronics Corp. (3034.TW) 與 dji 相砌度為: 0.44444 與 s&p 相砌度為: 0.48485 與 ndx 相砌度為: 0.50505 與 sox 相砌度為: 0.61616 PhytoHealth Corporation (4108.TW) 與 dji 相砌度為: 0.42 與 s&p 相砌度為: 0.48 與 ndx 相砌度為: 0.56 與 sox 相砌度為: 0.61 EverFocus Electronics Corporation (5484.TW) 與 dji 相砌度為: 0.56566 與 s&p 相砌度為: 0.54545 與 ndx 相砌度為: 0.54545 與 sox 相砌度為: 0.61616 CHC Resources Corporation (9930.TW) 與 dji 相砌度為: 0.58586 與 s&p 相砌度為: 0.60606 與 ndx 相砌度為: 0.56566 與 sox 相砌度為: 0.55556 ``` ## 美股52家公司與全台股價做交叉比對 因為用全部的話會跑太久 所以只找52家 ### 抓取52家[**美股公司名稱**]('https://tw.stock.yahoo.com/us-market') ```python= import requests from bs4 import BeautifulSoup import pandas url = 'https://tw.stock.yahoo.com/us-market' headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36'} res = requests.get(url,headers = headers) soup = BeautifulSoup(res.text, "html.parser") l = soup.find_all('span' , class_ = 'Fz(14px) C(#979ba7) Ell') for i in range(len(l)): l[i] = str(l[i]) for i in range(len(l)): l[i]=l[i][l[i].find('>')+1:l[i].find('</span')] ``` ![](https://i.imgur.com/FqIIXJ0.png) ```python= for number in really: twurl = 'https://finance.yahoo.com/quote/'+str(number)+'.TW/history?p='+str(number)+'.TW' headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36'} res = requests.get(twurl,headers = headers) soup = BeautifulSoup(res.text, "html.parser") a = soup.prettify() a=pandas.read_html(a) if len(a[0])>95: name = soup.find('h1',class_='D(ib) Fz(18px)') name = str(name) name = name[name.find('data-reactid')+16:name.find('/h1')-1] name = name.strip('<>>') fakedate = [] a[0]['updown'] = 0 for i in range(len(a[0]['Date'])-1): if a[0]['Date'][i] not in fakedate: if float(a[0]['Open'][i]) > float(a[0]['Close*'][i]): a[0]['updown'][i] = False if float(a[0]['Open'][i]) <= float(a[0]['Close*'][i]): a[0]['updown'][i] = True fakedate.append(a[0]['Date'][i]) for usnumber in l: usurl = 'https://finance.yahoo.com/quote/'+usnumber+'/history?p='+usnumber headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36'} usres = requests.get(usurl,headers = headers) ussoup = BeautifulSoup(usres.text, "html.parser") usa = ussoup.prettify() usa=pandas.read_html(usa) if len(usa[0])>95: usa[0]['updown'] = 0 usstockname = str(ussoup.find('h1',class_='D(ib) Fz(18px)')) usstockname = usstockname[usstockname.find('>')+1:usstockname.find('</h1')] for i in range(len(usa[0])-1): if usa[0]['Close*'][i]< usa[0]['Open'][i]: usa[0]['updown'][i] = False if usa[0]['Close*'][i]>= usa[0]['Open'][i]: usa[0]['updown'][i] = True fakedate = [] usfakedate = [] stockanduspercent = 0 r = 1#由於美國時間比台灣慢 for i in range(0,len(a[0]['Date'])-1,1): if a[0]['Date'][i] not in fakedate and usa[0]['Date'][r] not in usfakedate: fakedate.append(a[0]['Date'][i]) usfakedate.append(usa[0]['Date'][r]) if a[0]['updown'][i] == usa[0]['updown'][r]: stockanduspercent += 1 r+=1 stockanduspercent = stockanduspercent/len(fakedate) stockanduspercent = round(stockanduspercent,5) if stockanduspercent>=0.6: print(usstockname,'和',name,'的相迄度為:',stockanduspercent) ``` ``` . . . McDonald's Corporation (MCD) 和 Nankang Rubber Tire Corp.,Ltd. (2101.TW) 的相迄度為: 0.61224 The Boeing Company (BA) 和 Federal Corporation (2102.TW) 的相迄度為: 0.60606 NextEra Energy, Inc. (NEE) 和 Federal Corporation (2102.TW) 的相迄度為: 0.60825 General Electric Company (GE) 和 TSRC Corporation (2103.TW) 的相迄度為: 0.61856 Pfizer Inc. (PFE) 和 Cheng Shin Rubber Ind. Co., Ltd. (2105.TW) 的相迄度為: 0.61856 Berkshire Hathaway Inc. (BRK-B) 和 Formosan Rubber Group Inc. (2107.TW) 的相迄度為: 0.61616 AT&amp;T Inc. (T) 和 China Motor Corporation (2204.TW) 的相迄度為: 0.60825 Tesla, Inc. (TSLA) 和 China Motor Corporation (2204.TW) 的相迄度為: 0.62626 ASML Holding N.V. (ASML) 和 Sanyang Motor Co., Ltd. (2206.TW) 的相迄度為: 0.62626 General Motors Company (GM) 和 Lite-On Technology Corporation (2301.TW) 的相迄度為: 0.60606 Ford Motor Company (F) 和 Lite-On Technology Corporation (2301.TW) 的相迄度為: 0.62245 UnitedHealth Group Incorporated (UNH) 和 Lite-On Technology Corporation (2301.TW) 的相迄度為: 0.60204 AT&amp;T Inc. (T) 和 United Microelectronics Corporation (2303.TW) 的相迄度為: 0.60825 Verizon Communications Inc. (VZ) 和 Delta Electronics, Inc. (2308.TW) 的相迄度為: 0.60204 Bank of America Corporation (BAC) 和 Kinpo Electronics, Inc. (2312.TW) 的相迄度為: 0.60204 Merck &amp; Co., Inc. (MRK) 和 Kinpo Electronics, Inc. (2312.TW) 的相迄度為: 0.60606 3M Company (MMM) 和 Kinpo Electronics, Inc. (2312.TW) 的相迄度為: 0.67347 The Coca-Cola Company (KO) 和 Kinpo Electronics, Inc. (2312.TW) 的相迄度為: 0.61224 UnitedHealth Group Incorporated (UNH) 和 Kinpo Electronics, Inc. (2312.TW) 的相迄度為: 0.60606 AT&amp;T Inc. (T) 和 Compeq Manufacturing Co., Ltd. (2313.TW) 的相迄度為: 0.62245 Berkshire Hathaway Inc. (BRK-B) 和 Compeq Manufacturing Co., Ltd. (2313.TW) 的相迄度為: 0.61 Merck &amp; Co., Inc. (MRK) 和 Compeq Manufacturing Co., Ltd. (2313.TW) 的相迄度為: 0.63636 3M Company (MMM) 和 ) Fz(18px)">Microelectronics Technology Inc. (2314.TW) 的相迄度為: 0.61224 The Coca-Cola Company (KO) 和 Pan-International Industrial Corp. (2328.TW) 的相迄度為: 0.60825 The Coca-Cola Company (KO) 和 Elitegroup Computer Systems Co.,Ltd. (2331.TW) 的相迄度為: 0.60204 Weibo Corporation (WB) 和 Elitegroup Computer Systems Co.,Ltd. (2331.TW) 的相迄度為: 0.64646 Broadcom Inc. (AVGO) 和 D-Link Corporation (2332.TW) 的相迄度為: 0.61856 American Express Company (AXP) 和 D-Link Corporation (2332.TW) 的相迄度為: 0.64583 The Procter &amp; Gamble Company (PG) 和 Macronix International Co., Ltd. (2337.TW) 的相迄度為: 0.60825 The Home Depot, Inc. (HD) 和 Opto Tech Corporation (2340.TW) 的相迄度為: 0.61224 Merck &amp; Co., Inc. (MRK) 和 Accton Technology Corporation (2345.TW) 的相迄度為: 0.60204 Johnson &amp; Johnson (JNJ) 和 Synnex Technology International Corporation (2347.TW) 的相迄度為: 0.63265 Pfizer Inc. (PFE) 和 Synnex Technology International Corporation (2347.TW) 的相迄度為: 0.60204 Walgreens Boots Alliance, Inc. (WBA) 和 Synnex Technology International Corporation (2347.TW) 的相迄度為: 0.61 NIKE, Inc. (NKE) 和 Synnex Technology International Corporation (2347.TW) 的相迄度為: 0.60606 The Home Depot, Inc. (HD) 和 RITEK Corporation (2349.TW) 的相迄度為: 0.61224 General Electric Company (GE) 和 RITEK Corporation (2349.TW) 的相迄度為: 0.62245 UnitedHealth Group Incorporated (UNH) 和 RITEK Corporation (2349.TW) 的相迄度為: 0.60606 Weibo Corporation (WB) 和 Acer Incorporated (2353.TW) 的相迄度為: 0.6 Caterpillar Inc. (CAT) 和 Acer Incorporated (2353.TW) 的相迄度為: 0.60204 General Motors Company (GM) 和 Inventec Corporation (2356.TW) 的相迄度為: 0.60606 Ford Motor Company (F) 和 ASUSTeK Computer Inc. (2357.TW) 的相迄度為: 0.68367 General Electric Company (GE) 和 ASUSTeK Computer Inc. (2357.TW) 的相迄度為: 0.60204 The Procter &amp; Gamble Company (PG) 和 Solomon Technology Corporation (2359.TW) 的相迄度為: 0.61224 McDonald's Corporation (MCD) 和 Solomon Technology Corporation (2359.TW) 的相迄度為: 0.61224 Verizon Communications Inc. (VZ) 和 Chroma ATE Inc. (2360.TW) 的相迄度為: 0.60606 3M Company (MMM) 和 Chroma ATE Inc. (2360.TW) 的相迄度為: 0.61224 The Home Depot, Inc. (HD) 和 Chroma ATE Inc. (2360.TW) 的相迄度為: 0.68367 Berkshire Hathaway Inc. (BRK-B) 和 ) Fz(18px)">Clevo Co. (2362.TW) 的相迄度為: 0.61616 Verizon Communications Inc. (VZ) 和 Twinhead International Corp. (2364.TW) 的相迄度為: 0.64286 Oracle Corporation (ORCL) 和 Twinhead International Corp. (2364.TW) 的相迄度為: 0.60204 AT&amp;T Inc. (T) 和 Twinhead International Corp. (2364.TW) 的相迄度為: 0.5567 HP Inc. (HPQ) 和 Twinhead International Corp. (2364.TW) 的相迄度為: 0.60204 Xilinx, Inc. (XLNX) 和 Twinhead International Corp. (2364.TW) 的相迄度為: 0.61224 NIKE, Inc. (NKE) 和 Twinhead International Corp. (2364.TW) 的相迄度為: 0.60204 Pfizer Inc. (PFE) 和 KYE Systems Corp. (2365.TW) 的相迄度為: 0.62887 General Electric Company (GE) 和 Unitech Printed Circuit Board Corp. (2367.TW) 的相迄度為: 0.64286 Caterpillar Inc. (CAT) 和 Unitech Printed Circuit Board Corp. (2367.TW) 的相迄度為: 0.61224 The Travelers Companies, Inc. (TRV) 和 Unitech Printed Circuit Board Corp. (2367.TW) 的相迄度為: 0.61616 ASML Holding N.V. (ASML) 和 Lingsen Precision Industries, Ltd. (2369.TW) 的相迄度為: 0.62626 Walgreens Boots Alliance, Inc. (WBA) 和 Lingsen Precision Industries, Ltd. (2369.TW) 的相迄度為: 0.61 . . . ``` 因為抓資料的網頁很常更新,所以我當初沒有限制相迄度,讓他全部都跑出來,然後將資料加入word檔,這樣如果更新抓不到資料才知道重哪邊繼續,當全部都跑完之後,再對word進行資料分析 ```python= biggersix = [] biggersixfive = [] biggersixsix = [] biggersixseven = [] biggersixeight = [] biggersixnine = [] biggerseven = [] from docx import Document doc = Document("McDonald.docx") for i in range(len(doc.paragraphs)): paragraph = doc.paragraphs[i] ha = [] runs = paragraph.runs if len(runs) != 0 : if float(runs[len(runs)-1].text[2:]) >0.6: for i in range(len(runs)): ha.append(runs[i].text) biggersix.append(ha) if float(runs[len(runs)-1].text[2:]) >=0.65 and float(runs[len(runs)-1].text[2:]) <0.66: biggersixfive.append(ha) if float(runs[len(runs)-1].text[2:]) >=0.66 and float(runs[len(runs)-1].text[2:]) <0.67: biggersixsix.append(ha) if float(runs[len(runs)-1].text[2:]) >=0.67 and float(runs[len(runs)-1].text[2:]) <0.68: biggersixseven.append(ha) if float(runs[len(runs)-1].text[2:]) >=0.68 and float(runs[len(runs)-1].text[2:]) <0.69: biggersixeight.append(ha) if float(runs[len(runs)-1].text[2:]) >=0.69 and float(runs[len(runs)-1].text[2:]) <0.7: biggersixnine.append(ha) if float(runs[len(runs)-1].text[2:]) >=0.7 : biggerseven.append(ha) ``` 以大於0.66小於0.67為例 ![](https://i.imgur.com/hHG2072.png) 不好看 ```python= def sortthedata(data,sortdataname):#照大小排列 max_= [] for i in range(len(data)): max_.append(data[i][4]) for i in sorted(max_): for j in range(len(data)): if i in data[j] != False: if data[j]not in sortdataname: sortdataname.append(data[j]) ``` ```python= sortbiggersixfive=[] sortbiggersixsix=[] sortbiggersixseven=[] sortbiggersixeight = [] sortbiggersixnine=[] sortbiggerseven=[] sortthedata(biggersixfive,sortbiggersixfive) sortthedata(biggersixsix,sortbiggersixsix) sortthedata(biggersixseven,sortbiggersixseven) sortthedata(biggersixeight,sortbiggersixeight) sortthedata(biggersixnine,sortbiggersixnine) sortthedata(biggerseven,sortbiggerseven) ``` ![](https://i.imgur.com/BvCuQ4S.png) 還是不好看 ```python= biggersix1 = [] biggersixfive1 = [] biggersixsix1 = [] biggersixseven1 = [] biggersixeight1 = [] biggersixnine1 = [] biggerseven1 = [] allpersent = [sortbiggersix,sortbiggersixfive,sortbiggersixsix,sortbiggersixseven,sortbiggersixeight,sortbiggersixnine,sortbiggerseven] newallpersent = [biggersix1,biggersixfive1,biggersixsix1,biggersixseven1,biggersixeight1,biggersixnine1,biggerseven1] l = 1 for j in range(len(allpersent)): for i in range(len(allpersent[j])): if l == 1: str4 = "".join(allpersent[j][i]) newallpersent[j].append(str4) ``` ```python= biggersixfive1,biggersixsix1,biggersixseven1,biggersixeight1,biggersixnine1 ``` ![](https://i.imgur.com/5TkduDO.png) ## :hear_no_evil:結論 早上9點前起床可以看一下上面相似度高的美股,如果漲,就買進台股進行當沖,希望可以賺到生活費:smirk: ## 解決不完美的地方... 上面抓取台灣股票代碼時,因為不需要中文,所以沒有處理中文編碼,下面將之處理好 ```python= import requests import urllib as ur from bs4 import BeautifulSoup import pandas allstocknumberurl = 'https://www.tej.com.tw/webtej/doc/uid.htm' res = requests.get(allstocknumberurl) soup = BeautifulSoup(res.text, "html.parser") c = soup.prettify() d=pandas.read_html(c) d ``` ![](https://i.imgur.com/7hnb1fo.png) ```python= soup ``` ![](https://i.imgur.com/ccKIKEi.png) ```python= res.encoding = 'big5'#換輸入編碼 res.text ``` ![](https://i.imgur.com/SAs62Ub.png) ```python= from bs4 import BeautifulSoup soup = BeautifulSoup(res.text,'lxml') soup ``` ![](https://i.imgur.com/ci1TAVe.png) ```python= c = soup.prettify() d=pandas.read_html(c) d ``` ![](https://i.imgur.com/IIUbzen.png) 成功了!!