【主图MACD+副图J线共振】-【飞狐源码】+【贴图】
主图,信号多了点,起个提示作用,有两组买卖信号,分别是均线和MACD,共振时参考
{主图MACD-BY创幻loy518}
{绿旗、红珠均线买卖信号,三角、黄铢MACD买卖信号,标准MACD叠加-红绿柱缩涨+DIFF/DEA彩带-轴线变红转强}
CC:=C;
ZZ:=(SYSPARAM(4)-SYSPARAM(5))/2;
ZZX:=ZZ+SYSPARAM(5);
RR:=IF(CC[SYSPARAM(3)]<=ZZX,ZZX+ZZ,ZZX-ZZ);
INPUT:P(26,20,100),S(12,5,40),M(9,2,60),N(2,1,100);
DIFF : EMA(CLOSE,S) - EMA(CLOSE,P),LINETHICK;
DEA : EMA(DIFF,M),LINETHICK;
MACD : 2*(DIFF-DEA),LINETHICK;
DIFFA:=DIFF*N+RR;
DEAA:=DEA*N+RR;
FILLRGN(DIFFA>DEAA,DIFFA,DEAA),COLORFF0080;
FILLRGN(DIFFA<DEAA,DIFFA,DEAA),COLOR808000;
B:=MACD-REF(MACD,1);
STICKLINE(MACD>0 AND B>0,RR,(MACD*N+RR),8,0),COLOR8000FF;
STICKLINE(MACD>0 AND B<0,RR,(MACD*N+RR),8,1),COLOR8000FF;
STICKLINE(MACD<0 AND B>0,RR,(MACD*N+RR),8,1),COLORGRAY;
STICKLINE(MACD<0 AND B<0,RR,(MACD*N+RR),8,0),COLORGRAY;
PARTLINE(C,DIFFA);
PARTLINE(C,DEAA);
{MA}
KLINE(O,H,L,C,0);
INPUT:P1(3,0,300){,P2(10,0,300),P3(20,0,300),P4(30,0,300),P5(60,0,9999),P6(120,0,9999),P7(240,0,9999),P8(360,0,9999),N1(1,1,8)};
wx:=MA(c,0);
M1:MA(CLOSE,P1);
{M2:MA(CLOSE,P2)*if(n1<2,wx,1);
M3:MA(CLOSE,P3)*if(n1<3,wx,1);
M4:MA(CLOSE,P4)*if(n1<4,wx,1);
M5:MA(CLOSE,P5)*if(n1<5,wx,1);
M6:MA(CLOSE,P6)*if(n1<6,wx,1);
M7:MA(CLOSE,P7)*if(n1<7,wx,1);
M8:MA(CLOSE,P8)*if(n1<8,wx,1);}
顶:=(H+C)/2,LINETHICK2,Color006400;
底:=(L+O)/2,LINETHICK2,ColorFF6400;
轴:(顶+底)/2,LINETHICK2,COLORFFFFCC;
度:(轴-REF(轴,1)),LINETHICK;
分:(度-REF(度,1))/度,LINETHICK;
PARTLINE(轴-REF(轴,1)>REF(轴-REF(轴,1),1),轴),COLORRED,LINETHICK3;
买:CROSS(轴,M1),LINETHICK;
卖:CROSS(M1,轴),LINETHICK;
买A:(轴-REF(轴,1))>REF((轴-REF(轴,1)),1) AND (MACD-REF(MACD,1))>REF((MACD-REF(MACD,1)),1),LINETHICK;
卖A:(轴-REF(轴,1))<REF((轴-REF(轴,1)),1) AND (MACD-REF(MACD,1))<REF((MACD-REF(MACD,1)),1),LINETHICK;
DRAWICON(买,L*0.99,7);
DRAWICON(卖,H*1.015,10),PXUP25;
DRAWICON(卖A,MAX(RR,(MACD*N+RR)),12),PXUP25;
DRAWICON(买A,MIN(RR,(MACD*N+RR)),8),PXDN10;
{成本重心不能随复权数据变化,遇上复权会偏离,加上条件过滤掉...
涨跌引力好像还有改进余地,可惜暂时想到。。。
成本重心(紫红色)在价咯重心(蓝色)的上面时看涨,反之看跌; 差值在图顶上可以看到正负变化; 正数看涨,即成本重心高于价咯重心; 负数看跌,即成本重心低于价咯重心; }
价咯重心:=(O+L+H+C)/4;
成本董心:=AMOUNT/VOL/100;
成本重心:=IF(成本董心>H OR 成本董心<L,价咯重心,成本董心);
重心偏离:(成本重心-价咯重心)*100,LINETHICK;
涨跌引力:=((C-成本重心)+(价咯重心-O))*100,LINETHICK1;
STICKLINE(1,成本重心,成本重心,3,0),COLORFF00FF;
STICKLINE(1,价咯重心,价咯重心,3,0),COLORFF8800;
{》》 看本软件截图:
分.析家公 式网 http://www、88gs、com 整理}