MA[修改-W]
非常感谢一发千均、大庆老杨、等其它网友的部分源码;
指标供参考,据此入市,风险自负;
注意:该指标有未来函数,为“趋势无敌”画线部分所用,及财务信息部分; 其它地方未引用未来函数,包括准未来;
主图指标:
绘制收盘价的P1日、P2日、P3日、P4日、P5日移动平均线
P1、P2、P3、P4一般取5日、10日、20日、60日
N选择主图显示多少条均线(最多同时显示5条)
用法:
葛氏八法则
1.短期均线向上穿越长期均线,多头买入信号
2.短期均线向下跌破长期均线,多头卖出信号
信号说明:[2001.1.1-2008.6.21 成功率,按收盘价介入1天3%测试]
↑A 95.5%
↑B 95.4%
↑C 89.4%
↑1 88.9%
↑2 80.6%
↑3 80.3%
↑4 80.2%
↑5 75.5%
↑6 71.0%
↑7 67.5%
↑8 65.7%
↑9 62.8%
其它用法:
在参数选择里可以关闭“趋势无敌”画线,和关闭成功率低于80%或85%的信号指示;
STICKLINE(CLOSE>OPEN OR CLOSE=OPEN AND OPEN>REF(CLOSE,1),OPEN,CLOSE,8,0),color22FF;
STICKLINE(CLOSE>OPEN OR CLOSE=OPEN AND OPEN>REF(CLOSE,1),HIGH,LOW,1,0),color22FF;
STICKLINE(CLOSE>OPEN OR CLOSE=OPEN AND OPEN>REF(CLOSE,1),OPEN,CLOSE,5,0),color66FF;
STICKLINE(CLOSE>OPEN OR CLOSE=OPEN AND OPEN>REF(CLOSE,1),OPEN,CLOSE,3,0),color99FF;
STICKLINE(CLOSE>OPEN OR CLOSE=OPEN AND OPEN>REF(CLOSE,1),OPEN,CLOSE,1.5,0),colorDDFF;
STICKLINE(CLOSE>OPEN OR CLOSE=OPEN AND OPEN>REF(CLOSE,1),OPEN,CLOSE,0,0),colorDDFF;
STICKLINE(CLOSE<OPEN OR CLOSE=OPEN AND OPEN<REF(CLOSE,1),OPEN,CLOSE,8,0),colorFF2200;
STICKLINE(CLOSE<OPEN OR CLOSE=OPEN AND OPEN<REF(CLOSE,1),HIGH,LOW,1,0),colorFF2200;
STICKLINE(CLOSE<OPEN OR CLOSE=OPEN AND OPEN<REF(CLOSE,1),OPEN,CLOSE,5,0),colorFF6600;
STICKLINE(CLOSE<OPEN OR CLOSE=OPEN AND OPEN<REF(CLOSE,1),OPEN,CLOSE,3,0),colorFF9900;
STICKLINE(CLOSE<OPEN OR CLOSE=OPEN AND OPEN<REF(CLOSE,1),OPEN,CLOSE,1.5,0),colorFFDD00;
STICKLINE(CLOSE<OPEN OR CLOSE=OPEN AND OPEN<REF(CLOSE,1),OPEN,CLOSE,0,0),colorFFDD00;
STICKLINE(CLOSE=OPEN AND OPEN=REF(CLOSE,1),OPEN,CLOSE,8,0),colorFFFFFF;
STICKLINE(CLOSE=OPEN AND OPEN=REF(CLOSE,1),HIGH,LOW,1,0),colorFFFFFF;
STICKLINE(CLOSE=OPEN AND OPEN=REF(CLOSE,1),OPEN,CLOSE,5,0),colorFFFFFF;
STICKLINE(CLOSE=OPEN AND OPEN=REF(CLOSE,1),OPEN,CLOSE,3,0),colorFFFFFF;
STICKLINE(CLOSE=OPEN AND OPEN=REF(CLOSE,1),OPEN,CLOSE,1.5,0),colorFFFFFF;
STICKLINE(CLOSE=OPEN AND OPEN=REF(CLOSE,1),OPEN,CLOSE,0,0),colorFFFFFF;
空:=EMA(CLOSE,5);
均衡:EMA(空,0),colorFFFFFF;
持币:=HHV(MA(HIGH,3),2);
持股:=LLV(MA(HIGH,3),1);
B:持币,LINETHICK1,color80;
G:持股,LINETHICK1,color808080;
WX:=MA(CLOSE,0);
M1:MA(CLOSE,P1)*(IF(N<1,WX,1)),colorFFFFFF;
M2:MA(CLOSE,P2)*(IF(N<2,WX,1)),colorFFFF;
M3:MA(CLOSE,P3)*(IF(N<3,WX,1)),colorFF;
M4:MA(CLOSE,P4)*(IF(N<4,WX,1)),colorFF00;
M5:MA(CLOSE,P5)*(IF(N<5,WX,1)),colorFF0000;
VAR1D1:=(REF(CLOSE,2)-REF(CLOSE,1))/REF(CLOSE,2)>0.058;
VAR1D2:=(REF(CLOSE,3)-REF(CLOSE,2))/REF(CLOSE,3)>0.058;
VAR1D3:=REF(HIGH,2)-REF(HIGH,1);
VAR1D4:=REF(HIGH,1)-VAR1D3;
VAR1D5:=VOL/CAPITAL*100;
D3DS:=VAR1D5<15.595 AND (HIGH-LOW)/CLOSE>0.105 AND CLOSE>VAR1D4 AND VAR1D1 AND VAR1D2 AND CLOSE>OPEN AND MA(CLOSE,60)-MA(CLOSE,9)/2.629>CLOSE;
XG2VAR1:=CLOSE/REF(CLOSE,2)>=1.099;
XG2VAR2:=OPEN=LOW AND HIGH=CLOSE OR CLOSE>OPEN AND CLOSE=HIGH OR HIGH=OPEN AND (CLOSE<OPEN OR CLOSE=OPEN);
XG2VAR3:=VOL<SMA(VOL,4,1) AND VOL<REF(VOL,1);
D3NS:=XG2VAR1 AND XG2VAR2 AND XG2VAR3 AND (COUNT(XG2VAR1 AND XG2VAR2 AND XG2VAR3,1))=1;
XGVAR1:=DMA(CLOSE,VOL/SMA(VOL,4,1)/4);
XGVAR2:=DMA(CLOSE,VOL/SMA(VOL,19,1)/19);
XGVAR3:=(CLOSE-XGVAR1)/XGVAR1*100<-13.753;
XGVAR4:=(XGVAR1-XGVAR2)/XGVAR2*100<-24.109;
D2DS:=XGVAR3 AND XGVAR4 AND (OPEN>CLOSE OR OPEN<CLOSE) AND (OPEN-REF(CLOSE,1))/REF(CLOSE,1)>-0.099 AND (REF(CLOSE,1)>REF(OPEN,1) OR REF(CLOSE,1)<REF(OPEN,1)) AND (REF(OPEN,2)>REF(CLOSE,2) OR REF(OPEN,2)<REF(CLOSE,2)) AND (REF(OPEN,3)>REF(CLOSE,3) OR REF(OPEN,3)<REF(CLOSE,3)) AND (REF(OPEN,4)>REF(CLOSE,4) OR REF(OPEN,4)<REF(CLOSE,4)) AND (REF(OPEN,5)>REF(CLOSE,5) OR REF(OPEN,5)<REF(CLOSE,5)) AND (REF(OPEN,6)>REF(CLOSE,6) OR REF(OPEN,6)<REF(CLOSE,6)) AND (REF(OPEN,7)>REF(CLOSE,7) OR REF(OPEN,7)<REF(CLOSE,7));
VAR3DD1:=DMA(CLOSE,VOL/SMA(VOL,4,1)/4);
VAR3DD2:=DMA(CLOSE,VOL/SMA(VOL,20,1)/20);
VAR3DD3:=(CLOSE-VAR3DD1)/VAR3DD1*100<-14.159;
VAR3DD4:=(VAR3DD1-VAR3DD2)/VAR3DD2*100<-24.459;
VAR3DD5:=VAR3DD3 AND VAR3DD4;
D3DS2:=VAR3DD5 AND (OPEN>CLOSE OR OPEN<CLOSE) AND (OPEN-REF(CLOSE,1))/REF(CLOSE,1)>-0.099 AND (REF(CLOSE,1)>REF(OPEN,1) OR REF(CLOSE,1)<REF(OPEN,1)) AND (REF(OPEN,2)>REF(CLOSE,2) OR REF(OPEN,2)<REF(CLOSE,2)) AND (REF(OPEN,3)>REF(CLOSE,3) OR REF(OPEN,3)<REF(CLOSE,3)) AND (REF(OPEN,4)>REF(CLOSE,4) OR REF(OPEN,4)<REF(CLOSE,4)) AND (REF(OPEN,5)>REF(CLOSE,5) OR REF(OPEN,5)<REF(CLOSE,5)) AND (REF(OPEN,6)>REF(CLOSE,6) OR REF(OPEN,6)<REF(CLOSE,6)) AND (REF(OPEN,7)>REF(CLOSE,7) OR REF(OPEN,7)<REF(CLOSE,7)) AND CLOSE>0.1;
DJGLC:=REF(CLOSE,1);
DJGRSI:=(SMA(MAX(CLOSE-DJGLC,0),6,1))/(SMA(ABS(CLOSE-DJGLC),6,1))*100;
DJGY1:=REF(EMA(DMA((HIGH+LOW+CLOSE*2)/4.585,0.989),3),1);
DJG:=CROSS(CLOSE,DJGY1);
L1G:=VOL>MA(VOL,5) AND CLOSE>OPEN*(1+9/100) AND CLOSE<MA(CLOSE,20)*1.35;
L4NSYA:=OPEN<EMA(CLOSE,3) AND CLOSE=HIGH AND CLOSE/OPEN>=1.1099 AND VOL/CAPITAL>=0.02 AND VOL/CAPITAL<=0.2;
L4NS:=L4NSYA AND COUNT(L4NSYA,3)=1;
L5DSY:=-100*(HHV(HIGH,6)-CLOSE)/(HHV(HIGH,6)-LLV(LOW,6));
L5DS:=CROSS(L5DSY,-86.75) AND OPEN<SMA(CLOSE,20,1) AND CLOSE>=1.1*REF(CLOSE,1) AND INDEXC>1.055*REF(INDEXC,1) AND CLOSE<=1.117*LLV(CLOSE,60);
CFPLVAR3:=(CLOSE-MA(CLOSE,20))/MA(CLOSE,20)*100;
CFPL:=HHV(CLOSE,20)/CLOSE>1.15 AND HIGH/LOW>1.05 AND CROSS(-28,CFPLVAR3);
YSGSMAV:=(2*CLOSE+HIGH+LOW)/4;
YSGSD:=SLOPE(EMA(YSGSMAV,2),7)*15+YSGSMAV;
YSGSD1:=EMA(YSGSD,2);
YSGSD2:=0.972*YSGSD-0.638*YSGSD1;
YSGS:=CROSS(YSGSD2,YSGSD1);
XRGSVAR1:=(CLOSE-MA(CLOSE,40))/MA(CLOSE,40)*100<-23;
XRGSVAR2:=(SMA(MAX(CLOSE-REF(CLOSE,1),0),3,1))/(SMA(ABS(CLOSE-REF(CLOSE,1)),3,1))*100>16;
XRGSVAR3:=100*(HHV(HIGH,20)-CLOSE)/(HHV(HIGH,20)-LLV(LOW,20));
XRGS:=XRGSVAR1 AND XRGSVAR2 AND CROSS(XRGSVAR3,79) AND (OPEN>CLOSE OR OPEN<CLOSE) AND (OPEN-REF(CLOSE,1))/REF(CLOSE,1)<0.05 AND VOL>MA(VOL,23);
L3RSV:=(CLOSE-LLV(LOW,7))/(HHV(HIGH,7)-LLV(LOW,7))*100;
L3DK:=SMA(L3RSV,3,1);
L3DD:=SMA(L3DK,3,1);
L3DJ:=3*L3DK-2*L3DD;
L3LC:=REF(CLOSE,1);
L3RSI:=(SMA(MAX(CLOSE-L3LC,0),6,1))/(SMA(ABS(CLOSE-L3LC),6,1))*100;
L3DIFF:=EMA(CLOSE,6)-EMA(CLOSE,26);
L3DEA:=EMA(L3DIFF,5);
L3MACD:=2*(L3DIFF-L3DEA);
L3WR:=-100*(HHV(HIGH,7)-CLOSE)/(HHV(HIGH,7)-LLV(LOW,7));
L3WZ:=L3DJ>REF(L3DJ,1) AND L3RSI>REF(L3RSI,1) AND L3MACD>REF(L3MACD,1) AND L3WR>REF(L3WR,1) AND VOL/120>MA(VOL,90)/120 AND CLOSE>OPEN*1.09 AND CLOSE<MA(CLOSE,20)*1.99;
DRAWTEXT(L5DS,LOW*0.98,'↑A'),ALIGN1,colorFF;
DRAWTEXT(D3NS,LOW*0.96,'↑B'),ALIGN1,color22FF;
DRAWTEXT(D3DS2,LOW*0.94,'↑C'),ALIGN1,colorDDFF;
DRAWTEXT(D2DS,LOW*0.92,'↑1'),ALIGN1,colorFF00FF;
DRAWTEXT(YSGS*DCGL2,LOW*0.9,'↑2'),ALIGN1,colorCC0099;
DRAWTEXT(L4NS*DCGL2,LOW*0
|