文华模型改成金字塔后无信号,请高手帮忙改写 [金字塔]
- 咨询内容:
BA:=BARPOS;
VOL1:=IF(LLV(VOL,0)=0,1,INTPART(VOL*100));
HC:=LLV(IF(H-C=0,1000,H-C),0);
CL:=LLV(IF(C-L=0,1000,ABS(C-L)),0);
CO:=LLV(IF(C-O=0,1000,ABS(C-O)),0);
ZXBD:=MIN(HC,MIN(CL,CO));
DFX:=REF(L,2)=LLV(L,15) and REF(L,1)>REF(L,2) and L>REF(L,2) and REF(L,2)<=REF(L,3);
GFX:=REF(H,2)=HHV(H,9) and REF(H,1)<REF(H,2) and H<REF(H,2) and REF(H,2)>=REF(H,3);
DFXI:=VALUEWHEN(DFX,BA);
GFXI:=VALUEWHEN(GFX,BA);
DDP1:=VALUEWHEN(DFX,REF(L,2));
GDP1:=VALUEWHEN(GFX,REF(H,2));
DDP:=VALUEWHEN(DFX and DDP1<>REF(DDP1,1),DDP1);
GDP:=VALUEWHEN(GFX and GDP1<>REF(GDP1,1),GDP1);
DFX1I:=VALUEWHEN(DFX,REF(DFXI,1));
DFX1P:=VALUEWHEN(DFX,REF(DDP,BA-DFX1I+1));
GFX1I:=VALUEWHEN(GFX,REF(GFXI,1));
GFX1P:=VALUEWHEN(GFX,REF(GDP,BA-GFX1I+1));
DFXP:=VALUEWHEN(DFX and DDP<>REF(DDP,1),MIN(DDP,MIN(DFX1P,REF(DDP,1))));
GFXP:=VALUEWHEN(GFX and GDP<>REF(GDP,1),MAX(GDP,MAX(GFX1P,REF(GDP,1))));
SA:=SAR(4,0.02,0.2);
DZZ:=SA>0 and NOT(REF(SA,1)>0) or BA=0;
GZZ:=SA<0 and NOT(REF(SA,1)<0) or BA=0;
DZZI:=VALUEWHEN(DZZ,BA);
GZZI:=VALUEWHEN(GZZ,BA);
DZZ0I:=IF(NOT(VALUEWHEN(REF(SA,2)<0 and DFX and REF(L,2)=LLV(L,BA-GZZI+1),BA-2)>=0),0,VALUEWHEN((REF(DZZ,2)=1 and DFX) or (REF(SA,2) <0 and DFX and REF(L,2)=LLV (L,BA-GZZI+1)),BA-2));
GZZ0I:=IF(NOT(VALUEWHEN(REF(SA,2)>0 and GFX and REF(H,2)=HHV(H,BA-DZZI+1),BA-2)>=0),0,VALUEWHEN((REF(GZZ,2)=1 and GFX) or (REF(SA,2) >0 and GFX and REF(H,2)=HHV(H,BA-DZZI+1)),BA-2));
DD0I:=VALUEWHEN(DZZ or DZZ0I=0,DZZ0I);
GD0I:=VALUEWHEN(GZZ or GZZ0I=0,GZZ0I);
DZZ0P:=VALUEWHEN(DZZ and DZZI-GZZI>3,LLV(L,BA-GZZ0I+1));
GZZ0P:=VALUEWHEN(GZZ and GZZI-DZZI>3,HHV(H,BA-DZZ0I+1));
DD0P:=VALUEWHEN(DZZ,DZZ0P);
GD0P:=VALUEWHEN(GZZ,GZZ0P);
DD0RP:=VALUEWHEN(DZZ,REF(DD0P,1));
GD0RP:=VALUEWHEN(GZZ,REF(GD0P,1));
DZP:=VALUEWHEN(DZZ,MIN(DD0P,DD0RP));
GZP:=VALUEWHEN(GZZ,MAX(GD0P,GD0RP));
QSI:=IF(DZZ0I=0,0,VALUEWHEN(DZZ,REF(DZZ0I,BA-GZZI+1)));
GQSI:=IF(GZZ0I=0,0,VALUEWHEN(GZZ,REF(GZZ0I,BA-DZZI+1)));
SZR:=IF(SA>0,1,0);
XDR:=IF(SA<0,1,0);
XDTS2:=VALUEWHEN(DZZ and SUM(XDR,DZZI-GZZI+1)>3,SUM(XDR,DZZI-GZZI+1));
SZTS2:=VALUEWHEN(GZZ and SUM(SZR,GZZI-DZZI+1)>3,SUM(SZR,GZZI-DZZI+1));
XDTS2I:=VALUEWHEN(DZZ and SUM(XDR,DZZI-GZZI+1)>3,BA);
SZTS2I:=VALUEWHEN(GZZ and SUM(SZR,GZZI-DZZI+1)>3,BA);
XDTS1:=VALUEWHEN(DZZ and SUM(SZR,DZZI-REF(GZZI,BA-REF(DZZI,2))+1)<4,DZZI-REF(GZZI,BA-REF(DZZI,2)));
XDTS1I:=VALUEWHEN(DZZ and SUM(SZR,DZZI-REF(GZZI,BA-REF(DZZI,2))+1)<4,BA);
XDTS:=IF(DZZ and SUM(SZR,DZZI-REF(GZZI,BA-REF(DZZI,2))+1)<4,XDTS1,XDTS2);
SZTS1:=VALUEWHEN(GZZ and SUM(XDR,GZZI-REF(DZZI,BA-REF(GZZI,2))+1)<4,GZZI-REF(DZZI,BA-REF(GZZI,2)));
SZTS1I:=VALUEWHEN(GZZ and SUM(XDR,GZZI-REF(DZZI,BA-REF(GZZI,2))+1)<4,BA);
SZTS:=IF(GZZ and SUM(XDR,GZZI-REF(DZZI,BA-REF(GZZI,2))+1)<4,SZTS1,SZTS2);
DINI:=IF(BA=DZZ0I or BA-DZZ0I=1,SUM(L*VOL1,BA-QSI+1)/SUM(VOL1,BA-QSI+1),SUM(L*VOL1,BA-DZZ0I+1)/SUM(VOL1,BA-DZZ0I+1));
GINI:=IF(BA=GZZ0I or BA-GZZ0I=1,SUM(H*VOL1,BA-GQSI+1)/SUM(VOL1,BA-GQSI+1),SUM(H*VOL1,BA-GZZ0I+1)/SUM(VOL1,BA-GZZ0I+1));
DDT0:=DFX and (REF(C,2)<REF(DINI,2) or REF(C,3)<REF(DINI,3));
DDT0I:=VALUEWHEN(DDT0,DZZ0I);
DDT01I:=VALUEWHEN(DDT0,REF(DDT0I,1));
DINI0:=IF(BA=DDT0I or BA-DDT0I=1,SUM(L*VOL1,BA-DDT01I+1)/SUM(VOL1,BA-DDT01I+1),SUM(L*VOL1,BA-DDT0I+1)/SUM(VOL1,BA- DDT0I+1));
DDT00:=(DZZ and SZTS<=XDTS and DZZI-GZZI>3);
DDT00I:=IF(NOT(DDT00),0,VALUEWHEN(DDT00,DD0I));
DZ00I:=VALUEWHEN(DFX and (REF(C,3)<REF(DINI0,3) or REF(C,2)<REF(DINI0,2)),DZZ0I);
DZ0I:=MAX(DDT00I,DZ00I);
DZ0:=IF(BA=DZ0I or BA-DZ0I=1,(SUM(L*VOL1,BA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D)*ZXBD;
GDW11:=VALUEWHEN(CROSS(C,GD1),BA);
DDW11:=VALUEWHEN(CROSS(DD1,C),BA);
DKD:=IF(DDW11>GDW11,GD1,DD1);
DWD:=VALUEWHEN(CROSS(C,DKD),BA);
GWD:=VALUEWHEN(CROSS(DKD,C),BA);
GDW1:=VALUEWHEN(CROSS(C,GFXP) or BA=0,BA);
DDW1:=VALUEWHEN(CROSS(DFXP,C) or BA=0,BA);
DKP:=IF(DDW1>GDW1,GFXP,DFXP);
BZD:=MAX(DK,MAX(DKD,GFXP));
SZD:=MIN(DK,MIN(DKD,DFXP));
DTA:=CROSS(C,BZD);
KTA:=CROSS(SZD,C);
DTAI:=VALUEWHEN(DTA or BA=0,BA);
KTAI:=VALUEWHEN(KTA or BA=0,BA);
DTB:=C<DK and C<DKD and REF(CROSS(DKP,C),1)=1 and C>REF(DKP,2) and DFX;
KTB:=C>DK and C>DKD and REF(CROSS(C,DKP),1)=1 and C<REF(DKP,2) and GFX;
DTC:=C<DK and C<DKD and SUM(L<DKP and C>DKP,2)=2;
KTC:=C>DK and C>DKD and SUM(H>DKP and C<DKP,2)=2;
DTD:=C>DKD and SUM(C>DK,2)>=2 and SUM(DKD=DK,BA-DWD+1)=BA-DWD and DKD>DK and REF(DKD=DK,1)=1;
KTD:=C<DKD and SUM(C<DK,2)>=2 and SUM(DKD=DK,BA-GWD+1)=BA-GWD and DKD<DK and REF(DKD=DK,1)=1;
DTE:=CROSS(C,DK) and SUM(DK=DKD,BA-REF(DWD,1)+1)=BA-REF(DWD,1)+1;
KTE:=CROSS(DK,C) and SUM(DK=DKD,BA-REF(GWD,1)+1)=BA-REF(GWD,1)+1;
DTF:=CROSS(C,DK) and SUM(CROSS(C,GFXP),BA-1)=0;
KTF:=CROSS(DK,C) and SUM(CROSS(DFXP,C),BA-1)=0;
KTG:=C>DK and CROSS(DKD,C) and SUM(C>DK and C>DKP and L<DKD and C>DKD and O=L,BA-DWD+1)>=1;
DTG0:=C>DK and CROSS(C,DKD) and SUM(KTG,BA-GWD+1)>=1;
KTH:=REF(SUM(DK=DKD,2)=2 and CROSS(DK,C) and ISUP,1)=1 and C<REF(C,1);
DTJ:=C>DKP and C<DK and CROSS(C,DKD) and SUM(C<DK and L<DKP and C>DKP and ISUP,BA-GWD+1)>=1;
KTJ0:=C<DK and CROSS(DKD,C) and SUM(DTJ,BA-DWD+1)>=1;
DTK:=C<DK and CROSS(C,DKD) and SUM(CROSS(DKP,C),BA-GWD+1)>=1 and ISUP and L>REF(H,1) and SUM(L<DK and C>DK,BA-GWD+1)>=1;
KTK0:=C<DK and CROSS(DKD,C) and SUM(DTK,BA-DWD+1)>=1;
KTL:=CROSS(DKD,C) and SUM(CROSS(C,DKP) and C>DKD and DKD>DK,BA-DWD+1);
KTM:=CROSS(DKD,C) and SUM(SUM(L<DKD and C>DKD,2)=2,BA-DWD+1)>=1 and SUM(CROSS(C,DKP) or CROSS(C,DK),BA-DWD+1)=0;
DTL:=CROSS(C,DKD) and O-L<0.5 and SUM(CROSS(DK,C) and DK<>DKD,BA-GWD+1);
DT1:=DTA or DTC or DTB or DTD or DTE or DTF or DTG0 or DTJ or DTK or DTL;
KT1:=KTA or KTC or KTB or KTD or KTE or KTF or KTG or KTH or KTJ0 or KTK0 or KTL or KTM;
DTI:=VALUEWHEN(DT1 or BA=0,BA);
KTI:=VALUEWHEN(KT1 or BA=0,BA);
{=多空开平信号条件=}
开多条件:=REF(DTI<=KTI,1)=1 and DTI>KTI;
平多条件:=REF(DTI>=KTI,1)=1 and DTI<KTI;
开空条件:=REF(DTI>=KTI,1)=1 and DTI<KTI;
平空条件:=REF(DTI<=KTI,1)=1 and DTI>KTI;
Y:=1;{=交易测评条件=}
{平空}
SELLSHORT(平空条件 and HOLDING<0,0,LIMITR,C);
{开多}
BUY(开多条件 AND HOLDING=0, Y,LIMITR,C);
{平多}
SELL(平多条件 and HOLDING>0,0,LIMITR,C);
{开空}
BUYSHORT(开空条件 and HOLDING=0,Y,LIMITR,C); - 金字塔客服:
目前金字塔只能部分兼容文华。
这长~~~,看不出楼主的意图。
楼主可否先试着自己改改,遇到阻力了,再发动大众。
[此贴子已经被作者于2010-9-20 14:05:55编辑过] - 用户回复:
http://www.weistock.com/bbs/dispbbs.asp?boardid=2&Id=2882
使用这个版本的序列模式运行文华的公式
不要将文华公式直接改成金字塔BUY,这样即没有提高效率又降低了兼容性,上面的版本可以很好的识别文华的SP,BK等指令,你试试直接贴过来看看
- 网友回复: 这么长 不是坑爹么
如果以上指标公式不适用于您常用的行情软件
或者您想改编成选股公式,以便快速选出某种形态个股的话,
- 上一篇:金字塔的模拟平台怎么老是出现通讯失败,…
- 下一篇:[原创]筛选主力合约的宏
相关文章
-
没有相关内容