套利雙開的問題? [金字塔]
- 咨詢內(nèi)容:
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// 這樣寫有什么問題么? 交易次數(shù)測試出來的不一樣,求修改?。。?!
- 金字塔客服:
數(shù)據(jù)有沒有補(bǔ)全?兩個品種的測試數(shù)據(jù)長度是不是一樣的?有沒有在測試時間段那里,勾選 嚴(yán)格按照日期?
怎么測評的?帖一下測試步驟,不一樣的結(jié)果也貼一下?
- 用戶回復(fù):
以下是引用jinzhe在2013/12/17 8:50:22的發(fā)言:
數(shù)據(jù)有沒有補(bǔ)全?兩個品種的測試數(shù)據(jù)長度是不是一樣的?有沒有在測試時間段那里,勾選 嚴(yán)格按照日期?
怎么測評的?帖一下測試步驟,不一樣的結(jié)果也貼一下?
ok了,謝啦,是數(shù)據(jù)的問題。
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 1145508240 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容