回復 29#GBKEE把
[台指期]刪除...如此改對嗎?
'Sheets("策略記錄").[b10:i10] 分別是以下的DEE
'[多空力道][反向勢力][主力控盤][摩台指][韓國綜合][日經指數]
End With
End If
End Sub作者: GBKEE 時間: 2012-12-9 14:59
'If (HHMM < 845 Or HHMM > 1345) Then Exit Sub '營業時間才執行
If Time < #9:00:00 AM# Or Time > #1:30:00 PM# Then Exit Sub '營業時間才執行
※上面二行[營業時間才執行]時間未何不一致?
If Second(Time) Mod 30 = 0 Then '間隔30秒
'If Second(Time) Mod 5 = 0 Then '間隔5秒 10秒 15秒 ....
※上面二行如我需要1分,是否二行都要改 Mod 60 = 0 Then,間隔60秒
This Workbook已改成;
'Sheets("策略記錄").[b10:g10] 分別是以下的DEE
'[多空力道][反向勢力][主力控盤][摩台指][韓國綜合][日經指數]作者: f3202 時間: 2012-12-9 20:12
Private Sub Workbook_Open()
Sheets("策略記錄").Cells(4, 2) = 10
LastMin = Minute(Time)
Call Timer
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:01"), "ThisWorkbook.Timer", , False
End Sub
Public Sub Timer()
Dim Pos As Integer, i As Integer, RangeStr As String
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:01"), "ThisWorkbook.Timer" '每秒顯示
Sheets("策略記錄").Cells(3, 2) = Time '將時間show至策略的b3欄位
Dim HHMM As Integer
HHMM = Hour(Time) * 100 + Minute(Time)
If (HHMM < 845 Or HHMM > 2045) Then Exit Sub '營業時間才執行
If Minute(Time) <> LastMin Then '開始後做
With Sheets("策略記錄")
.Cells(4, 2) = .Cells(4, 2) + 1 '將變動行號加一行
Pos = .Cells(4, 2)
.Cells(Pos, 1) = Time
.Cells(Pos, 2) = .Cells(2, 2)
.Cells(Pos, 3) = .Cells(2, 3)
.Cells(Pos, 4) = .Cells(2, 4)
.Cells(Pos, 5) = .Cells(2, 5)
.Cells(Pos, 6) = .Cells(2, 6)
.Cells(Pos, 7) = .Cells(2, 7)
.Cells(Pos, 8) = .Cells(2, 8)
.Cells(Pos, 9) = .Cells(2, 9)
.Cells(Pos, 10) = .Cells(2, 10)
.Cells(Pos, 11) = .Cells(2, 11)
End With
LastMin = Minute(Time)
End If
End Sub作者: c_c_lai 時間: 2013-1-20 15:48
回復 72#winwin
你把 Dim O5v As Single, H5v As Single, L5v As Single, C5v As Single 相關語句移除
拿掉,不管是 一分 或者是 五分,全都帶入Ov, Hv, Lv, Cv, 因為當時之價量是一樣的。
太多的 IF 也未必是好的處裡, 徒增 CPU 耗時過濾。
然後再試試看。作者: winwin 時間: 2017-12-12 23:53