ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¥æ©ö¶i¦æ¤¤ªº1¤ÀÄÁªÑ»ù¬ö¿ý

[µo°Ý] ¥æ©ö¶i¦æ¤¤ªº1¤ÀÄÁªÑ»ù¬ö¿ý

¥æ©ö¶i¦æ¤¤ªº§Y®ÉªÑ»ù¸ê®Æ¡A°£¤F¥Î RTD ©Î DDE ¦Û¦æ°O¿ý¥~¡A
¬O§_¯à±q¨º¤@­Óºô¯¸¤U¸ü¨ú±o?
¨Ò¦p¤U­zºô¯¸¥u´£¨Ñ 50µ§ ¨C5¬íªº¥æ©ö¶i¦æ¤¤§Y®Éªº¬ö¿ý¸ê®Æ
https://tw.stock.yahoo.com/q/ts?s=2330&t=50
°²¦p¯à¤@¤U¤l¨ú±o±q·í¤Ñ¤@¶}©l 9::00AM ¨ì ²{¦b®É¨èªº¬ö¿ý¸ê®Æ´N¤Ó¦n¤F¡A¤£¥²¨Æ¥ý³]©w¨º¤@ÀɤÎ3¤ÀÄÁ§ó·s²Ö¿n¸ê®Æ

½Ð¤j®v­Ì«ü¾É
ÁÂÁÂ

¥»©«³Ì«á¥Ñ GBKEE ©ó 2018-9-3 16:27 ½s¿è

¦^´_ 1# Scott090
¨S¹ê»Ú°õ¦æ¾ã¤Ñ¦æ±¡¹L,½Ð¦Û¦æ´ú¸Õ
  1. Option Explicit
  2. Sub EX()  'Àɮ׶}±Ò®É½Ð«ü©w°õ¦æ¦¹µ{¦¡
  3.     If Time < #9:00:00 AM# Then
  4.         Application.OnTime #9:00:00 AM#, "Ex_yahoo"
  5.     ElseIf Time <= #2:30:00 PM# Then
  6.         Ex_yahoo
  7.     End If
  8. End Sub
  9. Sub Ex_yahoo()
  10.     Dim oXmlhttp As Object, oHtmldoc As Object, E As Object
  11.     Dim R As Integer, RR As Integer, C As Integer, xTime As Double
  12.     If Time <= #2:30:00 PM# Then Application.OnTime #12:05:00 AM#, "Ex_yahoo"   '5¤ÀÄÁ«á¦A«×°õ¦æ
  13.     Set oXmlhttp = CreateObject("msxml2.xmlhttp")
  14.     Set oHtmldoc = CreateObject("htmlfile")
  15.     With oXmlhttp
  16.         .Open "Get", "https://tw.stock.yahoo.com/q/ts?s=2330&t=50", False
  17.         .Send
  18.         oHtmldoc.write .responseText
  19.     End With
  20.     With Sheets("¤u§@ªí1")
  21.         Set E = oHtmldoc.all.tags("table")(6)
  22.         If .[a1] <> E.Rows(0).Cells(0).innertext & "-" & E.Rows(0).Cells(1).innertext Then
  23.             .Cells.Clear
  24.             .[a1] = E.Rows(0).Cells(0).innertext & "-" & E.Rows(0).Cells(1).innertext
  25.         End If
  26.         Set E = oHtmldoc.all.tags("table")(7)
  27.         If .[a2] = "" Then
  28.             For C = 0 To E.Rows(0).Cells.Length - 1
  29.                 .Cells(2, C + 1) = E.Rows(0).Cells(C).innertext
  30.             Next
  31.         End If
  32.         For R = E.Rows.Length - 1 To 1 Step -1
  33.             xTime = TimeValue(E.Rows(R).Cells(0).innertext)
  34.             If IsError(Application.Match(xTime, .[A:A], 0)) Then
  35.                 RR = Application.CountA(.[A:A]) + 1
  36.                 For C = 0 To E.Rows(R).Cells.Length - 1
  37.                 .Cells(RR, C + 1) = E.Rows(R).Cells(C).innertext
  38.                 Next
  39.             End If
  40.         Next
  41.     End With
  42.     Set oXmlhttp = Nothing
  43.     Set oHtmldoc = Nothing
  44.    
  45. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE


    ·PÁÂG¤jªº«ü¾É
­ìµ{¦¡½X¥u¯à¨ú±o¤@µ§9:00 AM ªº¸ê®Æ¡A¥H«á´N³£¤@¼Ë¤£·|ÅܤơC
°µ¤F¤@ÂI­×¹¢¦p¤U¡A´N¥i¨ú±oÀ³¦³ªº¸ê®Æ¡A­ì¦]¤£ª¾¡G
With oXmlhttp
        .Open "Get", "https://tw.stock.yahoo.com/q/ts?s=2330&t=50", False
' ¼W¥[¤U¦C»y¥y©l¯à§ó·s¨ú±oÀ³¦³¸ê®Æ
'==============================
'            .setRequestHeader "Referer", URL
'            .setRequestHeader "Cache-Control", "no-cache"
'            .setRequestHeader "Pragma", "no-cache"
'            .setRequestHeader "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"
'===============================
        .Send
        oHtmldoc.write .responseText
    End With

«ùÄò´ú¸Õ¤¤¡C

­ì¥»¬I§Æ±æ¯à±q­Óºô¯¸ª½±µ¨ú±o·í¤Ñ½L¤¤¥æ©öªº§Y®É¸ê®Æ(9:00 AM¶}©lªº©Ò¦³¸ê®Æ)¡A¦Ó¤£¬O¤ù¬qªº¨ú±o¦A¨Ó²Ö¿n¸ê®Æ

¦A¦¸ªº·P®¦

TOP

¦^´_ 2# GBKEE


    "  xTime = TimeValue(E.Rows(R).Cells(0).innertext)
            If IsError(Application.Match(xTime, .[A:A], 0)) Then  "

     ¸ÕÅ窺µ²ªGÅã¥Ü®É¶¡ªº¤ñ¹ï¨Ã¤£¯à§¹¥þ±Æ°£¸ê®Æªº­«½Æ¡C
   ÁÙ³´¦b¤­¨½Ãú¤¤¤£±o¨ä¸Ñ¡C

¬ß GBKEE ¤jµ¹¤©¤@Áu¤§¤O¡AµL­­·P®¦

TOP

¦^´_ 2# GBKEE


     "  xTime = TimeValue(E.Rows(R).Cells(0).innertext)
            If IsError(Application.Match(xTime, .[A:A], 0)) Then  "

          ¥Î®É¶¡·§©À¥h°µ¤ñ¹ï´N¨S¦³°µ¥X¥¿½Tªºµ²ªG
          ¦]¦¹§âxTime §ï¬° ¦r¦ê¡G
              dim xTime$
         xTime = "#" & E.Rows(R).Cells(0).innertext & "#"
            If IsError(Application.Match(xTime, .[A:A], 0)) Then  "
            
          ·íµM¤]§â®É¶¡¦r¦ê©ñ¨ìÀx¦s®æ¤º¡G
          RR = Application.CountA(.[A:A]) + 1
                .Cells(RR, 1) = xTime
                For C = 1 To E.Rows(R).Cells.Length - 1
                        .Cells(RR, C + 1) = E.Rows(R).Cells(C).innertext
                Next

        ³o¼Ë¡A°ÝÃD´N¸Ñ¨M¤F
      
¥t¡AApplication.OnTime  ­×¹¢¦p¤U¡G
          If Time <= #2:30:00 PM# Then Application.OnTime  Now + #12:04:00 AM#, "Ex_yahoo"   '4¤ÀÄÁ«á¦A«×°õ¦æ
      
          ¦A¦¸·P®¦ GBKEE ¤j¤j

TOP

http://webrtqt.fortunengine.com.tw/rtdata/k-chart/1min-2330.txt?ts=1526775289018
³o¸Ì´£¨Ñ 1 ¤ÀÄÁ½L¤¤¥æ©ö¸ê®Æ

TOP

        ÀR«ä¦Û¦b : Ãø¦æ¯à¦æ¡AÃø±Ë¯à±Ë¡AÃø¬°¯à¬°¡A¤~¯àª@µØ¦Û§Úªº¤H®æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD