This commit is contained in:
louiscklaw
2025-01-31 19:27:58 +08:00
parent 9476a736d3
commit ce9a4aa9b3
313 changed files with 6340 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
Attribute VB_Name = "CheckLastRow"
Option Explicit
Function run()
Debug.Print "Helloworld CheckLastRow"
End Function

View File

@@ -0,0 +1,113 @@
Attribute VB_Name = "Config"
Global TARGET_SHEET As String
Global ROW_START As Integer
Global ChromiumBinaryPath As String
Global COL_STOCK_CODE As String
Global COL_STOCK_NAME As String
Global COL_STOCK_PRICE As String
Global COL_10_DAY_MOVING_AVERAGE As String
Global COL_20_DAY_MOVING_AVERAGE As String
Global COL_50_DAY_MOVING_AVERAGE As String
Global COL_100_DAY_MOVING_AVERAGE As String
Global COL_250_DAY_MOVING_AVERAGE As String
Global COL_P_E_RATIO_EXPECTED As String
Global COL_EARNINGS_PER_SHARE As String
Global COL_YIELD As String
Global COL_FUND_FLOW As String
Global COL_SHORT_SELLING_AMOUNT_RATIO_ As String
Global COL_RSI_10 As String
Global COL_RSI_14 As String
Global COL_RSI_20 As String
Global COL_MACD_8_17_DAYS As String
Global COL_MACD_12_25_DAYS As String
Global IDX_STOCK_CODE As Integer
Global IDX_STOCK_NAME As Integer
Global IDX_STOCK_PRICE As Integer
Global IDX_10_DAY_MOVING_AVERAGE As Integer
Global IDX_20_DAY_MOVING_AVERAGE As Integer
Global IDX_50_DAY_MOVING_AVERAGE As Integer
Global IDX_100_DAY_MOVING_AVERAGE As Integer
Global IDX_250_DAY_MOVING_AVERAGE As Integer
Global IDX_P_E_RATIO_EXPECTED As Integer
Global IDX_EARNINGS_PER_SHARE As Integer
Global IDX_YIELD As Integer
Global IDX_FUND_FLOW As Integer
Global IDX_SHORT_SELLING_AMOUNT_RATIO_ As Integer
Global IDX_RSI_10 As Integer
Global IDX_RSI_14 As Integer
Global IDX_RSI_20 As Integer
Global IDX_MACD_8_17_DAYS As Integer
Global IDX_MACD_12_25_DAYS As Integer
Global COL_RESULT As String
GLOBAL COL_10SMA_DIFF_20SMA AS STRING
GLOBAL COL_20SMA_DIFF_50SMA AS STRING
GLOBAL COL_50SMA_DIFF_100SMA AS STRING
GLOBAL COL_RSI10_DIFF_RSI14 AS STRING
GLOBAL COL_RSI10_DIFF_RSI20 AS STRING
Sub init()
ChromiumBinaryPath = "C:\Users\logic\AppData\Local\Chromium\Application\chrome.exe"
TARGET_SHEET = "Sheet1"
ROW_START = 11
COL_STOCK_CODE = "A"
COL_STOCK_NAME = "B"
COL_STOCK_PRICE = "C"
COL_10_DAY_MOVING_AVERAGE = "D"
COL_20_DAY_MOVING_AVERAGE = "E"
COL_50_DAY_MOVING_AVERAGE = "F"
COL_100_DAY_MOVING_AVERAGE = "G"
COL_250_DAY_MOVING_AVERAGE = "H"
COL_10SMA_DIFF_20SMA = "I"
COL_10SMA_DIFF_20SMA = "I"
COL_20SMA_DIFF_50SMA = "J"
COL_50SMA_DIFF_100SMA = "K"
COL_RSI10_DIFF_RSI14 = "T"
COL_RSI10_DIFF_RSI20 = "U"
COL_P_E_RATIO_EXPECTED = "L"
COL_EARNINGS_PER_SHARE = "M"
COL_YIELD = "N"
COL_FUND_FLOW = "O"
COL_SHORT_SELLING_AMOUNT_RATIO_ = "P"
COL_RSI_10 = "Q"
COL_RSI_14 = "R"
COL_RSI_20 = "S"
COL_MACD_8_17_DAYS = "V"
COL_MACD_12_25_DAYS = "W"
COL_RESULT = "AE"
IDX_STOCK_CODE = 0
IDX_STOCK_PRICE = 1
IDX_STOCK_NAME = 2
IDX_10_DAY_MOVING_AVERAGE = 4
IDX_20_DAY_MOVING_AVERAGE = 5
IDX_50_DAY_MOVING_AVERAGE = 6
IDX_100_DAY_MOVING_AVERAGE = 7
IDX_250_DAY_MOVING_AVERAGE = 8
IDX_P_E_RATIO_EXPECTED = 9
IDX_EARNINGS_PER_SHARE = 10
IDX_YIELD = 11
IDX_FUND_FLOW = 12
IDX_SHORT_SELLING_AMOUNT_RATIO_ = 13
IDX_RSI_10 = 14
IDX_RSI_14 = 15
IDX_RSI_20 = 16
IDX_MACD_8_17_DAYS = 17
IDX_MACD_12_25_DAYS = 18
End Sub

View File

@@ -0,0 +1,93 @@
Attribute VB_Name = "FetchAaStock"
Function run(stock_num As Integer)
' On Error GoTo eh
Dim fetch_result(0 To 22) As String
Dim driver As New ChromeDriver
driver.SetBinary ChromiumBinaryPath
driver.AddArgument "--disable-blink-features=AutomationControlled"
driver.Start
' ' driver.execute_script("Object.defineProperty(navigator, 'webdriver', {get: () => undefined})")
' ' driver.ExecuteScript "alert('helloworld')"
driver.ExecuteScript "Object.defineProperty(navigator, 'webdriver', {get: () => undefined})"
' ' driver.Get "http://localhost:8080/navigator_webdriver_test.html"
' ' https://intoli.com/blog/not-possible-to-block-chrome-headless/chrome-headless-test.html
' driver.Get "https://intoli.com/blog/not-possible-to-block-chrome-headless/chrome-headless-test.html"
' driver.ExecuteScript "Object.defineProperty(navigator, 'webdriver', {get: () => undefined})"
driver.Get "http://www.aastocks.com"
' driver.ExecuteScript "console.log('hello excel')"
driver.ExecuteScript "document.querySelector('#sb-txtSymbol-aa').value = '" & stock_num & "'"
driver.ExecuteScript "document.querySelector('#sb-btnSubmit').click()"
driver.ExecuteScript "document.querySelectorAll('span.float_l')[6].click()"
Debug.Print driver.ExecuteScript("{ return 'helloworld from chrome' }")
' stock_Name # Name
fetch_result(IDX_STOCK_NAME) = driver.ExecuteScript("{ return document.querySelector('#SQ_Name').textContent.trim() }")
' stock_Price # Price
fetch_result(IDX_STOCK_PRICE) = driver.ExecuteScript("{ return document.querySelector('#labelLast').textContent.trim() }")
' 10_day_Moving_Average # 10????
fetch_result(IDX_10_DAY_MOVING_AVERAGE) = driver.ExecuteScript("{ return document.querySelectorAll('.content.comm-panel.dq-panel')[1].querySelectorAll('tr')[1].querySelectorAll('td')[1].textContent.trim() }")
' 20_day_Moving_Average # 20????
fetch_result(IDX_20_DAY_MOVING_AVERAGE) = "20_day_Moving_Average missing"
' 50_day_Moving_Average # 50????
fetch_result(IDX_50_DAY_MOVING_AVERAGE) = driver.ExecuteScript("{ return document.querySelectorAll('.content.comm-panel.dq-panel')[1].querySelectorAll('tr')[2].querySelectorAll('td')[1].textContent.trim() }")
' 100_day_Moving_Average # 100????
fetch_result(IDX_100_DAY_MOVING_AVERAGE) = driver.ExecuteScript("{ return document.querySelectorAll('.content.comm-panel.dq-panel')[1].querySelectorAll('tr')[3].querySelectorAll('td')[1].textContent.trim() }")
' 250_day_Moving_Average # 250????
fetch_result(IDX_250_DAY_MOVING_AVERAGE) = driver.ExecuteScript("{ return document.querySelectorAll('.content.comm-panel.dq-panel')[1].querySelectorAll('tr')[4].querySelectorAll('td')[1].textContent.trim() }")
' P_E_Ratio_Expected # ???/??
fetch_result(IDX_P_E_RATIO_EXPECTED) = driver.ExecuteScript("{ return document.querySelectorAll('#tbPERatio div')[5].textContent.trim() }")
' Yield # ???
fetch_result(IDX_YIELD) = driver.ExecuteScript("{ return document.querySelectorAll('.quote-box div')[19].textContent.trim() }")
' Fund_Flow # ????
fetch_result(IDX_FUND_FLOW) = driver.ExecuteScript("{ return document.querySelectorAll('.quote-box div')[29].textContent.trim() }")
' Short_Selling_Amount_Ratio_% # ???_??(%)
fetch_result(IDX_SHORT_SELLING_AMOUNT_RATIO_) = driver.ExecuteScript("{ return document.querySelectorAll('.quote-box div')[4].textContent.trim() }")
' RSI_10 # RSI 10
fetch_result(IDX_RSI_10) = driver.ExecuteScript("{ return document.querySelectorAll('.content.comm-panel')[7].querySelectorAll('table')[0].querySelectorAll('tr')[0].querySelector('.txt_r').textContent.trim() }")
' RSI_14 # RSI 14
fetch_result(IDX_RSI_14) = driver.ExecuteScript("{ return document.querySelectorAll('.content.comm-panel')[7].querySelectorAll('table')[0].querySelectorAll('tr')[1].querySelector('.txt_r').textContent.trim() }")
' RSI_20 # RSI 20
fetch_result(IDX_RSI_20) = driver.ExecuteScript("{ return document.querySelectorAll('.content.comm-panel')[7].querySelectorAll('table')[0].querySelectorAll('tr')[2].querySelector('.txt_r').textContent.trim() }")
' MACD_8_17_days # MACD(8_17 ?)
fetch_result(IDX_MACD_8_17_DAYS) = driver.ExecuteScript("{ return document.querySelectorAll('.content.comm-panel')[7].querySelectorAll('table')[0].querySelectorAll('tr')[2].querySelector('.txt_r').textContent.trim() }")
' MACD_12_25_days # MACD(12/25 ?)
fetch_result(IDX_MACD_12_25_DAYS) = driver.ExecuteScript("{ return document.querySelectorAll('.content.comm-panel')[7].querySelectorAll('table')[0].querySelectorAll('tr')[3].querySelector('.txt_r').textContent.trim() }")
' Application.Wait Now + TimeValue("00:30:01")
driver.Quit
run = fetch_result
Done:
' Debug.Print "hello done"
Exit Function
eh:
Debug.Print "hello error"
End Function

View File

@@ -0,0 +1,51 @@
Attribute VB_Name = "FetchEtnet"
Function run(stock_num As Integer)
' On Error GoTo eh
Dim fetch_result(0 To 22) As String
Dim driver As New ChromeDriver
driver.SetBinary ChromiumBinaryPath
driver.AddArgument "--disable-blink-features=AutomationControlled"
driver.Start
driver.ExecuteScript "Object.defineProperty(navigator, 'webdriver', {get: () => undefined})"
driver.Get "https://www.etnet.com.hk/www/tc/stocks/realtime/quote.php"
driver.ExecuteScript "document.querySelector('#quotesearch').value = '" & stock_num & "'"
driver.ExecuteScript "document.querySelector('#quotesearch_submit').click()"
'driver.ExecuteScript "document.querySelectorAll('span.float_l')[6].click()"
driver.FindElementByCss "#StkList", 30
' 10_day_Moving_Average # 10????
fetch_result(IDX_10_DAY_MOVING_AVERAGE) = driver.ExecuteScript("{ return document.querySelector('#StkList').querySelectorAll('li.value')[1].textContent.trim() }")
' 20_day_Moving_Average # 20????
fetch_result(IDX_20_DAY_MOVING_AVERAGE) = driver.ExecuteScript("{ return document.querySelector('#StkList').querySelectorAll('li.value')[3].textContent.trim() }")
' 50_day_Moving_Average # 50????
fetch_result(IDX_50_DAY_MOVING_AVERAGE) = driver.ExecuteScript("{ return document.querySelector('#StkList').querySelectorAll('li.value')[5].textContent.trim() }")
' 100_day_Moving_Average # 100????
fetch_result(IDX_100_DAY_MOVING_AVERAGE) = driver.ExecuteScript("{ return document.querySelector('#StkList').querySelectorAll('li.value')[7].textContent.trim() }")
' 250_day_Moving_Average # 250????
fetch_result(IDX_250_DAY_MOVING_AVERAGE) = driver.ExecuteScript("{ return document.querySelector('#StkList').querySelectorAll('li.value')[9].textContent.trim() }")
' Earnings_per_Share # ??????
fetch_result(IDX_EARNINGS_PER_SHARE) = driver.ExecuteScript("{ return document.querySelector('#StkList').querySelectorAll('li.value')[26].textContent.trim() }")
' Application.Wait Now + TimeValue("00:00:5")
run = fetch_result
Done:
' Debug.Print "hello done"
Exit Function
eh:
Debug.Print "hello error"
End Function

View File

@@ -0,0 +1,6 @@
Attribute VB_Name = "GetLastCheckRow"
Function run(first_row As Integer)
getLastCheckRow = first_row + 10
End Function

View File

@@ -0,0 +1,69 @@
Attribute VB_Name = "GetLastRow"
Function run(start_row As Integer)
On Error GoTo eh
Dim last_row As Boolean
Dim last_check_row As Integer
last_check_row = 9999
Dim scan_row As Integer
scan_row = start_row
Dim next_row_1 As Integer
Dim next_row_2 As Integer
Dim next_row_3 As Integer
Dim next_row_4 As Integer
Dim next_row_5 As Integer
For i = start_row To last_check_row
scan_row = i
last_row = True
next_row_1 = i + 1
next_row_2 = i + 2
next_row_3 = i + 3
next_row_4 = i + 4
next_row_5 = i + 5
cell_value_1 = ReadCellValue.run("A" & CStr(next_row_1))
cell_value_2 = ReadCellValue.run("A" & CStr(next_row_2))
cell_value_3 = ReadCellValue.run("A" & CStr(next_row_3))
cell_value_4 = ReadCellValue.run("A" & CStr(next_row_4))
cell_value_5 = ReadCellValue.run("A" & CStr(next_row_5))
If (cell_value_1 <> "") Then
last_row = False
ElseIf (cell_value_2 <> "") Then
last_row = False
ElseIf (cell_value_3 <> "") Then
last_row = False
ElseIf (cell_value_4 <> "") Then
last_row = False
ElseIf (cell_value_5 <> "") Then
last_row = False
Else
Debug.Print "done ?"
End If
If (last_row = True) Then
Debug.Print "last row found"
Exit For
End If
Next i
run = scan_row
Done:
Exit Function
eh:
Debug.Print "WriteStatus"
Debug.Print content
End Function

View File

@@ -0,0 +1,96 @@
Attribute VB_Name = "Helloworld"
Option Explicit
Dim rowc, cc, columnC As Integer
Dim last_row As Integer
Dim i As Integer
Dim stock_code As Integer
Dim temp As Variant
Dim etnet_temp As Variant
Sub helloworld()
' On Error GoTo eh
WriteStatus.run "init config"
Config.init
WriteStatus.run "init config done"
' find last row
last_row = GetLastRow.run(11)
'last_row = 23
Debug.Print last_row
For i = ROW_START To last_row
stock_code = CInt(ReadStockCode.run(i))
If (stock_code > -1) Then
temp = FetchAaStock.run(stock_code)
etnet_temp = FetchEtnet.run(stock_code)
' WriteStatus.run "updateing stock code " & CStr(stock_code) & "..."
' WriteStockName.run i, CStr(temp(IDX_STOCK_NAME))
Write_10DayMovingAverage.run i, CStr(etnet_temp(IDX_10_DAY_MOVING_AVERAGE))
Write_20DayMovingAverage.run i, CStr(etnet_temp(IDX_20_DAY_MOVING_AVERAGE))
Write_50DayMovingAverage.run i, CStr(etnet_temp(IDX_50_DAY_MOVING_AVERAGE))
Write_100DayMovingAverage.run i, CStr(etnet_temp(IDX_100_DAY_MOVING_AVERAGE))
Write_250DayMovingAverage.run i, CStr(etnet_temp(IDX_250_DAY_MOVING_AVERAGE))
WriteRsi_10.run i, CStr(temp(IDX_RSI_10))
WriteRsi_14.run i, CStr(temp(IDX_RSI_14))
WriteRsi_20.run i, CStr(temp(IDX_RSI_20))
WriteMACD_8_17Days.run i, CStr(temp(IDX_MACD_8_17_DAYS))
WriteMACD_12_25Days.run i, CStr(temp(IDX_MACD_12_25_DAYS))
WriteEarningsPerShare.run i, CStr(etnet_temp(IDX_EARNINGS_PER_SHARE))
WriteFundFlow.run i, CStr(temp(IDX_FUND_FLOW))
WritePERatioExpected.run i, CStr(temp(IDX_P_E_RATIO_EXPECTED))
WriteShortSellingAmountRatio.run i, CStr(temp(IDX_SHORT_SELLING_AMOUNT_RATIO_))
' WriteStockCode.run i, CStr(temp(IDX_STOCK_CODE))
WriteStockPrice.run i, CStr(temp(IDX_STOCK_PRICE))
WriteYield.run i, CStr(temp(IDX_YIELD))
WriteStockName.run i, CStr(temp(IDX_STOCK_NAME))
'calculation
' D-E
Write_10SMA_diff_20SMA.run i, CStr(etnet_temp(IDX_10_DAY_MOVING_AVERAGE) - etnet_temp(IDX_20_DAY_MOVING_AVERAGE))
' E-F
Write_20SMA_diff_50SMA.run i, CStr(etnet_temp(IDX_20_DAY_MOVING_AVERAGE) - etnet_temp(IDX_50_DAY_MOVING_AVERAGE))
' F-G
Write_50SMA_diff_100SMA.run i, CStr(etnet_temp(IDX_50_DAY_MOVING_AVERAGE) - etnet_temp(IDX_100_DAY_MOVING_AVERAGE))
' Q-R
Write_RSI10_diff_RSI14.run i, CStr(temp(IDX_RSI_10) - temp(IDX_RSI_14))
' Q-S
Write_RSI10_diff_RSI20.run i, CStr(temp(IDX_RSI_10) - temp(IDX_RSI_20))
WriteStatus.run "update stock code " & CStr(stock_code) & " done"
Else
WriteStockName.run i, CStr("stock code is empty")
End If
Next i
' debug.print test
WriteStatus.run "update all stock code done"
Done:
Worksheets(TARGET_SHEET).Columns("A:AZ").EntireColumn.AutoFit
Worksheets(TARGET_SHEET).Rows("11:9999").EntireRow.AutoFit
Debug.Print "hello done"
Exit Sub
eh:
Debug.Print "hello error"
End Sub

View File

@@ -0,0 +1,5 @@
Attribute VB_Name = "ReadCell"
Function run()
Debug.Print "run"
End Function

View File

@@ -0,0 +1,7 @@
Attribute VB_Name = "ReadCellValue"
Function run(cell_addr As String)
run = Worksheets(TARGET_SHEET).Range(cell_addr).Value
End Function

View File

@@ -0,0 +1 @@
Attribute VB_Name = "ReadEarningsPerShare"

View File

@@ -0,0 +1 @@
Attribute VB_Name = "ReadFundFlow"

View File

@@ -0,0 +1 @@
Attribute VB_Name = "ReadMACD_12_25Days"

View File

@@ -0,0 +1 @@
Attribute VB_Name = "ReadMacd_8_17Days"

View File

@@ -0,0 +1 @@
Attribute VB_Name = "ReadPERatioExpected"

View File

@@ -0,0 +1 @@
Attribute VB_Name = "ReadRsi_10"

View File

@@ -0,0 +1 @@
Attribute VB_Name = "ReadRsi_14"

View File

@@ -0,0 +1 @@
Attribute VB_Name = "ReadRsi_20"

View File

@@ -0,0 +1 @@
Attribute VB_Name = "ReadShortSellingAmountRatio"

View File

@@ -0,0 +1,23 @@
Attribute VB_Name = "ReadStockCode"
Option Explicit
Function run(row As Integer)
On Error GoTo eh
Dim temp As String
temp = Worksheets(TARGET_SHEET).Range(COL_STOCK_CODE & CStr(row)).Value
If (temp = "") Then
temp = -1
End If
run = temp
Done:
Exit Function
eh:
Debug.Print "ReadStockCode"
Debug.Print row
Debug.Print temp
End Function

View File

@@ -0,0 +1 @@
Attribute VB_Name = "ReadStockName"

View File

@@ -0,0 +1 @@
Attribute VB_Name = "ReadStockPrice"

View File

@@ -0,0 +1 @@
Attribute VB_Name = "ReadYield"

View File

@@ -0,0 +1 @@
Attribute VB_Name = "Read_100DayMovingAverage"

View File

@@ -0,0 +1,7 @@
Attribute VB_Name = "Read_10DayMovingAverage"
Option Explicit
Function run()
Debug.Print "Helloworld Read_10DayMovingAverage"
End Function

View File

@@ -0,0 +1 @@
Attribute VB_Name = "Read_20DayMovingAverage"

View File

@@ -0,0 +1 @@
Attribute VB_Name = "Read_250DayMovingAverage"

View File

@@ -0,0 +1,5 @@
Option Explicit
Sub helloworld()
Worksheets ("Sheet1")
End Sub

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "WriteEarningsPerShare"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_EARNINGS_PER_SHARE & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "WriteEarningsPerShare"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "WriteFundFlow"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_FUND_FLOW & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "WriteFundFlow"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "WriteMACD_12_25Days"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_MACD_12_25_DAYS & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "WriteMACD_12_25Days"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "WriteMACD_8_17Days"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_MACD_8_17_DAYS & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "WriteMACD_8_17Days"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "WritePERatioExpected"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_P_E_RATIO_EXPECTED & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "WritePERatioExpected"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "WriteRsi_10"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_RSI_10 & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "WriteRsi_10"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "WriteRsi_14"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_RSI_14 & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "WriteRsi_14"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "WriteRsi_20"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_RSI_20 & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "WriteRsi_20"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "WriteShortSellingAmountRatio"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_SHORT_SELLING_AMOUNT_RATIO_ & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "WriteShortSellingAmountRatio"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,16 @@
Attribute VB_Name = "WriteStatus"
Option Explicit
Function run(content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range("A1").Value = content
Done:
Exit Function
eh:
Debug.Print "WriteStatus"
Debug.Print content
End Function

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "WriteStockCode"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_STOCK_CODE & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "WriteStockCode"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "WriteStockName"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_STOCK_NAME & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "WriteStockName"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "WriteStockPrice"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_STOCK_PRICE & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "WriteStockPrice"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "WriteYield"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_YIELD & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "WriteYield"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "Write_100DayMovingAverage"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_100_DAY_MOVING_AVERAGE & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "Write_100DayMovingAverage"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "Write_10DayMovingAverage"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_10_DAY_MOVING_AVERAGE & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "Write_10DayMovingAverage"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,21 @@
Attribute VB_Name = "Write_10SMA_diff_20SMA"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_10SMA_DIFF_20SMA & CStr(row)).Value = content
Worksheets(TARGET_SHEET).Range(COL_10SMA_DIFF_20SMA & CStr(row)).NumberFormat = "0.000"
Done:
Exit Function
eh:
Debug.Print "Write_10DayMovingAverage"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "Write_20DayMovingAverage"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_20_DAY_MOVING_AVERAGE & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "Write_20DayMovingAverage"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,22 @@
Attribute VB_Name = "Write_20SMA_diff_50SMA"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_20SMA_DIFF_50SMA & CStr(row)).Value = content
Worksheets(TARGET_SHEET).Range(COL_20SMA_DIFF_50SMA & CStr(row)).NumberFormat = "0.000"
Done:
Exit Function
eh:
Debug.Print "Write_20SMA_diff_50SMA"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "Write_250DayMovingAverage"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_250_DAY_MOVING_AVERAGE & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "Write_250DayMovingAverage"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,17 @@
Attribute VB_Name = "Write_50DayMovingAverage"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_50_DAY_MOVING_AVERAGE & CStr(row)).Value = content
Done:
Exit Function
eh:
Debug.Print "Write_50DayMovingAverage"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,22 @@
Attribute VB_Name = "Write_50SMA_diff_100SMA"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_50SMA_DIFF_100SMA & CStr(row)).Value = content
Worksheets(TARGET_SHEET).Range(COL_50SMA_DIFF_100SMA & CStr(row)).NumberFormat = "0.000"
Done:
Exit Function
eh:
Debug.Print "Write_50SMA_diff_100SMA"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,22 @@
Attribute VB_Name = "Write_RSI10_diff_RSI14"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_RSI10_DIFF_RSI14 & CStr(row)).Value = content
Worksheets(TARGET_SHEET).Range(COL_RSI10_DIFF_RSI14 & CStr(row)).NumberFormat = "0.000"
Done:
Exit Function
eh:
Debug.Print "Write_RSI10_diff_RSI14"
Debug.Print row
Debug.Print content
End Function

View File

@@ -0,0 +1,22 @@
Attribute VB_Name = "Write_RSI10_diff_RSI20"
Option Explicit
Function run(row As Integer, content As String)
On Error GoTo eh
Worksheets(TARGET_SHEET).Range(COL_RSI10_DIFF_RSI20 & CStr(row)).Value = content
Worksheets(TARGET_SHEET).Range(COL_RSI10_DIFF_RSI20 & CStr(row)).NumberFormat = "0.000"
Done:
Exit Function
eh:
Debug.Print "Write_RSI10_diff_RSI20"
Debug.Print row
Debug.Print content
End Function