您现在的位置:程序化交易>> 期货公式>> 博易大师>> 博易大师知识>>正文内容

希望解决疑问 [博易POBO]

咨询内容: 希望解决疑问 自己写的指标,价格从0轴开始显示,是什么原因导致的?
  <!-- 咨询内容: 附件 : -->

 

 来源:程序化99网( WWW.CXH99.COM )

博易技术人员: 您好,要看代码了,我看上面截图一些指标的数值很小,都是小数,与K线相差比较大,所以造成图形压缩。 {长周期高低位趋势线}
A1:=REF(H,8)=HHV(H,2*8+1);
B1:=FILTER(A1,8);
C1:=BACKSET(B1,8+1);
D1:=FILTER(C1,8);
R11:=BACKSET(ISLASTBAR,BARSLAST(D1)+1);
S11:=R11>REF(R11,1);
DRAWLINE(CROSS(BACKSET(S11,SUMBARS(D1,2)),0.5),H,S11,H,1),COLORBLUE;
A2:=REF(L,8)=LLV(L,2*8+1);
B2:=FILTER(A2,8);
C2:=BACKSET(B2,8+1);
D2:=FILTER(C2,8);
T11:=BACKSET(ISLASTBAR,BARSLAST(D2)+1);
U11:=T11>REF(T11,1);
DRAWLINE(CROSS(BACKSET(U11,SUMBARS(D2,2)),0.5),L,U11,L,1),COLORBLUE;

{短周期高低位趋势线}
M:=4;
A12:=REF(H,M)=HHV(H,2*M+1);
B12:=FILTER(A12,M);
C12:=BACKSET(B12,M+1);
D12:=FILTER(C12,M);
R112:=BACKSET(ISLASTBAR,BARSLAST(D12)+1); 
S112:=R112>REF(R112,1);
DRAWLINE(CROSS(BACKSET(S112,SUMBARS(D12,2)),0.5),H,S112,H,1),COLORRED;
A22:=REF(L,M)=LLV(L,2*M+1);
B22:=FILTER(A22,M);
C22:=BACKSET(B22,M+1);
D22:=FILTER(C22,M);
T112:=BACKSET(ISLASTBAR,BARSLAST(D22)+1); 
U112:=T112>REF(T112,1);
DRAWLINE(CROSS(BACKSET(U112,SUMBARS(D22,2)),0.5),L,U112,L,1),COLORRED;

{压力位与支撑位}
VAR1111:=BACKSET(REF(HIGH,2)=HHV(HIGH,5),3);
VAR2222:=CROSS(VAR1111,0.9);
VAR3333:=BACKSET(REF(LOW,2)=LLV(LOW,5),3);
VAR4444:=CROSS(VAR3333,0.9);
压力:=REF(HIGH,BARSLAST(VAR2222));
STICKLINE(CLOSE,REF(HIGH,BARSLAST(VAR2222)),REF(HIGH,BARSLAST(VAR2222)),2,1),COLORMAGENTA,LINETHICK7;
支撑:=REF(LOW,BARSLAST(VAR4444));
STICKLINE(CLOSE,REF(LOW,BARSLAST(VAR4444)),REF(LOW,BARSLAST(VAR4444)),2,1),COLORCYAN,LINETHICK7;
下档线:=(((CLOSE-LLV(LOW,13))/(HHV(HIGH,13)-LLV(LOW,13)))*100);
RRRSV:=SMA(下档线,3,1);
KKK:=SMA(RRRSV,3,1);
DDD:=((3*RRRSV)-(2*KKK));
JJ12:=(((CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55)))*100);
RSV24:=SMA(JJ12,3,1);
K24:=SMA(RSV24,3,1);
D24:=((3*RSV24)-(2*K24));
压力2:=IF(CROSS(D24,DDD),HIGH,REF(HIGH,BARSLAST(CROSS(D24,DDD)))),COLORFFFFFF;
压力位:=IF(ISLASTBAR,压力2,DRAWNULL);
STICKLINE(ISLASTBAR,压力位,压力位,100,0),LINETHICK1,COLORRED;
DRAWNUMBER(ISLASTBAR,压力位,压力位,2),COLORYELLOW;
DRAWTEXT(ISLASTBAR,压力位,'              长周期压力'),COLORRED;
底部:=LLV(HIGH,30),COLOR00FF00;
底部位:=IF(ISLASTBAR,底部,DRAWNULL);
STICKLINE(ISLASTBAR,底部位,底部位,100,0),LINETHICK1,COLORGREEN;
DRAWNUMBER(ISLASTBAR,底部位,底部位,2),COLORYELLOW;
DRAWTEXT(ISLASTBAR,底部位,'              长周期支撑'),COLORRED;
支撑压力区间:压力位-底部位;

{小时以上级别---加仓、清仓、狙击位及长短周期乖离率}
AA05:=MA(C,5);
五日乖离率:(C-AA05)/AA05*100,COLORBLUE;
BB05:=ATAN((AA05/REF(AA05,1)-1)*100)*180/3.1416;
速度5:=SMA(EMA((AA05-REF(AA05,1))/REF(AA05,1),3)*100,3,1);
加速度5:EMA((速度5-REF(速度5,1)),3),NODRAW;
AA10:=MA(C,10);
AA20:=MA(C,20);
BB10:=ATAN((AA10/REF(AA10,1)-1)*100)*180/3.1416;
AA30:=MA(C,30);
三拾日乖离率:=(C-AA30)/AA30*100;
三十日乖离率:三拾日乖离率,COLORBLUE;
VAR11:=(AA20-AA30)>REF((AA20-AA30),1)ANDAA20>REF(AA20,1)ANDAA30>REF(AA30,1);
VAR22:=(AA30-AA20)<REF((AA30-AA20),1)ANDAA20<REF(AA20,1)ANDAA30<REF(AA30,1);
BB30:=ATAN((AA30/REF(AA30,1)-1)*100)*180/3.1416;
强势狙击:=FILTER(BB30>30ANDBB10>45ANDCROSS(BB05,60),10);
加仓:=FILTER(COUNT(CROSS(BB05,30),5)>=1ANDAA05>REF(AA05,1)AND三拾日乖离率>REF(三拾日乖离率,1)ANDAA10>REF(AA10,1)AND加速度5>REF(加速度5,1)AND速度5>REF(速度5,1),10);
清仓:=FILTER(COUNT(CROSS(30,BB05),5)>=1AND(C>AA30ORO>AA30)ANDAA05<REF(AA05,1)AND三拾日乖离率<REF(三拾日乖离率,1)ANDAA10<REF(AA10,1),10);
DRAWICON(加仓,LOW*0.989,1);
DRAWTEXT(加仓,LOW*0.986,'加'),COLORRED;
DRAWICON(清仓,HIGH*1.009,2);
DRAWTEXT(清仓,HIGH*1.012,'清'),COLORGREEN;
DRAWICON(强势狙击,LOW*0.989,3);
DRAWTEXT(强势狙击,LOW*0.986,'狙'),COLORYELLOW;

{粘合分散均线}
AAA:=(3*C+H+L+O)/6;
VAR1:=(8*AAA+7*REF(AAA,1)+6*REF(AAA,2)+5*REF(AAA,3)+4*REF(AAA,4)+3*REF(AAA,5)+2*REF(AAA,6)+REF(AAA,8))/36;
VAR2:=(HHV(VAR1,5)+HHV(VAR1,10)+HHV(VAR1,20))/3;
VAR3:=(LLV(VAR1,5)+LLV(VAR1,10)+LLV(VAR1,20))/3;
VAR4:=(HHV(VAR2,5)+HHV(VAR2,10)+HHV(VAR2,20))/3;
VAR5:=(LLV(VAR3,5)+LLV(VAR3,10)+LLV(VAR3,20))/3;
VAR6:=(LLV(VAR1,2)+LLV(VAR1,4)+LLV(VAR1,6))/3;
短线:VAR1,COLORWHITE;
中线:VAR6,COLORBLUE;
下跌:IF(VAR1=VAR6,VAR6,DRAWNULL),COLORYELLOW;

{日线以上级别---单柱震荡区间}
TYP:=(H+L+C)/3;
CCI1:=(TYP-MA(TYP,5))/(0.015*AVEDEV(TYP,5));
差值1:=ABS(REF(CCI1,1)-CCI1),LINETHICK1;
CCI2:=(TYP-MA(TYP,10))/(0.015*AVEDEV(TYP,10));
差值2:=ABS(REF(CCI2,1)-CCI2),LINETHICK1;
CCI3:=(TYP-MA(TYP,20))/(0.015*AVEDEV(TYP,20));
差值3:=ABS(REF(CCI3,1)-CCI3),LINETHICK1;
CCI4:=(TYP-MA(TYP,40))/(0.015*AVEDEV(TYP,40));
差值4:=ABS(REF(CCI4,1)-CCI4),LINETHICK1;
CCI5:=(TYP-MA(TYP,60))/(0.015*AVEDEV(TYP,60));
差值5:=ABS(REF(CCI5,1)-CCI5),LINETHICK1;
CCI:=CCI1+CCI2+CCI3+CCI4+CCI5;
TJ1:=CCI1>差值4;
立桩量:=FILTER(TJ1,0);
TJ2:=IF(BARSLAST(立桩量)=1,1,IF(BARSLAST(立桩量)=2,1,IF(BARSLAST(立桩量)=3,1,0)));
成立1:=TJ2;
条件成立1:=FILTER(成立1,5);
TJ11:=CCI1<-差值4;
立桩量2:=FILTER(TJ11,0);
TJ22:=IF(BARSLAST(立桩量2)=1ANDC>REF(H,1),1,IF(BARSLAST(立桩量2)=2ANDC>REF(H,2),1,IF(BARSLAST(立桩量2)=3ANDC>REF(H,3),1,0)));
成立2:=TJ22;
条件成立2:=FILTER(成立2,5);
TJ111:=(ABS(CCI1)>CCIANDABS(差值1)>ABS(差值5))OR(VOL=HHV(VOL,10)ANDVOL>2*REF(VOL,1)ANDC>VAR1);
立桩量3:=FILTER(TJ111,5);
TJ222:=IF(BARSLAST(立桩量3)=1ANDC>REF(H,1),1,IF(BARSLAST(立桩量3)=2ANDC>REF(H,2),1,IF(BARSLAST(立桩量3)=3ANDC>REF(H,3),1,0)));
突破3:=TJ222=1;
STICKLINE(C>0AND下跌!=0,REF(H,BARSLAST(立桩量3)),REF(H,BARSLAST(立桩量3)),10,1),COLORCYAN;
STICKLINE(C>0AND下跌!=0,REF(L,BARSLAST(立桩量3)),REF(L,BARSLAST(立桩量3)),10,1),COLORYELLOW;
TJ3:=IF(BARSLAST(立桩量3)=1ANDC>REF(L,1),1,IF(BARSLAST(立桩量3)=2ANDC>REF(L,2),1,IF(BARSLAST(立桩量3)=3ANDC>REF(L,3),1,0)));
三天法则:=TJ3=1;
成立:=三天法则AND突破3;
条件成立:=FILTER(成立,5);
TJ31:=(VOL=HHV(VOL,10)ANDVOL>2*REF(VOL,1)ANDCLOSE>VAR1);
TJ32:=FILTER(TJ31,1);
DRAWICON(条件成立AND下跌!=0ANDAA30>=REF(AA30,1),H*1.002,4);
STICKLINE(立桩量,C,O,1.5,0),COLORBLUE;
DRAWICON(条件成立1,REF(HIGH,BARSLAST(立桩量3)),5);
DRAWICON(条件成立2,REF(LOW,BARSLAST(立桩量3)),6); 来源 程序化久久网

 

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

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

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

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


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

相关文章

    没有相关内容