|
本帖最後由 alexliou 於 13-9-4 14:16 編輯
crunchor 發表於 13-9-3 17:37
yes I understand, just using excel as database seem like having very different structure in the pr ...
Actually the author dose not use excel sheet as a database, he uses excell sheets as output interface to make users easily see the results. In most of the his examples, the input data is read from a text file into arrays. All intermediate results are stored in user-defined variables rather than cells in the excell sheets.
A stub of codes from that book is attached below for your reference.
Dim i As Single, j As Single
Dim Min_Bar(1000, 6) As Variant 'Time, O,H,L.C,V
Dim O As Single
Dim H As Single
Dim L As Single
Dim C As Single
Dim V As Single
Dim NP As Single
Sub 關閉DDE自動交易系統()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:02"), "ThisWorkBook.ExeSelf", , False
End Sub
Sub 啟動DDE自動交易系統()
Dim k As Single
j = 2
Application.OnTime TimeValue("08:45:00"), "ExeSelf"
'Call ExeSelf
End Sub
Private Sub ExeSelf()
On Error Resume Next
i = i + 1
If i = 58 Then ' i = 60
Sheets(2).Cells(j, 1) = Time
Sheets(2).Cells(j, 2) = O
Sheets(2).Cells(j, 3) = H
Sheets(2).Cells(j, 4) = L
Sheets(2).Cells(j, 5) = C
Sheets(2).Cells(j, 6)
.........
|
|