返回列表 上一主題 發帖

[發問] 日K開高低收轉換「週K」開高低收

回復 1# bill740615

這個是要抓大盤的周K資料嗎?
Excel VBA網頁資料收集教學:
http://forum.twbts.com/thread-20848-1-1.html

TOP

回復 3# bill740615
  1. Sub test()

  2. Cells.Clear

  3. 'stockno = InputBox("輸入股票代號")

  4. Dim t: t = Timer
  5. Dim myXML As Object
  6. Set myXML = CreateObject("Microsoft.XMLHTTP")

  7. Dim myArr(1 To 1500, 1 To 6)

  8. With myXML
  9.     .Open "GET", "http://jdata.yuanta.com.tw/Z/ZB/ZBH/CZKC0.djbcd?a=EB09999&b=W&c=1440", False
  10.     .send
  11.     myText = .responseText
  12. End With

  13.     myText1s = Split(myText, " ")
  14.     j = 1
  15.     For Each myText1 In myText1s
  16.         i = 1
  17.         myText2s = Split(myText1, ",")
  18.         For Each myText2 In myText2s
  19.             If j > 6 Then Exit For
  20.             myArr(i, j) = myText2
  21.             i = i + 1
  22.         Next
  23.         j = j + 1
  24.     Next

  25. [A2:F2] = Array("日期", "開", "高", "低", "收", "成交量")
  26. [A3].Resize(1500, 6).Value = myArr

  27. Set myXML = Nothing

  28. Debug.Print Format(Timer - t, "0.00秒")

  29. End Sub
複製代碼
Excel VBA網頁資料收集教學:
http://forum.twbts.com/thread-20848-1-1.html

TOP

回復 3# bill740615

這是我從券商資料那邊抓下來的,這樣有符合你的需求嗎?
Excel VBA網頁資料收集教學:
http://forum.twbts.com/thread-20848-1-1.html

TOP

回復 6# bill740615

我有在你的另外一個貼文"1分K轉換日K的開高低收"底下留抓取股價資料的程式碼
在inputbox那邊可以輸入股票代號
Excel VBA網頁資料收集教學:
http://forum.twbts.com/thread-20848-1-1.html

TOP

回復 8# bill740615

是的,當你執行程式時,應該會有一個輸入框跳出來,你只要輸入股票代號即可
Excel VBA網頁資料收集教學:
http://forum.twbts.com/thread-20848-1-1.html

TOP

回復 8# bill740615

應該不行,或者是你把可以查國外指數的網址給我,我再試試看可不可以做成這種模式
Excel VBA網頁資料收集教學:
http://forum.twbts.com/thread-20848-1-1.html

TOP

回復 11# Scott090

Scott大是指 http://jdata.yuanta.com.tw/Z/ZB/ZBH/CZKC0.djbcd?a=EB09999&b=W&c=1440 嗎?
Excel VBA網頁資料收集教學:
http://forum.twbts.com/thread-20848-1-1.html

TOP

回復 13# bill740615

你想抓的是國外指數?還是外國公司股價呢?
Excel VBA網頁資料收集教學:
http://forum.twbts.com/thread-20848-1-1.html

TOP

回復 13# bill740615

http://www.stockq.org/
這網站的資料OK嗎?
Excel VBA網頁資料收集教學:
http://forum.twbts.com/thread-20848-1-1.html

TOP

回復 16# Scott090

之前看到Scott大常常參與網路擷取資料相關的帖子,不知道您熟不熟悉Chrome開發人員工具呢?
因為我也是透過這工具找到的,所以想先了解您對於此工具的熟悉程度,才比較好講解
另外關於大盤的資料,後面那幾項我也不太清楚,也沒有查到相關的項目
Excel VBA網頁資料收集教學:
http://forum.twbts.com/thread-20848-1-1.html

TOP

        靜思自在 : 時時好心就是時時好日。
返回列表 上一主題