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

麻烦老师看一下 [博易POBO]

咨询内容:

麻烦老师看一下

DIFF1:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA1:=EMA(DIFF1,9);
//DRAWBAND(DEA1,DRAWNULL,DIFF1,RGB(250,0,0));
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26),COLORYELLOW;
DEA:=EMA(DIFF,9),COLORCYAN;
MACD:=2*(DIFF-DEA),COLORSTICK;
TR1:=SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14);
HD:=HIGH-REF(HIGH,1);
LD:=REF(LOW,1)-LOW;
PDM:=SUM(IF(HD>0 AND HD>LD,HD,0),14);
MDM:=SUM(IF(LD>0 AND LD>HD,LD,0),14);
PDI:=PDM*100/TR1;
MDI:=MDM*100/TR1;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;//收盘价与N周期最低值做差,N周期最高值与N周期最低值做差,两差之间做比值。
K:=SMA(RSV,3,1);//RSV的移动平均值
D:=SMA(K,3,1);//K的移动平均值
J:=3*K-2*D;
LC := REF(CLOSE,6);//前一周期收盘价
RSI1:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;//当根K线收盘价与前一周期收盘价做差,在该差值与0之间取最大值,做N1周期移动平均。收盘价与前一周期收盘价做差值,取该差值的N1周期移动平均值,两平均值之间做比值。
RSI2:=SMA(MAX(CLOSE-LC,0),24,1)/SMA(ABS(CLOSE-LC),24,1)*100;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);
A2:=BARSLAST(REF(CROSS(K,D),1));
B2:=REF(C,A2+1)>C AND REF(K,A2+1)<K AND CROSS(K,D);
A3:=BARSLAST(REF(CROSS(RSI1,RSI2),1));
B3:=REF(C,A3+1)>C AND REF(RSI1,A3+1)<RSI1 AND CROSS(RSI1,RSI2);
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF);
C2:=BARSLAST(REF(CROSS(D,K),1));
D2:=REF(C,C2+1)<C AND REF(K,C2+1)>K AND CROSS(D,K);
C3:=BARSLAST(REF(CROSS(RSI2,RSI1),1));
D3:=REF(C,C3+1)<C AND REF(RSI1,C3+1)>RSI1 AND CROSS(RSI2,RSI1);
C4:=BARSLAST(REF(CROSS(MDI,PDI),1));
D4:=REF(C,C+1)<C AND REF(MDI,C4+1)>MDI AND CROSS(MDI,PDI);
A4:=BARSLAST(REF(CROSS(PDI,MDI),1));
B4:=REF(C,A4+1)>C AND REF(PDI,A4+1)<PDI AND CROSS(PDI,MDI);
MACD底背:IF(B1>0,1,0),COLORRED,NODRAW;
KDJ底背:IF(B2>0,1,0),COLORFF00FF,NODRAW;
RSI底背:IF(B3>0,1,0),COLORYELLOW,NODRAW;
DMI底背:IF(B4>0,1,0),COLORLIGHTRED,NODRAW;
MACD顶背:IF(D1>0,1,0),COLOR00FF00,NODRAW;
KDJ顶背:IF(D2>0,1,0),COLORFFCC66,NODRAW;
RSI顶背:IF(D3>0,1,0),COLORWHITE,NODRAW;
DMI顶背:IF(D4>0,1,0),COLORRED,NODRAW;

STICKLINE(B1>0,-0.1,0,2,0),COLORRED;
STICKLINE(B2>0,-0.1,-0.2,2,0),COLORFF00FF;
STICKLINE(B3>0,-0.1,0,2,0),COLORYELLOW;
STICKLINE(B4>0,-0.1,-0.2,2,0),COLORLIGHTRED;
STICKLINE(D1>0,0.1,0,2,0),COLOR00FF00;
STICKLINE(D2>0,0.1,0.2,2,0),COLORFFCC66;
STICKLINE(D3>0,0.1,0,2,0),COLORWHITE;
STICKLINE(D4>0,0.1,0.2,2,0),COLORRED;
 
 
 
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=CROSS(K,D);
S:=CROSSDOWN(K,D);
DIFF :=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA  : =EMA(DIFF,9);
MACD:=2*(DIFF-DEA),COLORSTICK;
金:=CROSS(DIFF,DEA);
死:=CROSSDOWN(DIFF,DEA);
DRAWCOLORKLINE(J&&金,COLORRED,0);
DRAWCOLORKLINE(S&&死,COLORGREEN,0);
 
麻烦老师讲上边两个指标改成博易的,谢谢

 

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

博易技术人员: DIFF1:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA1:=EMA(DIFF1,9);
//DRAWBAND(DEA1,DRAWNULL,DIFF1,RGB(250,0,0));
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26),COLORYELLOW;
DEA:=EMA(DIFF,9),COLORCYAN;
MACD:=2*(DIFF-DEA),COLORSTICK;
TR1:=SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14);
HD:=HIGH-REF(HIGH,1);
LD:=REF(LOW,1)-LOW;
PDM:=SUM(IF(HD>0 AND HD>LD,HD,0),14);
MDM:=SUM(IF(LD>0 AND LD>HD,LD,0),14);
PDI:=PDM*100/TR1;
MDI:=MDM*100/TR1;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;//收盘价与N周期最低值做差,N周期最高值与N周期最低值做差,两差之间做比值。
K:=SMA(RSV,3,1);//RSV的移动平均值
D:=SMA(K,3,1);//K的移动平均值
J:=3*K-2*D;
LC := REF(CLOSE,6);//前一周期收盘价
RSI1:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;//当根K线收盘价与前一周期收盘价做差,在该差值与0之间取最大值,做N1周期移动平均。收盘价与前一周期收盘价做差值,取该差值的N1周期移动平均值,两平均值之间做比值。
RSI2:=SMA(MAX(CLOSE-LC,0),24,1)/SMA(ABS(CLOSE-LC),24,1)*100;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);
A2:=BARSLAST(REF(CROSS(K,D),1));
B2:=REF(C,A2+1)>C AND REF(K,A2+1)<K AND CROSS(K,D);
A3:=BARSLAST(REF(CROSS(RSI1,RSI2),1));
B3:=REF(C,A3+1)>C AND REF(RSI1,A3+1)<RSI1 AND CROSS(RSI1,RSI2);
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF);
C2:=BARSLAST(REF(CROSS(D,K),1));
D2:=REF(C,C2+1)<C AND REF(K,C2+1)>K AND CROSS(D,K);
C3:=BARSLAST(REF(CROSS(RSI2,RSI1),1));
D3:=REF(C,C3+1)<C AND REF(RSI1,C3+1)>RSI1 AND CROSS(RSI2,RSI1);
C4:=BARSLAST(REF(CROSS(MDI,PDI),1));
D4:=REF(C,C+1)<C AND REF(MDI,C4+1)>MDI AND CROSS(MDI,PDI);
A4:=BARSLAST(REF(CROSS(PDI,MDI),1));
B4:=REF(C,A4+1)>C AND REF(PDI,A4+1)<PDI AND CROSS(PDI,MDI);
MACD底背:IF(B1>0,1,0),COLORRED,NODRAW;
KDJ底背:IF(B2>0,1,0),COLORFF00FF,NODRAW;
RSI底背:IF(B3>0,1,0),COLORYELLOW,NODRAW;
DMI底背:IF(B4>0,1,0),COLORRED,NODRAW;
MACD顶背:IF(D1>0,1,0),COLOR00FF00,NODRAW;
KDJ顶背:IF(D2>0,1,0),COLORFFCC66,NODRAW;
RSI顶背:IF(D3>0,1,0),COLORWHITE,NODRAW;
DMI顶背:IF(D4>0,1,0),COLORRED,NODRAW;
STICKLINE(B1>0,-0.1,0,2,0),COLORRED;
STICKLINE(B2>0,-0.1,-0.2,2,0),COLORFF00FF;
STICKLINE(B3>0,-0.1,0,2,0),COLORYELLOW;
STICKLINE(B4>0,-0.1,-0.2,2,0),COLORRED;
STICKLINE(D1>0,0.1,0,2,0),COLOR00FF00;
STICKLINE(D2>0,0.1,0.2,2,0),COLORFFCC66;
STICKLINE(D3>0,0.1,0,2,0),COLORWHITE;
STICKLINE(D4>0,0.1,0.2,2,0),COLORRED;
 
以上公式附图保存显示
 
 
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=CROSS(K,D);
S:=CROSS(D,K);
DIFF :=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA  :=EMA(DIFF,9);
MACD:=2*(DIFF-DEA),COLORSTICK;
金:=CROSS(DIFF,DEA);
死:=CROSS(DEA,DIFF);
DRAWICON(J&&金,L,4);
DRAWICON(S&&死,H,5);
以上公式主图保存显示
 
  来源 程序化久久网

 

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

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

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

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


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

相关文章

    没有相关内容