[TS懶人包] [保險服務]

2008年12月3日 星期三

程式交易 - 急跌急漲突破策略

又是個隨便亂想之下的產物…想法則是突破急漲急跌就進場…至於急漲急跌怎麼定義…目前是想到一根 k 線裡面的漲跌為 1% 來當作急漲急跌…也許還可以修改吧…至於績效…實在不怎麼樣…參考看看就好…

績效如下:



程式寫法如下:

inputs:length(0.01);
vars:longline(99999), shortline(0), count(0);

if date[1] <> date[0] then begin
longline = 99999;
shortline = 0;
count = 0;
end;

if time = 900.00 then begin
for value1 = 1 to 30 begin
if absvalue(close[value1]-open[value1]) > closed(1)*length then begin
if close[value1]>open[value1] then begin
longline = close[value1];
shortline = open[value1];
end;
if close[value1] < open[value1] then begin
longline = open[value1];
shortline = close[value1];
end;
end;
end;
end;

if time > 900.00 and time < 1300.00 and count = 0 then begin
if marketposition = 0 and close cross over longline then begin
buy ("b1") next bar at market;
count = 1;
end;
if marketposition = 0 and close cross under shortline then begin
sell ("s1") next bar at market;
count = 1;
end;
end;

if marketposition > 0 then begin
exitlong next bar at longline+(longline-shortline)*2 limit;
exitlong next bar at longline-(longline-shortline)/2 stop;
end;
if marketposition < 0 then begin
exitshort next bar at shortline-(longline-shortline)*2 limit;
exitshort next bar at shortline+(longline-shortline)/2 stop;
end;

if time = 1330.00 and marketposition <> 0 then begin
exitlong next bar at market;
exitshort next bar at market;
end;

6 則留言:

  1. 大大這程式好像有問題在TS不能通過

    回覆刪除
  2. 錯誤訊息在什麼地方?因為我是直接從 TS 那邊剪過來的..應該不會有問題才是..

    回覆刪除
  3. if close[value1] // 這邊條件不見了//
    longline = open[value1];
    shortline = close[value1];

    回覆刪除
  4. 被系統吃掉了..感謝提醒..

    回覆刪除
  5. 感謝大大經常發佈一些好的文章程式能否請大大再發佈急跌急漲突破策略這程式好像有問題在TS不能通過.謝謝!!!!!!

    回覆刪除
  6. 我 verify 的結果是有通過的喔…你要不要再檢查一下..

    回覆刪除

請留下您的大名…匿名者恕不回應…

Related Posts Plugin for WordPress, Blogger...