"冠軍系統寫法?"
想法如下:
60分鐘的第二根K棒開於第一根之內
則突破第一根K棒高點則買進
則跌破第一根K棒低點則賣出
一篇滿久的文章,2007年的問題
這是個很簡單的交易策略,雖然板上已經有寫出答案,但是這
個答案似乎跟上面想法有點出入,因此在這裡將上面的想法利
用TS回測,並將想法修正成5K線:
開盤60分鐘後,9:45時開於前60分鐘高低點內
則突破高點則買進
則跌破低點則賣出
測試時間:2001.01.01 ~ 2008.08.08
交易成本:2000元/筆


加上交易成本後,這程式還滿糟糕的,而且交易次數有點大,若能用
在其他的濾網過濾掉一些盤整情況,至少能夠讓績效便成正數吧!
TS程式碼,應用於5K線上
vars: HL(0), LL(0), flag(0);
if date[1] <> date[0] then
flag = 0;
if time = 0945 then begin
HL = highest(high, 12);
LL = lowest(low, 12);
end;
if time = 0945 and close < HL and close > LL then
flag = 1;
If time >= 0945 and time < 1330 and flag = 1 then begin
buy("B") 1 contract HL stop;
sell("S") 1 contract LL stop;
end;
If time=1335 and CurrentContracts <> 0 then begin
exitlong("EL") this bar on close;
exitshort("ES") this bar on close;
end;
HTS程式碼,應用於5K線上
vars: HL(0), LL(0), flag(0)
if date[1] <> date[0] then
flag = 0
if time = 094500 then
HL = highest(high, 12)
LL = lowest(low, 12)
end if
if time = 094500 and close < HL and close > LL then
flag = 1
If time >= 094500 and time < 133000 and flag = 1 then
buy("B") 1 contract HL stop
sell("S") 1 contract LL stop
end if
If time=133500 and CurrentContracts <> 0 then
exitlong("EL") this bar on close
exitshort("ES") this bar on close
end if
沒有留言:
張貼留言