求助編寫錯誤 [金字塔]
咨詢內容:
參數設置
KD:c>ma10;
pd:C<MA10;
KK:=pd;
pk:=kd;
A1:=c-AVGENTERPRICE;
if A1>0 AND A1>Q1*MINDIFFTHEN
BEGIN
SELL(1,0,MARKET);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;
SELLSHORT(1,0,MARKET);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;
END
if A1<0 AND ABS(A1) >Q2*MINDIFFTHEN
BEGIN
SELL(1,0,MARKET);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;
SELLSHORT(1,0,MARKET);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;
END
if pd and HOLDING>0 then BEGIN
sell(1,ss,MARKET);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;
end
if pk and HOLDING<0 then BEGIN
sellshort(1,ss,MARKET);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;
end
if zz=1 then ss:=1;
if zz=2 then ss:=1;
if zz=3 then ss:=2;
if zz=4 then ss:=4;
if zz=5 then ss:=8;
if zz>=6 then ss:=16;
if KD and HOLDING=0 then BEGIN
BUY( 1,ss,MARKET);
end
if Kk and HOLDING=0 then BEGIN
BUYshort( 1,ss,MARKET);
end
參數默認值請參考input函數使用說明自行調整下。技術交流:
你們用一分鐘玻摛連續回測一下,發現10月14日以來手數是一下子跳到7。跳到16
不是慢慢倍增上來,所以說這才是錯的 技術交流:
如下圖
KD:c>ma10;
pd:C<MA10;
KK:=pd;
pk:=kd;
A1:=c-AVGENTERPRICE;
if A1>0 AND A1>Q1*MINDIFFTHEN
BEGIN
SELL(1,0,MARKET);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;
SELLSHORT(1,0,MARKET);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;
END
if A1<0 AND ABS(A1) >Q2*MINDIFFTHEN
BEGIN
SELL(1,0,MARKET);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;
SELLSHORT(1,0,MARKET);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;
END
if pd and HOLDING>0 then BEGIN
sell(1,ss,MARKET);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;
end
if pk and HOLDING<0 then BEGIN
sellshort(1,ss,MARKET);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;
end
if zz=1 then ss:=1;
if zz=2 then ss:=1;
if zz=3 then ss:=2;
if zz=4 then ss:=4;
if zz=5 then ss:=8;
if zz>=6 then ss:=16;
if KD and HOLDING=0 then BEGIN
BUY( 1,ss,MARKET);
end
if Kk and HOLDING=0 then BEGIN
BUYshort( 1,ss,MARKET);
end
?
?來源: www.kzuj.com.cn
金字塔資深技術: [PEL] 復制代碼INPUT:Q1(5,1,1000,1),Q2(5,1,1000,1),S(1,1,100,1); ma10:ma(c,10); SS:=S; KD:c>ma10; pd:C<MA10; KK:=pd; pk:=kd; A1:=c-AVGENTERPRICE; if A1>0 AND A1>Q1*MINDIFF THEN BEGIN SELL(1,0,MARKET); if NUMPROFIT(1)>0 then zz:=1; if NUMPROFIT(1)<0 then zz:=zz+1; SELLSHORT(1,0,MARKET); if NUMPROFIT(1)>0 then zz:=1; if NUMPROFIT(1)<0 then zz:=zz+1; END if A1<0 AND ABS(A1) >Q2*MINDIFF THEN BEGIN SELL(1,0,MARKET); if NUMPROFIT(1)>0 then zz:=1; if NUMPROFIT(1)<0 then zz:=zz+1; SELLSHORT(1,0,MARKET); if NUMPROFIT(1)>0 then zz:=1; if NUMPROFIT(1)<0 then zz:=zz+1; END if pd and HOLDING>0 then BEGIN sell(1,ss,MARKET); if NUMPROFIT(1)>0 then zz:=1; if NUMPROFIT(1)<0 then zz:=zz+1; end if pk and HOLDING<0 then BEGIN sellshort(1,ss,MARKET); if NUMPROFIT(1)>0 then zz:=1; if NUMPROFIT(1)<0 then zz:=zz+1; end if zz=1 then ss:=1; if zz=2 then ss:=1; if zz=3 then ss:=2; if zz=4 then ss:=4; if zz=5 then ss:=8; if zz>=6 then ss:=16; if KD and HOLDING=0 then BEGIN BUY( 1,ss,MARKET); end if Kk and HOLDING=0 then BEGIN BUYshort( 1,ss,MARKET); end
參數默認值請參考input函數使用說明自行調整下。
不是慢慢倍增上來,所以說這才是錯的
?
截圖202110151637412643.png (148.26 KB, 下載次數: 578)
下載附件
2021-10-15 16:37 上傳
有思路,想編寫各種指標公式,交易模型,選股公式,還原公式的朋友
可聯系技術人員 QQ: 262069696 或微信號:cxh99cxh99 進行 有償收費 編寫!
(注:由于人數限制,QQ或微信請選擇方便的一個聯系我們就行,加好友時請簡單備注下您的需求,否則無法通過。謝謝您!)
相關文章
-
沒有相關內容