Re: [問題] hts語法
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/
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 124.8.2.120
→
02/20 19:05, , 1F
02/20 19:05, 1F
討論串 (同標題文章)
Trading 近期熱門文章
39
107
PTT職涯區 即時熱門文章