文华编码转换为金字塔 [金字塔]
-
咨询内容:
以下为文华编码,麻烦帮助转化为金字塔。个人能力有限,只转化了部分代码N:=DAYBARPOS,NODRAW;
//昨收:REF(C,IF(N<=ZQ,N+1,NULL)),RGB(255,0,255),DASH,PRECIS0;//取的当日的开盘价
//夜收:REF(C,IF(N>ZQ,N-ZQ,NULL)),RGB(255,0,255),DASH,PRECIS0;
1H:REF(C,IF(N<=ZQ,N+1,NULL)),RGB(255,0,255),LINETHICK1,PRECIS0;//取的当日的开盘价
2H:REF(C,IF(N>ZQ AND N<=2*ZQ,N-ZQ,NULL)),RGB(255,0,255),LINETHICK1,PRECIS0;
3H:REF(C,IF(N>2*ZQ AND N<=3*ZQ,N-2*ZQ,NULL)),RGB(255,0,255),LINETHICK1,PRECIS0;//取的当日的开盘价
4H:REF(C,IF(N>3*ZQ AND N<=4*ZQ,N-3*ZQ,NULL)),RGB(255,0,255),LINETHICK1,PRECIS0;//取的当日的开盘价
5H:REF(C,IF(N>4*ZQ AND N<=5*ZQ,N-4*ZQ,NULL)),RGB(255,0,255),LINETHICK1,PRECIS0;
6H:REF(C,IF(N>5*ZQ AND N<=6*ZQ,N-5*ZQ,NULL)),RGB(255,0,255),LINETHICK1,PRECIS0;
//HTR:=HHV(H,TRX);
//LTR:=LLV(L,TRX);//AA:INTPART(SETTLE),PRECIS0,COLORYELLOW;
BBB:=BARSLAST(DATE<>REF(DATE,1)) +1,NODRAW;
HH:=REF(HHV(H,BBB),1),COLORRED;
LL:=REF(LLV(L,BBB),1),COLORGREEN;
MA5:IF(KG<>1,MA(C,5),NULL),COLORMAGENTA,PRECIS0;
MA21:IF(KG<>1,MA(C,21),NULL),COLORGREEN,PRECIS0;
DRAWTEXT(CROSS(MA5,MA21),MA5,'多'),COLORRED,FONTSIZE30;
DRAWTEXT(CROSS(MA21,MA5),MA21,'空'),COLORGREEN,FONTSIZE30;
DHH2:=REF(HHV(H,SUMBARS(N=1,2)),N);//不包含当天的前两天高点
DHH3:=REF(HHV(H,SUMBARS(N=1,3)),N);//不包含当天的前三天高点
DHH4:=REF(HHV(H,SUMBARS(N=1,4)),N);//不包含当天的前四天高点
DH2:=HHV(H,SUMBARS(N=1,3));//包含当天的前两天高点
DH3:=HHV(H,SUMBARS(N=1,4));//包含当天的前三天高点
DH4:=HHV(H,SUMBARS(N=1,5));//包含当天的前四天高点
DLL2:=REF(LLV(L,SUMBARS(N=1,2)),N);//不包含当天的前两天低点
DLL3:=REF(LLV(L,SUMBARS(N=1,3)),N);//不包含当天的前三天低点
DLL4:=REF(LLV(L,SUMBARS(N=1,4)),N);//不包含当天的前四天低点
DL2:=LLV(L,SUMBARS(N=1,3));//包含当天的前两天低点
DL3:=LLV(L,SUMBARS(N=1,4));//包含当天的前三天低点
DL4:=LLV(L,SUMBARS(N=1,5));//包含当天的前四天低点BH1:=BARSLAST(COUNT(H>DHH3,BARSLAST(L<DLL3))=1&&H>DHH3)+1,NODRAW;
BL1:=BARSLAST(COUNT(L<DLL3,BARSLAST(H>DHH3))=1&&L<DLL3)+1,NODRAW;
B:=IF(BH1<BL1,BH1,NULL),PRECIS0,NODRAW;
S:=IF(BL1<BH1,BL1,NULL),PRECIS0,NODRAW;J:=BARSLAST(CROSS(B,0))+1,NODRAW;
J1:=SUMBARS(DAYBARPOS=1,1),NODRAW;
J2:=SUMBARS(DAYBARPOS=1,2),NODRAW;
J3:=SUMBARS(DAYBARPOS=1,3),NODRAW;H2:=HHV(H,2);
L2:=LLV(L,2);
H3:=HHV(H,3);
L3:=LLV(L,3);
HH3:=REF(H3,1);
LL3:=REF(L3,1);
TR3:=H3-L3;
BH:=BARSLAST(COUNT(H>HH3,BARSLAST(L<LL3))=1&&H>HH3)+1,NODRAW;//H转向定义
BL:=BARSLAST(COUNT(L<LL3,BARSLAST(H>HH3))=1&&L<LL3)+1,NODRAW;DB:INTPART(IF(B>0 ,IF((B-N)<0,1,CEILING((BARSLAST((B-N)<=0))/(J2-J1)+1, 1)),NULL)),NODRAW,COLORRED;//日线转向
DS:INTPART(IF(S>0 ,IF((S-N)<0,1,CEILING((BARSLAST((S-N)<=0))/(J2-J1)+1, 1)),NULL)),NODRAW,COLORGREEN;
HB:IF(BH<BL,BH,NULL),PRECIS0,NODRAW,COLORRED;//H转向
HS:IF(BL<BH,BL,NULL),PRECIS0,NODRAW,COLORGREEN;
D2H:=DHH2,PRECIS0,COLORRED,NODRAW;
D2L:=DLL2,PRECIS0,COLORGREEN,NODRAW;DRAWICON(KG<>2 AND BH=1 AND DB>0 ,L*0.997,'ICO130');
DRAWICON(KG<>2 AND BL=1 AND DS>0 ,H*1.003,'ICO131');
DRAWICON(BH=1 AND (XH=1 OR XH=3),L*0.999,'ICO4');
DRAWICON(BL=1 AND (XH=2 OR XH=3),H*1.001,'ICO5'); -
金字塔客服:
下次转换的代码,请把你修改后的代码也贴出来。并指出修改过程中遇到的问题,我们尝试帮你解决。
注:相关的初始变量请一并提供。
N:TODAYBAR,NODRAW;
//昨收:REF(C,IF(N<=ZQ,N+1,drawnull)),COLORMAGENTA,DASH,PRECIS0;//取的当日的开盘价
//夜收:REF(C,IF(N>ZQ,N-ZQ,drawnull)),COLORMAGENTA,DASH,PRECIS0;
1H:REF(C,IF(N<=ZQ,N+1,drawnull)),COLORMAGENTA,LINETHICK1,PRECIS0;//取的当日的开盘价
2H:REF(C,IF(N>ZQ AND N<=2*ZQ,N-ZQ,drawnull)),COLORMAGENTA,LINETHICK1,PRECIS0;
3H:REF(C,IF(N>2*ZQ AND N<=3*ZQ,N-2*ZQ,drawnull)),COLORMAGENTA,LINETHICK1,PRECIS0;//取的当日的开盘价
4H:REF(C,IF(N>3*ZQ AND N<=4*ZQ,N-3*ZQ,drawnull)),COLORMAGENTA,LINETHICK1,PRECIS0;//取的当日的开盘价
5H:REF(C,IF(N>4*ZQ AND N<=5*ZQ,N-4*ZQ,drawnull)),COLORMAGENTA,LINETHICK1,PRECIS0;
6H:REF(C,IF(N>5*ZQ AND N<=6*ZQ,N-5*ZQ,drawnull)),COLORMAGENTA,LINETHICK1,PRECIS0;
//HTR:=HHV(H,TRX);
//LTR:=LLV(L,TRX);
//AA:INTPART(SETTLE),PRECIS0,COLORYELLOW;
BBB:=BARSLAST(DATE<>REF(DATE,1)) +1,NODRAW;
HH:=REF(HHV(H,BBB),1),COLORRED;
LL:=REF(LLV(L,BBB),1),COLORGREEN;
MA5:IF(KG<>1,MA(C,5),drawnull),COLORMAGENTA,PRECIS0;
MA21:IF(KG<>1,MA(C,21),drawnull),COLORGREEN,PRECIS0;
DRAWTEXT(CROSS(MA5,MA21),MA5,'多'),COLORRED,FONTSIZE30;
DRAWTEXT(CROSS(MA21,MA5),MA21,'空'),COLORGREEN,FONTSIZE30;DHH2:=REF(HHV(H,SUMBARS(N=1,2)),N);//不包含当天的前两天高点
DHH3:=REF(HHV(H,SUMBARS(N=1,3)),N);//不包含当天的前三天高点
DHH4:=REF(HHV(H,SUMBARS(N=1,4)),N);//不包含当天的前四天高点
DH2:=HHV(H,SUMBARS(N=1,3));//包含当天的前两天高点
DH3:=HHV(H,SUMBARS(N=1,4));//包含当天的前三天高点
DH4:=HHV(H,SUMBARS(N=1,5));//包含当天的前四天高点
DLL2:=REF(LLV(L,SUMBARS(N=1,2)),N);//不包含当天的前两天低点
DLL3:=REF(LLV(L,SUMBARS(N=1,3)),N);//不包含当天的前三天低点
DLL4:=REF(LLV(L,SUMBARS(N=1,4)),N);//不包含当天的前四天低点
DL2:=LLV(L,SUMBARS(N=1,3));//包含当天的前两天低点
DL3:=LLV(L,SUMBARS(N=1,4));//包含当天的前三天低点
DL4:=LLV(L,SUMBARS(N=1,5));//包含当天的前四天低点
BH1:=BARSLAST(COUNT(H>DHH3,BARSLAST(L<DLL3))=1&&H>DHH3)+1,NODRAW;
BL1:=BARSLAST(COUNT(L<DLL3,BARSLAST(H>DHH3))=1&&L<DLL3)+1,NODRAW;
B:=IF(BH1<BL1,BH1,drawnull),PRECIS0,NODRAW;
S:=IF(BL1<BH1,BL1,drawnull),PRECIS0,NODRAW;
J:=BARSLAST(CROSS(B,0))+1,NODRAW;
J1:=SUMBARS(todaybar=1,1),NODRAW;
J2:=SUMBARS(todaybar=1,2),NODRAW;
J3:=SUMBARS(todaybar=1,3),NODRAW;
H2:=HHV(H,2);
L2:=LLV(L,2);
H3:=HHV(H,3);
L3:=LLV(L,3);
HH3:=REF(H3,1);
LL3:=REF(L3,1);
TR3:=H3-L3;
BH:=BARSLAST(COUNT(H>HH3,BARSLAST(L<LL3))=1&&H>HH3)+1,NODRAW;//H转向定义
BL:=BARSLAST(COUNT(L<LL3,BARSLAST(H>HH3))=1&&L<LL3)+1,NODRAW;
DB:INTPART(IF(B>0 ,IF((B-N)<0,1,CEILING((BARSLAST((B-N)<=0))/(J2-J1)+1)),drawnull)),NODRAW,COLORRED;//日线转向
DS:INTPART(IF(S>0 ,IF((S-N)<0,1,CEILING((BARSLAST((S-N)<=0))/(J2-J1)+1)),drawnull)),NODRAW,COLORGREEN;
HB:IF(BH<BL,BH,drawnull),PRECIS0,NODRAW,COLORRED;//H转向
HS:IF(BL<BH,BL,drawnull),PRECIS0,NODRAW,COLORGREEN;
D2H:=DHH2,PRECIS0,COLORRED,NODRAW;
D2L:=DLL2,PRECIS0,COLORGREEN,NODRAW;
DRAWICON(KG<>2 AND BH=1 AND DB>0 ,L*0.997,'ICO130');
DRAWICON(KG<>2 AND BL=1 AND DS>0 ,H*1.003,'ICO131');
DRAWICON(BH=1 AND (XH=1 OR XH=3),L*0.999,'ICO4');
DRAWICON(BL=1 AND (XH=2 OR XH=3),H*1.001,'ICO5');来源:程序化久久网( WWW.CXH99.COM )
-
用户回复:
没有注意提供参数,谢谢指导和帮助转换
input:ZQ(60,24,120,1),xh(3,0,3,1),kg(2,0,2,1);
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信号:cxh99cxh99 进行 有偿收费 编写!
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容