将MACD指标和KDJ指标放到一个副图内显示 [博易POBO]
咨询内容:
注意图中暗灰色虚线分别表示KDJ指标的80,50,20线:
LONG:=26; SHORT:=12; MID:=9; {MACD指标参数}
DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG), LINETHICK0, PRECIS2, COLORWHITE;
DEA : EMA(DIFF,MID), LINETHICK0, PRECIS2, COLORYELLOW;
MACD : 2*(DIFF-DEA), LINETHICK0, PRECIS2, COLORMAGENTA;
N:=9; M1:=3; M2:=3; {KDJ指标参数}
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K: SMA(RSV,M1,1), LINETHICK0, PRECIS2, COLORWHITE;
D: SMA(K,M2,1), LINETHICK0, PRECIS2, COLORYELLOW;
J: 3*K-2*D, LINETHICK0, PRECIS2, COLORMAGENTA;
STEP:=200;
TOPBOUND:= REFX(HHV(DIFF, STEP), STEP/2);
BTNBOUND:= REFX(LLV(DIFF, STEP), STEP/2);
MIDBOUND:= (TOPBOUND-BTNBOUND);
PARTLINE(1, MIDBOUND*0.8 + BTNBOUND), COLOR333333, POINTDOT;
PARTLINE(1, MIDBOUND*0.5 + BTNBOUND), COLOR333333, POINTDOT;
PARTLINE(1, MIDBOUND*0.2 + BTNBOUND), COLOR333333, POINTDOT;
PARTLINE(1, J*MIDBOUND/100 + BTNBOUND), COLOR333333;
PARTLINE(1, D*MIDBOUND/100 + BTNBOUND), COLOR666666;
PARTLINE(1, K*MIDBOUND/100 + BTNBOUND), COLOR999999;
MACD, COLORSTICK;
PARTLINE(1, DIFF), COLORWHITE;
PARTLINE(1, DEA), COLORYELLOW;
-------------------------
按有人需求,下面这个是MACD和RSI合在一起的指标:
LONG:=26; SHORT:=12; MID:=9; {MACD指标参数}
DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG), LINETHICK0, PRECIS2, COLORWHITE;
DEA : EMA(DIFF,MID), LINETHICK0, PRECIS2, COLORYELLOW;
MACD : 2*(DIFF-DEA), LINETHICK0, PRECIS2, COLORMAGENTA;
N1:=6; N2:=12; N3:=26; {RSI指标, 虚线是80,50,20刻度线}
LC := REF(CLOSE,1);
RSI1:SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100,LINETHICK0;
RSI2:SMA(MAX(CLOSE-LC,0),N2,1)/SMA(ABS(CLOSE-LC),N2,1)*100,LINETHICK0;
RSI3:SMA(MAX(CLOSE-LC,0),N3,1)/SMA(ABS(CLOSE-LC),N3,1)*100,LINETHICK0;
STEP:=200;
TOPBOUND:= REFX(HHV(DIFF, STEP), STEP/2);
BTNBOUND:= REFX(LLV(DIFF, STEP), STEP/2);
MIDBOUND:= (TOPBOUND-BTNBOUND);
PARTLINE(1, MIDBOUND*0.8 + BTNBOUND), COLOR333333, POINTDOT;
PARTLINE(1, MIDBOUND*0.5 + BTNBOUND), COLOR333333, POINTDOT;
PARTLINE(1, MIDBOUND*0.2 + BTNBOUND), COLOR333333, POINTDOT;
PARTLINE(1, RSI1*MIDBOUND/100 + BTNBOUND), COLOR333333;
PARTLINE(1, RSI2*MIDBOUND/100 + BTNBOUND), COLOR666666;
PARTLINE(1, RSI3*MIDBOUND/100 + BTNBOUND), COLOR999999;
MACD, COLORSTICK;
PARTLINE(1, DIFF), COLORWHITE;
PARTLINE(1, DEA), COLORYELLOW;
<!-- 咨询内容:
感谢楼主的分享。:handshake
将MACD指标和KDJ指标放到一个副图内显示
本帖最后由 riverszhao 于 2015-1-8 21:17 编辑注意图中暗灰色虚线分别表示KDJ指标的80,50,20线:
LONG:=26; SHORT:=12; MID:=9; {MACD指标参数}
DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG), LINETHICK0, PRECIS2, COLORWHITE;
DEA : EMA(DIFF,MID), LINETHICK0, PRECIS2, COLORYELLOW;
MACD : 2*(DIFF-DEA), LINETHICK0, PRECIS2, COLORMAGENTA;
N:=9; M1:=3; M2:=3; {KDJ指标参数}
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K: SMA(RSV,M1,1), LINETHICK0, PRECIS2, COLORWHITE;
D: SMA(K,M2,1), LINETHICK0, PRECIS2, COLORYELLOW;
J: 3*K-2*D, LINETHICK0, PRECIS2, COLORMAGENTA;
STEP:=200;
TOPBOUND:= REFX(HHV(DIFF, STEP), STEP/2);
BTNBOUND:= REFX(LLV(DIFF, STEP), STEP/2);
MIDBOUND:= (TOPBOUND-BTNBOUND);
PARTLINE(1, MIDBOUND*0.8 + BTNBOUND), COLOR333333, POINTDOT;
PARTLINE(1, MIDBOUND*0.5 + BTNBOUND), COLOR333333, POINTDOT;
PARTLINE(1, MIDBOUND*0.2 + BTNBOUND), COLOR333333, POINTDOT;
PARTLINE(1, J*MIDBOUND/100 + BTNBOUND), COLOR333333;
PARTLINE(1, D*MIDBOUND/100 + BTNBOUND), COLOR666666;
PARTLINE(1, K*MIDBOUND/100 + BTNBOUND), COLOR999999;
MACD, COLORSTICK;
PARTLINE(1, DIFF), COLORWHITE;
PARTLINE(1, DEA), COLORYELLOW;
-------------------------
按有人需求,下面这个是MACD和RSI合在一起的指标:
LONG:=26; SHORT:=12; MID:=9; {MACD指标参数}
DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG), LINETHICK0, PRECIS2, COLORWHITE;
DEA : EMA(DIFF,MID), LINETHICK0, PRECIS2, COLORYELLOW;
MACD : 2*(DIFF-DEA), LINETHICK0, PRECIS2, COLORMAGENTA;
N1:=6; N2:=12; N3:=26; {RSI指标, 虚线是80,50,20刻度线}
LC := REF(CLOSE,1);
RSI1:SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100,LINETHICK0;
RSI2:SMA(MAX(CLOSE-LC,0),N2,1)/SMA(ABS(CLOSE-LC),N2,1)*100,LINETHICK0;
RSI3:SMA(MAX(CLOSE-LC,0),N3,1)/SMA(ABS(CLOSE-LC),N3,1)*100,LINETHICK0;
STEP:=200;
TOPBOUND:= REFX(HHV(DIFF, STEP), STEP/2);
BTNBOUND:= REFX(LLV(DIFF, STEP), STEP/2);
MIDBOUND:= (TOPBOUND-BTNBOUND);
PARTLINE(1, MIDBOUND*0.8 + BTNBOUND), COLOR333333, POINTDOT;
PARTLINE(1, MIDBOUND*0.5 + BTNBOUND), COLOR333333, POINTDOT;
PARTLINE(1, MIDBOUND*0.2 + BTNBOUND), COLOR333333, POINTDOT;
PARTLINE(1, RSI1*MIDBOUND/100 + BTNBOUND), COLOR333333;
PARTLINE(1, RSI2*MIDBOUND/100 + BTNBOUND), COLOR666666;
PARTLINE(1, RSI3*MIDBOUND/100 + BTNBOUND), COLOR999999;
MACD, COLORSTICK;
PARTLINE(1, DIFF), COLORWHITE;
PARTLINE(1, DEA), COLORYELLOW;
<!-- 咨询内容:
附件 :
-->博易技术人员: :victory::lol 本帖最后由hart_wangweig于2014-12-3008:43编辑
感谢楼主的分享。:handshake
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 511411198 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容