hts語法 - 財經
By Thomas
at 2009-02-20T06:59
at 2009-02-20T06:59
Table of Contents
※ 引述《r4444 (複雜)》之銘言:
: 請問如果要設定每逢禮拜三就在時間1325出場
: 那語法上要怎寫呢?
: 如果能提供每個月第三個禮拜三 time=1325
: 就出場的寫法就更好了.....^^
VAR:X(0)
IF DAYOFWEEK(DATE)=3 THEN
IF MOD(DAYOFMONTH(DATE),7)=0 THEN
X=FLOOR(DAYOFMONTH(DATE)/7)
ELSE
X=FLOOR(DAYOFMONTH(DATE)/7)+1
END IF
END IF
IF X=3 AND DAYOFWEEK(DATE)=3 THEN
IF TIME=132500 THEN EXITLONG EXITSHORT END IF
ELSE
IF TIME=134000 THEN EXITLONG EXITSHORT END IF
END IF
改編自
http://chired.blogspot.com/2008/10/1330.html
--
我的程式交易紀錄部落格
http://chired.blogspot.com/
--
: 請問如果要設定每逢禮拜三就在時間1325出場
: 那語法上要怎寫呢?
: 如果能提供每個月第三個禮拜三 time=1325
: 就出場的寫法就更好了.....^^
VAR:X(0)
IF DAYOFWEEK(DATE)=3 THEN
IF MOD(DAYOFMONTH(DATE),7)=0 THEN
X=FLOOR(DAYOFMONTH(DATE)/7)
ELSE
X=FLOOR(DAYOFMONTH(DATE)/7)+1
END IF
END IF
IF X=3 AND DAYOFWEEK(DATE)=3 THEN
IF TIME=132500 THEN EXITLONG EXITSHORT END IF
ELSE
IF TIME=134000 THEN EXITLONG EXITSHORT END IF
END IF
改編自
http://chired.blogspot.com/2008/10/1330.html
--
我的程式交易紀錄部落格
http://chired.blogspot.com/
--
Tags:
財經
All Comments
By Anonymous
at 2009-02-25T01:12
at 2009-02-25T01:12
Related Posts
hts語法
By Mary
at 2009-02-19T23:03
at 2009-02-19T23:03
hts語法
By John
at 2009-02-19T18:51
at 2009-02-19T18:51
如果我要在TS單純比較某四個固定時間的 …
By Lucy
at 2009-02-18T21:21
at 2009-02-18T21:21
換月的價差問題
By Andy
at 2009-02-18T17:57
at 2009-02-18T17:57
如果我要在TS單純比較某四個固定時間的值????
By Gilbert
at 2009-02-18T16:14
at 2009-02-18T16:14