績效如下:
程式寫法如下:
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;
大大這程式好像有問題在TS不能通過
回覆刪除錯誤訊息在什麼地方?因為我是直接從 TS 那邊剪過來的..應該不會有問題才是..
回覆刪除if close[value1] // 這邊條件不見了//
回覆刪除longline = open[value1];
shortline = close[value1];
被系統吃掉了..感謝提醒..
回覆刪除感謝大大經常發佈一些好的文章程式能否請大大再發佈急跌急漲突破策略這程式好像有問題在TS不能通過.謝謝!!!!!!
回覆刪除我 verify 的結果是有通過的喔…你要不要再檢查一下..
回覆刪除