套利雙開的問題? [金字塔]
- 咨詢內容:
symbol1:='p00';
symbol2:='y00';
lots1:=1;
lots2:=1;
c1:="p00$close";
c2:="y00$close";
diff:=c1-c2;
//加主體var1:=ref(diff,1);
var2:=ref(diff,p1);
var3:=abs(diff-var2);
var4:=abs(diff-var1);
var5:=sum(var4,p1);
var6:=var3/var5;
var7:=var6*p2/100;
var8:=var7*var7;
ls1:dma(diff,var8),noaxis;ls2:=ma(ls1,30);
bp1:=ls1;
bp2:=ls2;
sp1:=ls2;
sp2:=ls1;
//開平倉
a1:=cross(bp1,bp2);
b1:=cross(sp1,sp2);if stricmp(stklabel,symbol1)=0 then
begin
if holding=0 then begin
if a1 then buy(1,lots1,market);
end
if holding=0 then begin
if b1 then buyshort(1,1,market);
end
if holding>0 then begin
if b1 then begin
sell(1,1,market);
buyshort(1,1,market);
end
end
if holding<0 then begin
if a1 then begin
sellshort(1,1,market);
buy(1,1,market);
end
end
end
if stricmp(stklabel,symbol2)=0 then
begin
if holding=0 then begin
if b1 then buy(1,lots2,market);
end
if holding=0 then begin
if a1 then buyshort(1,lots2,market);
end
if holding>0 then begin
if a1 then begin
sell(1,lots2,market);
buyshort(1,lots2,market);
end
end
if holding<0 then begin
if b1 then begin
sellshort(1,lots2,market);
buy(1,lots2,market);
end
end
end// 這樣寫有什么問題么? 交易次數測試出來的不一樣,求修改!!!!
- 金字塔客服:
數據有沒有補全?兩個品種的測試數據長度是不是一樣的?有沒有在測試時間段那里,勾選 嚴格按照日期?
怎么測評的?帖一下測試步驟,不一樣的結果也貼一下?
- 用戶回復:
以下是引用jinzhe在2013/12/17 8:50:22的發言:
數據有沒有補全?兩個品種的測試數據長度是不是一樣的?有沒有在測試時間段那里,勾選 嚴格按照日期?
怎么測評的?帖一下測試步驟,不一樣的結果也貼一下?
ok了,謝啦,是數據的問題。
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容