YDD:='==FANGCAI==';
DRAWTEXT(DISPSTATUS=2=BARSCOUNT(CLOSE),CLOSE,YDD),ALIGN2,color00FF00;
DRAWFLAGTEXT(CLOSE,C,'【金城指标解盘系统提示】'),color0000FF;
MA5:=MA(CLOSE,5);
MA10:=MA(CLOSE,10);
MA20:=MA(CLOSE,20);
MA60:=MA(CLOSE,60);
DRAWFLAGTEXT(MA5>REF(MA5,1)*1.01,C,'5日均线:强劲向上');
DRAWFLAGTEXT(MA5>REF(MA5,1),C,'5日均线:向上');
DRAWFLAGTEXT(MA5=REF(MA5,1),C,'5日均线:持平');
DRAWFLAGTEXT(MA5<REF(MA5,1)*0.985,C,'5日均线:快速向下');
DRAWFLAGTEXT(MA5<REF(MA5,1),C,'5日均线:向下');
DRAWFLAGTEXT(MA10>REF(MA10,1),C,'10日均线:向上');
DRAWFLAGTEXT(MA10<REF(MA10,1),C,'10日均线:向下');
DRAWFLAGTEXT(MA10=REF(MA10,1),C,'10日均线:持平');
DRAWFLAGTEXT(MA20>REF(MA20,1),C,'20日均线:向上');
DRAWFLAGTEXT(MA20<REF(MA20,1),C,'20日均线:向下');
DRAWFLAGTEXT(MA20=REF(MA20,1),C,'20日均线:持平');
DRAWFLAGTEXT(MA60>REF(MA60,1),C,'60日均线:向上');
DRAWFLAGTEXT(MA60<REF(MA60,1),C,'60日均线:向下');
DRAWFLAGTEXT(MA60=REF(MA60,1),C,'60日均线:持平');
ld:=ma(v/(h-l),4);
dmp:=abs(c-o);
dmm:=v/(h-l);
DRAWFLAGTEXT(dmm<ld and dmp<ma(dmp,4),C,'资金无入场意愿,萎缩中');
DRAWFLAGTEXT(dmm<ld and dmp>ma(dmp,4),C,'场内资金有运作行为');
DRAWFLAGTEXT(dmm>ld and dmp<ma(dmp,4),C,'多空双方激烈争夺中');
DRAWFLAGTEXT(dmm>ld and dmp>ma(dmp,4),C,'场外资金介入(或出局)意愿强烈');
pdi:=sum(max(max(h-l,abs(h-ref(c,1))),abs(l-ref(c,1))),14);
mdi:=h-ref(h,1);
adx:=ref(l,1)-l;
adxr:=sum(if(mdi>0 and mdi>adx,mdi,0),14);
typ:=sum(if(adx>0 and adx>mdi,adx,0),14);
cci:=adxr*100/pdi;
wr:=typ*100/pdi;
mtm:=ma(abs(wr-cci)/(wr+cci)*100,6);
mtmma:=(mtm+ref(mtm,6))/2;
DRAWFLAGTEXT(cross(cci,wr),C,'PDI线从下向上突破MDI线,显示有新多头进场,为买进信号');
DRAWFLAGTEXT(cross(wr,cci),C,'PDI线从上向下跌破MDI线,显示有新空头进场,为卖出信号');
DRAWFLAGTEXT(mtm>ref(mtm,1),C,'ADX值持续高于前一日,行情将维持原趋势'),colorffff00;
DRAWFLAGTEXT(mtm<ref(mtm,1) and mtm<20,C,'ADX值递减,降到20以下,且横向行进时,市场气氛为盘整');
DRAWFLAGTEXT(mtm<ref(mtm,1) and ref(mtm,1)<ref(mtm,2) and ref(mtm,2)>ref(mtm,3) and ref(mtm,3)>ref(mtm,4),C,'ADX值从上升倾向转为下降时,表明行情即将反转');
psy:=c-ref(c,6);
布林1:=ma(psy,6);
DRAWFLAGTEXT(cross(psy,布林1) and 布林1<-0.8,C,'MTM从下向上突破MTMMA,买入信号');
DRAWFLAGTEXT(cross(布林1,psy) and 布林1>0.8,C,'MTM从上向下跌破MTMMA,卖出信号');
布林2:=ref(c,1);
布林3:=sma(max(c-布林2,0),6,1)/sma(abs(c-布林2),6,1)*100;
布林4:=sma(max(c-布林2,0),12,1)/sma(abs(c-布林2),12,1)*100;
DRAWFLAGTEXT(布林3>85,C,'6日RSI超买,防止回挡');
DRAWFLAGTEXT(布林3>80,C,'6日RSI向上突破85,超买,考虑卖出');
DRAWFLAGTEXT(布林3<15,C,'6日RSI超卖,随时有可能反弹');
DRAWFLAGTEXT(布林3<15,C,'6日RSI向下跌破15,超卖,考虑买入');
DRAWFLAGTEXT(cross(布林3,15),C,'6日RSI向上突破15,买进信号');
DRAWFLAGTEXT(cross(布林3,85),C,'6日RSI向下跌破85,卖出信号');
布林5:=count(c>ref(c,1),12)/12*100;
布林6:=(ma(c,3)+ma(c,6)+ma(c,12)+ma(c,24))/4;
布林7:=布林6+3*std(布林6,10);
xx:=布林6-3*std(布林6,10);
a001:=(布林7-xx)/布林7<0.03;
a002:=(布林7-xx)/布林7>0.18;
a003:=(ma(c,60)-ma(c,5))/ma(c,60)>0.15;
a004:=(ma(c,5)-ma(c,60))/ma(c,5)>0.15;
DRAWFLAGTEXT(a001,C,'多空布林收敛中,有变盘的可能,上下自己分析');
DRAWFLAGTEXT(a003 and a002 and c>o,C,'布林上下乖离太大,有反弹的可能');
DRAWFLAGTEXT(a004 and a002 and c<o,C,'布林上下乖离太大,有回落的可能');
DRAWFLAGTEXT(h>=hhv(h,20),C,'创20天新高');
{RSI 6 12 24}
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;
RSI3:=SMA(MAX(CLOSE-LC,0),24,1)/SMA(ABS(CLOSE-LC),24,1)*100;
RSII:=SMA(MAX(CLOSE-LC,0),3,1)/SMA(ABS(CLOSE-LC),3,1)*100;
R:=FILTER(CLOSE>LLV(LOW,30)*1.01 and CLOSE<LLV(LOW,30)*1.1
and COUNT(CROSS(rsi1,rsi2),30)>=2,10)
and COUNT(REF(CLOSE,BARSLAST(REF(CROSS(rsi1,rsi2),1))+1)>CLOSE
and REF(rsi1,BARSLAST(REF(CROSS(rsi1,rsi2),1))+1)<rsi1
and CROSS(rsi1,rsi2),5)>=1 ;
A3:=BARSLAST(REF(CROSS(RSI1,RSI2),1));
B3:=REF(CLOSE,A3+1)>CLOSE and REF(RSI1,A3+1)<RSI1 and CROSS(RSI1,RSI2);
C3:=BARSLAST(REF(CROSS(RSI2,RSI1),1));
f4:=REF(CLOSE,C3+1)<CLOSE and REF(RSI1,C3+1)>RSI1 and CROSS(RSI2,RSI1);
DRAWFLAGTEXT(R,C,'RSI二次金叉');
DRAWFLAGTEXT(b3,C,'RSI底背离');
DRAWFLAGTEXT(f4 ,C,'RSI顶背离');
DRAWFLAGTEXT(rsi1<15 AND(BARSLAST(rsi1<15)>=1) ,C,
'短线指标(RSI 相对强弱指标)超卖--属买入信号');
DRAWFLAGTEXT(RSI1>85 AND(BARSLAST(RSI1>85)>=1),C,
'短线指标(RSI 相对强弱指标)超买--属卖出信号');
DRAWFLAGTEXT((((LLV(LOW,20)=LOW)AND(NOT(LLV(RSI1,20)=RSI1)))OR(COUNT(CLOSE<REF(CLOSE,1),30)>18
AND(COUNT(RSI1>REF(RSI1,1),30)>18)))AND(RSI1<20),C,
'短线指标(RSI 相对强弱指标)底背离--股价在低位时属买入信号');
DRAWFLAGTEXT((((HHV(HIGH,20)=HIGH)AND(NOT(HHV(RSI1,20)=RSI1)))OR(COUNT(CLOSE>REF(CLOSE,1),30)>18
AND(COUNT(RSI1<REF(RSI1,1),30)>18)))AND(RSI1>80) ,C,
'短线指标(RSI 相对强弱指标)顶背离--股价在高位时属卖出信号');
DRAWFLAGTEXT(CROSS(RSI1,RSI2)AND(RSI1<50),C,
'短线指标(RSI 相对强弱指标)金叉--属买入信号');
DRAWFLAGTEXT(CROSS(RSI2,RSI1)AND(RSI1>50),C,
'短线指标(RSI 相对强弱指标)死叉--属卖出信号');
DRAWFLAGTEXT(RSI1<5,C,
'短线指标(RSI 相对强弱指标)极低位--强烈买入信号');
DRAWFLAGTEXT(RSI1>93 ,C,
'短线指标(RSI 相对强弱指标)极高位--强烈卖出信号');
{PSY 心理线 12}
PSY:=COUNT(CLOSE>REF(CLOSE,1),12)/12*100;
{MTM 动力指标 6}
MTM := CLOSE-REF(CLOSE,6);
MTMMA := MA(MTM,6);
{SAR 抛物转向(Stop and Reverse) 10 2 20}
sa:=SAR(10,2,20);
{DMI 趋向指标(标准) 14 6}
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;
DRAWFLAGTEXT(CROSS(MTM,MTMMA) ,C,'(MTM动力指标)从下向上突破MTMMA,买入信号');
DRAWFLAGTEXT(CROSS(MTMMA,MTM),C,
'(MTM动力指标)从上向下跌破MTMMA,卖出信号');
DRAWFLAGTEXT((HHV(HIGH,20)=HIGH)AND(NOT(HHV(MTM,20)=MTM))AND(COUNT(CLOSE>REF(CLOSE,1),30)>18
AND(COUNT(CLOSE>REF(CLOSE,1),3)=3)) ,C,
'(MTM 动力指标)顶背离--属卖出信号');
DRAWFLAGTEXT((LLV(LOW,20)=LOW)AND(NOT(LLV(MTM,20)=MTM))AND(COUNT(CLOSE<REF(CLOSE,1),30)>18
AND(COUNT(CLOSE<REF(CLOSE,1),3)=3)),C,
'(MTM 动力指标)底背离--属买入信号。');
DRAWFLAGTEXT(PSY<10 ,C,
'(PSY 心理线指标)低位超卖区--属买入信号');
DRAWFLAGTEXT(BETWEEN(PSY,PS |