源码
Var1:=EMA(CLOSE,34)-EMA(CLOSE,5);
Var2:=EMA(Var1,5);
趋势: (-3)*(Var1-Var2), COLORSTICK;长期趋势:EMA(Var1,10)*(-1);
趋势;
DIFF : EMA(CLOSE,12) - EMA(CLOSE,26),COLORSTICK;
DEA : EMA(DIFF,9);
AA:=BARSLAST(CROSS(DIFF,DEA) AND DEA<-0.1)<=8;
DEA<-0.1 AND CROSS(DIFF,DEA) AND IF(AA=1,1,0);
TIPTEXT(AA,0,'MACD最佳买入时机'),linethick2,COLORYELLOW;
TIPTEXT(趋势>0,0,'Z线趋势上升中\n');
TIPTEXT(趋势<0,0,'Z线趋势下降中\n');
TIPTEXT(cross(趋势,0),0,'Z线考虑买入\n');
TIPTEXT(cross(0,趋势),0,'Z线考虑卖出\n');
Var11:=ma((v/(h-l)),4);
Var33:=abs(c-o);Var44:=v/(h-l);
TIPTEXT(Var44<var11 AND Var33<ma(Var33,4),0,'资金无入场意愿,萎缩中\n');
TIPTEXT(Var44<var11 AND Var33>ma(Var33,4),0,'场内资金运作行为\n');
TIPTEXT(Var44>var11 AND Var33<ma(Var33,4),0,'多空双方激烈争夺中\n');
TIPTEXT(Var44>var11 AND Var33>ma(Var33,4),0,'场外资金介入(或出局)意愿强烈\n');
TR := 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;
DMP:= SUM(IF(HD>0 AND HD>LD,HD,0),14);
DMM:= SUM(IF(LD>0 AND LD>HD,LD,0),14);
PDI:= DMP*100/TR;
MDI:= DMM*100/TR;
ADX:= MA(ABS(MDI-PDI)/(MDI+PDI)*100,6);
ADXR:=(ADX+REF(ADX,6))/2;
TIPTEXT(cross(pdi,mdi),0,'PDI线从下向上突破MDI线,显示有新多头进场,为买进信号\n');
TIPTEXT(cross(mdi,pdi),0,'PDI线从上向下跌破MDI线,显示有新空头进场,为卖出信号\n');
TIPTEXT(adx>ref(adx,1),0,'ADX值持续高于前一日,行情将维持原趋势\n');
TIPTEXT(adx<ref(adx,1) and adx<20,0,'ADX值递减,降到20以下,且横向行进时,市场气氛为盘整\n');
TIPTEXT(adx<ref(adx,1) and ref(adx,1)<ref(adx,2) and ref(adx,2)>ref(adx,3) and ref(adx,3)>ref(adx,4),0,'ADX值从上升倾向转为下降时,表明行情即将反转\n');
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
TIPTEXT(1=1,0,'※※※※※※※※※\n下面为KDJ,CCI,W&R,RSI,MTM等指标的判断 \n※※※※※※※※※\n');
TIPTEXT(cross(j,k) and k<50,0,'KDJ金叉\n');
TIPTEXT(cross(k,j) and k>50,0,'KDJ死叉\n');
TIPTEXT(j>84,0,'KDJ指标高位');
TIPTEXT(j<16,0,'KDJ指标低位\n');
TYP := (HIGH + LOW + CLOSE)/3;
cci:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));
TIPTEXT(cci<-100,0,'CCI指标底位,买入机会\n');
TIPTEXT(cci>100,0,'CCI指标高位,卖出机会\n');
wr:=-100*(HHV(HIGH,14)-CLOSE)/(HHV(HIGH,14)-LLV(LOW,14));
TIPTEXT(wr>-20,0,'W&R超买,即将见顶,应及时卖出\n');
TIPTEXT(wr<-80,0,'W&R超卖,即将见底,应伺机买进\n');
MTM := CLOSE-REF(CLOSE,6);
MTMMA := MA(MTM,6);
TIPTEXT(CROSS(MTM,MTMMA),0,'MTM从下向上突破MTMMA,买入信号\n');
TIPTEXT(CROSS(MTMMA,MTM),0,'MTM从上向下跌破MTMMA,卖出信号\n');
LC := REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
RSI2:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;
TIPTEXT(RSI1>85,0,'6日RSI向上突破85,超买,考虑卖出\n');
TIPTEXT(RSI1<15,0,'6日RSI向下跌破15,超卖,考虑买入\n');
TIPTEXT(CROSS(RSI1,RSI2),0,'6日RSI向上突破12日RSI,买进信号\n');
TIPTEXT(CROSS(RSI2,RSI1),0,'6日RSI向下跌破12日RSI,卖出信号\n');
psy:=COUNT(CLOSE>REF(CLOSE,1),12)/12*100;
TIPTEXT(1=1,0,'换手率=');
TIPTEXT(1=1,0,'12天心理线,PSY=');
TIPTEXT(1=1,0,'获利盘比例=');
TIPTEXT(1=1,0,'套牢盘比例=');