您现在的位置:程序化交易>> 期货公式>> 金字塔等>> 金字塔知识>>正文内容

求助编写错误 [金字塔]

咨询内容: 参数设置
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.CXH99.COM

金字塔资深技术: [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函数使用说明自行调整下。

  • 技术交流: 你们用一分钟玻摛连续回测一下,发现10月14日以来手数是一下子跳到7。跳到16
    不是慢慢倍增上来,所以说这才是错的

     

  • 技术交流: 如下图

    截图202110151637412643.png (148.26 KB, 下载次数: 578)

    下载附件

    2021-10-15 16:37 上传

  •  

    有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友

    可联系技术人员 QQ: 262069696  点击在线交流或微信号:cxh99cxh99  进行 有偿收费 编写!

    怎么收费,代编流程等详情请点击阅读!

    (注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)


    【字体: 】【打印文章】【查看评论

    相关文章

      没有相关内容