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

请老师帮忙修正!谢谢。 [金字塔]

  • 咨询内容: 为什么 有些位置 在同一根K线的蜡烛图上 同时显示开仓和平仓,  有些显示开仓的位置,与我思维完全不一致的,但有些位置是正确的??
    J日:=stkindi('','KDJ.J',0,6,-1),noaxis;CCI日:=stkindi('','CCI.CCI',0,6,-1),noaxis;
    J4:=stkindi('','KDJ.J',0,datatype,-1),noaxis;CCI4:=stkindi('','CCI.CCI',0,datatype,-1),noaxis;DIFF4:=stkindi('','MACD.DIFF',0,datatype,-1),noaxis;DEA4:=stkindi('','MACD.DEA',0,datatype,-1),noaxis;
    J41:=stkindi('','KDJ.J',0,datatype,-2),noaxis;CCI41:=stkindi('','CCI.CCI',0,datatype,-2),noaxis;DIFF41:=stkindi('','MACD.DIFF',0,datatype,-2),noaxis;DEA41:=stkindi('','MACD.DEA',0,datatype,-2),noaxis;
    J42:=stkindi('','KDJ.J',0,datatype,-3),noaxis;CCI42:=stkindi('','CCI.CCI',0,datatype,-3),noaxis;DIFF42:=stkindi('','MACD.DIFF',0,datatype,-3),noaxis;DEA42:=stkindi('','MACD.DEA',0,datatype,-3),noaxis;
    MAA4:=stkindi('','MA.MA1',0,datatype,-1) ,noaxis;MAB4:=stkindi('','MA.MA2',0,datatype,-1) ,noaxis;
    MAA41:=stkindi('','MA.MA1',0,datatype,-2) ,noaxis;MAB41:=stkindi('','MA.MA2',0,datatype,-2) ,noaxis;
    MAA42:=stkindi('','MA.MA1',0,datatype,-3) ,noaxis;MAB42:=stkindi('','MA.MA2',0,datatype,-3) ,noaxis;

    MACD4金叉:=DIFF41<DEA41 and DIFF4>DEA4;MACD4金叉1:=DIFF42<DEA42 and DIFF41>DEA41 and DIFF4>DEA4;MACD4金叉区:=DIFF42>DEA42 and DIFF41>DEA41 and DIFF4>DEA4;
    MACD4死叉:=DIFF41>DEA41 and DIFF4<DEA4;MACD4死叉1:=DIFF42>DEA42 and DIFF41<DEA41 and DIFF4<DEA4;MACD4死叉区:=DIFF42<DEA42 and DIFF41<DEA41 and DIFF4<DEA4;
    MA4金叉:=MAA41<MAB41 and MAA4> MAB4;MA4金叉1:= MAA42<MAB42 and MAA41> MAB41 and MAA4> MAB4;MA4金叉区:= MAA42> MAB42 and MAA41> MAB41 and MAA4> MAB4;
    MA4死叉:= MAA41>MAB41 and MAA4< MAB4;MA4死叉1:= MAA42>MAB42 and MAA41< MAB41 and MAA4< MAB4;MA4死叉区:= MAA42< MAB42 and MAA41< MAB41 and MAA4< MAB4;

    开多A条件1:=J4<95 and CCI4<260 AND J日<95 and CCI日<260;开多A1:=MACD4金叉 and 开多A条件1;
    开多A条件2:=MACD4金叉1 and abs(DIFF4-DEA4)>abs(DIFF41-DEA41)*1.05;开多A2:=开多A条件1 and 开多A条件2;
    开多A条件3:=MACD4金叉区 and (abs(DIFF4-DEA4)>abs(DIFF41-DEA41)*1.15 or abs(DIFF4-DEA4)>abs(DIFF42-DEA42)*1.15);开多A3:=开多A条件1 and 开多A条件3;
    开多A4:=开多A条件1 and  (MA4金叉 OR  MA4金叉1 );开多A5:=开多A条件1 and  MA4金叉区;

    开空A条件1:=J4>5 and CCI4>-260 AND J日>5 and CCI日>-260;开空A1:=MACD4死叉 and 开空A条件1;
    开空A条件2:=MACD4死叉1 and abs(DIFF4-DEA4)>abs(DIFF41-DEA41)*1.05;开空A2:=开空A条件1 and 开空A条件2;
    开空A条件3:=MACD4死叉区 and (abs(DIFF4-DEA4)>abs(DIFF41-DEA41)*1.15 or abs(DIFF4-DEA4)>abs(DIFF42-DEA42)*1.15);开空A3:=开空A条件1 and 开空A条件3;
    开空A4:=开空A条件1 and  (MA4死叉 OR  MA4死叉1 );开空A5:=开空A条件1 and  MA4死叉区;

    J:=stkindi('','KDJ.J',0,datatype);CCI:=stkindi('','CCI.CCI',0,datatype);DIFF:=stkindi('','MACD.DIFF',0,datatype);DEA:=stkindi('','MACD.DEA',0,datatype);J1:=stkindi('','KDJ.J',0,datatype,-1);CCI1:=stkindi('','CCI.CCI',0,datatype,-1);DIFF1:=stkindi('','MACD.DIFF',0,datatype,-1);DEA1:=stkindi('','MACD.DEA',0,datatype,-1);J2:=stkindi('','KDJ.J',0,datatype,-2);CCI2:=stkindi('','CCI.CCI',0,datatype,-2);DIFF2:=stkindi('','MACD.DIFF',0,datatype,-2);DEA2:=stkindi('','MACD.DEA',0,datatype,-2);
    MAA2:=stkindi('','MA.MA1',0,datatype);MAB2:=stkindi('','MA.MA2',0,datatype);
    MAA21:=stkindi('','MA.MA1',0,datatype,-1);MAB21:=stkindi('','MA.MA2',0,datatype,-1);
    MAA22:=stkindi('','MA.MA1',0,datatype,-2);MAB22:=stkindi('','MA.MA2',0,datatype,-2);

    MACD金叉:=DIFF1<DEA1 and DIFF>DEA;MACD金叉1:=DIFF2<DEA2 and DIFF1>DEA1 and DIFF>DEA;MACD金叉区:=DIFF2>DEA2 and DIFF1>DEA1 and DIFF>DEA;
    MACD死叉:=DIFF1>DEA1 and DIFF<DEA;MACD死叉1:=DIFF2>DEA2 and DIFF1<DEA1 and DIFF<DEA;MACD死叉区:=DIFF2<DEA2 and DIFF1<DEA1 and DIFF<DEA;
    MA2金叉:=MAA21<MAB21 and MAA2> MAB2;MA2金叉1:= MAA22<MAB22 and MAA21> MAB21 and MAA2> MAB2;MA2金叉区:= MAA22> MAB22 and MAA21> MAB21 and MAA2> MAB2;
    MA2死叉:= MAA21>MAB21 and MAA2< MAB2;MA2死叉1:= MAA22>MAB22 and MAA21< MAB21 and MAA2< MAB2;MA2死叉区:= MAA22< MAB22 and MAA21< MAB21 and MAA2< MAB2;
    xy:=if(c<o,c-l,o-l);sy:=if(c<O,h-o,h-c);pd:=if(c<o,h=o,h=c);
    开多B条件1:=J<95 and CCI<260;开多B1:=MACD金叉 and 开多B条件1;
    开多B条件2:=MACD金叉1 and abs(DIFF-DEA)>abs(DIFF1-DEA1)*1.05;开多B2:=开多B条件1 and 开多B条件2;
    开多B条件3:=MACD金叉区 and (abs(DIFF-DEA)>abs(DIFF1-DEA1)*1.15 or abs(DIFF-DEA)>abs(DIFF2-DEA2)*1.15);开多B3:=开多B条件1 and 开多B条件3;
    开多B4:=开多B条件1 and  (MA2金叉 OR  MA2金叉1 );开多B5:=开多B条件1 and  MA2金叉区;

    平多B1:=DIFF1>DEA1 and DIFF<DEA;平多B2:=DIFF2>DEA2 and DIFF<DEA;平多B3:= MAA21>MAB21 and MAA2< MAB2;平多B4:= MAA22>MAB22 and MAA2< MAB2;平多B5:=(ref (h,2)<ref(h,1) and ref (l,2)<ref(l,1)  and ref(sy>abs(c-o)*2.5 and (xy<=sy*0.5 or pd),1) and h<ref(h,1) and l<ref(l,1) and c<ref(l,1)) and MACD金叉区;平多B6:=(abs(DIFF-DEA)<abs(DIFF2-DEA2)*0.3 or abs(DIFF-DEA)<abs(DIFF1-DEA1)*0.3) and MACD金叉区;平多B7:=(abs(DIFF-DEA)>abs(DIFF2-DEA2)*1.7 or abs(DIFF-DEA)>abs(DIFF1-DEA1)*1.7) and MACD死叉区;
    开空B条件1:=J>5 and CCI>-260;开空B1:=MACD死叉 and 开空B条件1;
    开空B条件2:=MACD死叉1 and abs(DIFF-DEA)>abs(DIFF1-DEA1)*1.05;开空B2:=开空B条件1 and 开空B条件2;
    开空B条件3:=MACD死叉区 and (abs(DIFF-DEA)>abs(DIFF1-DEA1)*1.15 or abs(DIFF-DEA)>abs(DIFF2-DEA2)*1.15);开空B3:=开空B条件1 and 开空B条件3;
    开空B4:=开空B条件1 and  (MA2死叉 OR  MA2死叉1 );开空B5:=开空B条件1 and  MA2死叉区;


    平空B1:=DIFF1<DEA1 and DIFF>DEA;平空B2:=DIFF2<DEA2 and DIFF>DEA;平空B3:= MAA21<MAB21 and MAA2> MAB2;平空B4:= MAA22<MAB22 and MAA2> MAB2;平空B5:=(ref (l,1)<ref(l,2) and ref (h,1)<ref(h,2)  and ref(xy>abs(c-o)*2.5 and (sy<=xy*0.5 or pd),1) and l>ref(l,1) and h>ref(h,1) and c>ref(h,1)) and MACD死叉区;平空B6:=(abs(DIFF-DEA)<abs(DIFF2-DEA2)*0.3 or abs(DIFF-DEA)<abs(DIFF1-DEA1)*0.3) and MACD死叉区;平空B7:=(abs(DIFF-DEA)>abs(DIFF2-DEA2)*1.7 or abs(DIFF-DEA)>abs(DIFF1-DEA1)*1.7) and MACD金叉区;
    ss:=6;//下单手数为6
    if  开多B4  and  barslast(开多A1  OR 开多A2  OR  开多A3)>=0 then BEGIN  buy(holding=0,ss,marketr); playsound(1,'E:\金字塔软件\KP.WAV');   endif  (开多B1  OR 开多B2  OR  开多B3)  and  barslast(开多A4)>=0 then BEGIN buy(holding=0,ss,marketr); playsound(1,'E:\金字塔软件\KP.WAV');   endif  (开多B1  OR 开多B2)  and  barslast(开多A5)>=0 then BEGIN buy(holding=0,ss,marketr); playsound(1,'E:\金字塔软件\KP.WAV'); endif  开空B4 and barslast(开空A1  OR 开空A2  OR  开空A3)>=0 then BEGIN buyshort(holding=0,ss,marketr); playsound(1,'E:\金字塔软件\KP.WAV'); endif  (开空B1  OR 开空B2  OR  开空B3) and barslast(开空A4)>=0 then BEGIN  buyshort(holding=0,ss,marketr); playsound(1,'E:\金字塔软件\KP.WAV'); endif  (开空B1  OR 开空B2 ) and barslast(开空A5)>=0 then BEGIN buyshort(holding=0,ss,marketr); playsound(1,'E:\金字塔软件\KP.WAV'); end
     if  (平多B6 or 平多B7) and holding>0 then BEGIN sell(1,ss/2,marketr);playsound(1,'E:\金字塔软件\KP.WAV'); end if  (平多B1  or 平多B2  or 平多B3  or 平多B4  or 平多B5)  and holding>0 then BEGIN sell(1,0,marketr);playsound(1,'E:\金字塔软件\KP.WAV'); end
    if  (平空B6 or 平空B7) and holding<0 then BEGIN sellshort(1,ss/2,marketr);playsound(1,'E:\金字塔软件\KP.WAV'); end
    if  (平空B1  or 平空B2  or 平空B3  or 平空B4  or 平空B5)  and holding<0 then BEGIN sellshort(1,0,marketr);playsound(1,'E:\金字塔软件\KP.WAV'); end

     

  • 金字塔客服: 请详细的指出哪个信号是满足你需求的哪个又不是

     

  • 用户回复: 在同一周期里面:
    一、先检测MA5金叉MA10(以金叉当根K线为第一根完全走完) ,同时 MACD 金叉(以金叉当根K线为第一根完全走完),  当第二跟K线出现时,在第二根K线开始出现位置上 开多仓(开空仓就是死叉) 。若MACD第三根K线开始出现,MACD第二根K线变成了死叉,在第三根K线上显示平多仓(平空仓就是金叉)
    二、先检测MACD 金叉(以金叉当根K线为第一根完全走完) ,同时 MA5金叉MA10(以金叉当根K线为第一根完全走完),当第二跟K线出现时,在第二根K线开始出现位置上  开多仓(开空仓就是死叉) 。MACD第三根K线开始出现,但MACD第二根K线变成了死叉,在第三根K线上显示平多仓(平空仓就是金叉)
    三、当MA5金叉MA10 ,以金叉当根K线为第一根,往后数两根(包含第一根,第二根完全走完,第三根开始出现),同时 MACD 金叉(以金叉当根K线为第一根,第二根K线开始出现),在 MACD金叉第二根K线开始出现位置上 开多仓(开空仓就是死叉)。MACD第三根K线开始出现,但MACD第二根K线变成了死叉,在第三根K线上显示平多仓(平空仓就是金叉)
    四、当MACD 金叉 ,以金叉当根K线为第一根,往后数两根(包含第一根,第二根完全走完,第三根开始出现),同时 MA5金叉MA10(以金叉当根K线为第一根,第二根K线开始出现),在 MA5金叉MA10金叉的第二根K线开始出现位置上 开多仓(开空仓就是死叉)。MACD第三根K线开始出现,但MACD第二根K线变成了死叉,在第三根K线上显示平多仓(平空仓就是金叉)

     

  • 网友回复: 给我思路没有用,需要指出,在你实际应用中碰到的具体哪个信号出了问题,并且说明是不符合哪个条件

     

  • 网友回复:

    这是我修改过的,但还是有问题。请帮我修正,谢谢!
    此主题相关图片如下:图11.png

    此主题相关图片如下:图22.png



    J:=stkindi('','KDJ.J',0,6,-1),noaxis;

    CCI:=stkindi('','CCI.CCI',0,6,-1),noaxis;

     

    J4:=stkindi('','KDJ.J',0,datatype,-1),noaxis;

    CCI4:=stkindi('','CCI.CCI',0,datatype,-1),noaxis;

    DIFF4:=stkindi('','MACD.DIFF',0,datatype,-1),noaxis;

    DEA4:=stkindi('','MACD.DEA',0,datatype,-1),noaxis;

     

    J41:=stkindi('','KDJ.J',0,datatype,-2),noaxis;

    CCI41:=stkindi('','CCI.CCI',0,datatype,-2),noaxis;

    DIFF41:=stkindi('','MACD.DIFF',0,datatype,-2),noaxis;

    DEA41:=stkindi('','MACD.DEA',0,datatype,-2),noaxis;

     

    J42:=stkindi('','KDJ.J',0,datatype,-3),noaxis;

    CCI42:=stkindi('','CCI.CCI',0,datatype,-3),noaxis;

    DIFF42:=stkindi('','MACD.DIFF',0,datatype,-3),noaxis;

    DEA42:=stkindi('','MACD.DEA',0,datatype,-3),noaxis;

     

    MAA4:=stkindi('','MA.MA1',0,datatype,-1) ,noaxis;

    MAB4:=stkindi('','MA.MA2',0,datatype,-1) ,noaxis;

     

    MAA41:=stkindi('','MA.MA1',0,datatype,-2) ,noaxis;

    MAB41:=stkindi('','MA.MA2',0,datatype,-2) ,noaxis;

     

    MAA42:=stkindi('','MA.MA1',0,datatype,-3) ,noaxis;

    MAB42:=stkindi('','MA.MA2',0,datatype,-3) ,noaxis;

     

     

    MACD4金叉:=DIFF41<DEA41 and DIFF4>DEA4;

    MACD4金叉1:=DIFF42<DEA42 and DIFF41>DEA41 and DIFF4>DEA4;

    MACD4金叉区:=DIFF42>DEA42 and DIFF41>DEA41 and DIFF4>DEA4;

     

    MACD4死叉:=DIFF41>DEA41 and DIFF4<DEA4;

    MACD4死叉1:=DIFF42>DEA42 and DIFF41<DEA41 and DIFF4<DEA4;

    MACD4死叉区:=DIFF42<DEA42 and DIFF41<DEA41 and DIFF4<DEA4;

     

    MA4金叉:=MAA41<MAB41 and MAA4> MAB4;

    MA4金叉1:= MAA42<MAB42 and MAA41> MAB41 and MAA4> MAB4;

    MA4金叉区:= MAA42> MAB42 and MAA41> MAB41 and MAA4> MAB4;

     

    MA4死叉:= MAA41>MAB41 and MAA4< MAB4;

    MA4死叉1:= MAA42>MAB42 and MAA41< MAB41 and MAA4< MAB4;

    MA4死叉区:= MAA42< MAB42 and MAA41< MAB41 and MAA4< MAB4;

     

     

    开多A条件1:=J4<95 and CCI4<260 AND J<95 and CCI<260;

    开多A1:=MACD4金叉 and 开多A条件1;

     

    开多A条件2:=MACD4金叉1 and abs(DIFF4-DEA4)>abs(DIFF41-DEA41)*1.05;

    开多A2:=开多A条件1 and 开多A条件2;

     

    开多A条件3:=MACD4金叉区 and (abs(DIFF4-DEA4)>abs(DIFF41-DEA41)*1.15 or abs(DIFF4-DEA4)>abs(DIFF42-DEA42)*1.15);

    开多A3:=开多A条件1 and 开多A条件3;

     

    开多A4:=开多A条件1 and  (MA4金叉 OR  MA4金叉1 );

    开多A5:=开多A条件1 and  MA4金叉区;

     

     

    开空A条件1:=J4>5 and CCI4>-260 AND J>5 and CCI>-260;

    开空A1:=MACD4死叉 and 开空A条件1;

     

    开空A条件2:=MACD4死叉1 and abs(DIFF4-DEA4)>abs(DIFF41-DEA41)*1.05;

    开空A2:=开空A条件1 and 开空A条件2;

     

    开空A条件3:=MACD4死叉区 and (abs(DIFF4-DEA4)>abs(DIFF41-DEA41)*1.15 or abs(DIFF4-DEA4)>abs(DIFF42-DEA42)*1.15);

    开空A3:=开空A条件1 and 开空A条件3;

     

    开空A4:=开空A条件1 and  (MA4死叉 OR  MA4死叉1 );

    开空A5:=开空A条件1 and  MA4死叉区;

     

     

    J:=stkindi('','KDJ.J',0,datatype);

    CCI:=stkindi('','CCI.CCI',0,datatype);

    DIFF:=stkindi('','MACD.DIFF',0,datatype);

    DEA:=stkindi('','MACD.DEA',0,datatype);

    J1:=stkindi('','KDJ.J',0,datatype,-1);

    CCI1:=stkindi('','CCI.CCI',0,datatype,-1);

    DIFF1:=stkindi('','MACD.DIFF',0,datatype,-1);

    DEA1:=stkindi('','MACD.DEA',0,datatype,-1);

    J2:=stkindi('','KDJ.J',0,datatype,-2);

    CCI2:=stkindi('','CCI.CCI',0,datatype,-2);

    DIFF2:=stkindi('','MACD.DIFF',0,datatype,-2);

    DEA2:=stkindi('','MACD.DEA',0,datatype,-2);

     

    MAA2:=stkindi('','MA.MA1',0,datatype);

    MAB2:=stkindi('','MA.MA2',0,datatype);

     

    MAA21:=stkindi('','MA.MA1',0,datatype,-1);

    MAB21:=stkindi('','MA.MA2',0,datatype,-1);

     

    MAA22:=stkindi('','MA.MA1',0,datatype,-2);

    MAB22:=stkindi('','MA.MA2',0,datatype,-2);

     

     

    MACD金叉:=DIFF1<DEA1 and DIFF>DEA;

    MACD金叉1:=DIFF2<DEA2 and DIFF1>DEA1 and DIFF>DEA;

    MACD金叉区:=DIFF2>DEA2 and DIFF1>DEA1 and DIFF>DEA;

     

    MACD死叉:=DIFF1>DEA1 and DIFF<DEA;

    MACD死叉1:=DIFF2>DEA2 and DIFF1<DEA1 and DIFF<DEA;

    MACD死叉区:=DIFF2<DEA2 and DIFF1<DEA1 and DIFF<DEA;

     

    MA2金叉:=MAA21<MAB21 and MAA2> MAB2;

    MA2金叉1:= MAA22<MAB22 and MAA21> MAB21 and MAA2> MAB2;

    MA2金叉区:= MAA22> MAB22 and MAA21> MAB21 and MAA2> MAB2;

     

    MA2死叉:= MAA21>MAB21 and MAA2< MAB2;

    MA2死叉1:= MAA22>MAB22 and MAA21< MAB21 and MAA2< MAB2;

    MA2死叉区:= MAA22< MAB22 and MAA21< MAB21 and MAA2< MAB2;

     

    xy:=if(c<o,c-l,o-l);

    sy:=if(c<O,h-o,h-c);

    pd:=if(c<o,h=o,h=c);

     

    开多B条件1:=J<95 and CCI<260;

    开多B1:=MACD金叉 and 开多B条件1;

     

    开多B条件2:=MACD金叉1 and abs(DIFF-DEA)>abs(DIFF1-DEA1)*1.05;

    开多B2:=开多B条件1 and 开多B条件2;

     

    开多B条件3:=MACD金叉区 and (abs(DIFF-DEA)>abs(DIFF1-DEA1)*1.15 or abs(DIFF-DEA)>abs(DIFF2-DEA2)*1.15);

    开多B3:=开多B条件1 and 开多B条件3;

     

    开多B4:=开多B条件1 and  (MA2金叉 OR  MA2金叉1 );

    开多B5:=开多B条件1 and  MA2金叉区;

     

     

    平多B1:=DIFF1>DEA1 and DIFF<DEA;

    平多B2:=DIFF2>DEA2 and DIFF<DEA;

    平多B3:= MAA21>MAB21 and MAA2< MAB2;

    平多B4:= MAA22>MAB22 and MAA2< MAB2;

    平多B5:=(ref (h,2)<ref(h,1) and ref (l,2)<ref(l,1)  and ref(sy>abs(c-o)*2.5 and (xy<=sy*0.5 or pd),1) and h<ref(h,1) and l<ref(l,1) and c<ref(l,1)) and MACD金叉区;

    平多B6:=(abs(DIFF-DEA)<abs(DIFF2-DEA2)*0.2 or abs(DIFF-DEA)<abs(DIFF1-DEA1)*0.2) and MACD金叉区;

    平多B7:=(abs(DIFF-DEA)>abs(DIFF2-DEA2)*1.8 or abs(DIFF-DEA)>abs(DIFF1-DEA1)*1.8) and MACD死叉区;

     

    开空B条件1:=J>5 and CCI>-260;

    开空B1:=MACD死叉 and 开空B条件1;

     

    开空B条件2:=MACD死叉1 and abs(DIFF-DEA)>abs(DIFF1-DEA1)*1.05;

    开空B2:=开空B条件1 and 开空B条件2;

     

    开空B条件3:=MACD死叉区 and (abs(DIFF-DEA)>abs(DIFF1-DEA1)*1.15 or abs(DIFF-DEA)>abs(DIFF2-DEA2)*1.15);

    开空B3:=开空B条件1 and 开空B条件3;

     

    开空B4:=开空B条件1 and  (MA2死叉 OR  MA2死叉1 );

    开空B5:=开空B条件1 and  MA2死叉区;

     

     

     

    平空B1:=DIFF1<DEA1 and DIFF>DEA;

    平空B2:=DIFF2<DEA2 and DIFF>DEA;

    平空B3:= MAA21<MAB21 and MAA2> MAB2;

    平空B4:= MAA22<MAB22 and MAA2> MAB2;

    平空B5:=(ref (l,1)<ref(l,2) and ref (h,1)<ref(h,2)  and ref(xy>abs(c-o)*2.5 and (sy<=xy*0.5 or pd),1) and l>ref(l,1) and h>ref(h,1) and c>ref(h,1)) and MACD死叉区;

    平空B6:=(abs(DIFF-DEA)<abs(DIFF2-DEA2)*0.2 or abs(DIFF-DEA)<abs(DIFF1-DEA1)*0.2) and MACD死叉区;

    平空B7:=(abs(DIFF-DEA)>abs(DIFF2-DEA2)*1.8 or abs(DIFF-DEA)>abs(DIFF1-DEA1)*1.8) and MACD金叉区;

     

    ss:=6;//下单手数为6

     

    if  开多B4  and  barslast(开多A1  OR 开多A2>=0 then BEGIN  buy(holding=0,ss,marketr);

             playsound(1,'E:\金字塔软件\KP.WAV'); 

            end

    if  (开多B1  OR 开多B2  and  barslast(开多A4>=0 then BEGIN buy(holding=0,ss,marketr);

             playsound(1,'E:\金字塔软件\KP.WAV'); 

            end

     

    if  开空B4 and barslast(开空A1  OR 开空A2)>=0 then BEGIN buyshort(holding=0,ss,marketr);

             playsound(1,'E:\金字塔软件\KP.WAV');

             end

    if  (开空B1  OR 开空B2 ) and barslast(开空A4)>=0 then BEGIN  buyshort(holding=0,ss,marketr);

             playsound(1,'E:\金字塔软件\KP.WAV');

             end

     

     

     if  (平多B6 or 平多B7 and holding>0 then BEGIN sell(1,ss/2,marketr);

    playsound(1,'E:\金字塔软件\KP.WAV');

             end

     if  (平多B1  or 平多B2  or 平多B5  and holding>0 then BEGIN sell(1,0,marketr);

    playsound(1,'E:\金字塔软件\KP.WAV');

             end

     

    if  (平空B6 or 平空B7 and holding<0 then BEGIN sellshort(1,ss/2,marketr);

    playsound(1,'E:\金字塔软件\KP.WAV');

             end

     

    if  (平空B1  or 平空B2  or 平空B5  and holding<0 then BEGIN sellshort(1,0,marketr);

    playsound(1,'E:\金字塔软件\KP.WAV');

             end

     

     

     

 

有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友

可联系技术人员 QQ: 1145508240  点击这里给我发消息进行 有偿 编写!不贵!点击查看价格!


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

相关文章

    没有相关内容