hts語法 - 財經
By Mary
at 2009-02-19T23:03
at 2009-02-19T23:03
Table of Contents
if dayofweek(date)=3 and dayofmonth(date)>=14 and 21>=dayofmonth(date) then
condition1=true
else
condition1=false
end if
if condition1=false then
if currentcontracts>0 and time=134000 then
exitlong("EB-N") next bar at market
end if
if 0>currentcontracts and time=134000 then
exitshort("ES-N") next bar at market
end if
end if
if condition1=true then
if currentcontracts>0 and time=132500 then
exitlong("EB-C") next bar at market
end if
if 0>currentcontracts and time=132500 then
exitshort("ES-C") next bar at market
end if
end if
參考參考...
原文 http://skyelephant.blogspot.com/2008/12/15.html
不過開一個參數比較方便,要記得改結算日就是了
像下面這樣
if date = xxxxxxx and currentcontracts <> 0 and time = 1325 then
exitlong next bar at market
exitshot next bar at market
end if
※ 引述《r4444 (複雜)》之銘言:
: 請問如果要設定每逢禮拜三就在時間1325出場
: 那語法上要怎寫呢?
: 如果能提供每個月第三個禮拜三 time=1325
: 就出場的寫法就更好了.....^^
--
我的Blog - 大象飛上天
http://skyelephant.blogspot.com/
--
Tags:
財經
All Comments
By David
at 2009-02-20T04:01
at 2009-02-20T04:01
Related Posts
如果我要在TS單純比較某四個固定時間的值????
By Gilbert
at 2009-02-18T16:14
at 2009-02-18T16:14
換月的價差問題
By Emily
at 2009-02-18T09:52
at 2009-02-18T09:52
TS最佳化報告筆數和交易次數
By Hardy
at 2009-02-18T01:12
at 2009-02-18T01:12
新交易系統的構想
By Edith
at 2009-02-15T18:24
at 2009-02-15T18:24
Re: 請教轉檔
By Hamiltion
at 2009-02-15T16:19
at 2009-02-15T16:19