MACD【趋势】 V1:=EMA(CLOSE,34)-EMA(CLOSE,5); V2:=EMA(V1,5); 趋势:(0-3)*(V1-V2),COLORRED; 长期趋势:EMA(V1,10)*(0-1),colorFF9900; DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),; DEA:EMA(DIFF,9),; MACD:2*(DIFF-DEA),COLORSTICK; AA:=BARSLAST(CROSS(DIFF,DEA) AND DEA<(0-0.1))<=8; V3:=DEA<(0-0.1) AND CROSS(DIFF,DEA) AND AA=1,colorFF00FF; DRAWICON(V3=1,0,10); {VAR1:=(((((3 * CLOSE) + LOW) + OPEN) + HIGH) / 6); VAR2:=(((((((((((((((((((((20 * VAR1) + (19 * REF(VAR1,1))) + (18 * REF(VAR1,2))) + (17 * REF(VAR1,3))) + (16 * REF(VAR1,4))) + (15 * REF(VAR1,5))) + (14 * REF(VAR1,6))) + (13 * REF(VAR1,7))) + (12 * REF(VAR1,8))) + (11 * REF(VAR1,9))) + (10 * REF(VAR1,10))) + (9 * REF(VAR1,11))) + (8 * REF(VAR1,12))) + (7 * REF(VAR1,13))) + (6 * REF(VAR1,14))) + (5 * REF(VAR1,15))) + (4 * REF(VAR1,16))) + (3 * REF(VAR1,17))) + (2 * REF(VAR1,18))) + REF(VAR1,20)) / 210); VAR3:=MA(VAR2,9); VAR4:=(((VAR2 - VAR3) / VAR3) * 100); VAR5:=VAR4; EXPLAINICON(((VAR4 > 0) AND (VAR4 > REF(VAR4,1))),4),; VAR50:=(((VAR4 < 0) AND (VAR4 > (0 - 1.5))) AND (VAR4 > REF(VAR4,1))); EXPLAINICON(VAR50,3),; VAR51:=((VAR4 < (0 - 1.5)) AND (VAR4 > REF(VAR4,1))); EXPLAINICON(VAR51,2),; VAR52:=(VAR4 < REF(VAR4,1)); EXPLAINICON(VAR52,1),; EXPLAIN(AA,'MACD最佳买入时机'),,colorFFFF; EXPLAIN((趋势 > 0),'Z线趋势上升中'),; EXPLAIN((趋势 < 0),'Z线趋势下降中'),; EXPLAIN(CROSS(趋势,0),'Z线考虑买入'),; EXPLAIN(CROSS(0,趋势),'Z线考虑卖出'),; VAR11:=MA((VOL / (HIGH - LOW)),4); VAR33:=ABS((CLOSE - OPEN)); VAR44:=(VOL / (HIGH - LOW)); EXPLAIN(((VAR44 < VAR11) AND (VAR33 < MA(VAR33,4))),'资金无入场意愿,萎缩中'),; EXPLAIN(((VAR44 < VAR11) AND (VAR33 > MA(VAR33,4))),'场内资金运作行为'),; EXPLAIN(((VAR44 > VAR11) AND (VAR33 < MA(VAR33,4))),'多空双方激烈争夺中'),; EXPLAIN(((VAR44 > VAR11) AND (VAR33 > MA(VAR33,4))),'场外资金介入(或出局)意愿强烈'),; 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); EXPLAIN(CROSS(PDI,MDI),'PDI线从下向上突破MDI线,显示有新多头进场,为买进信号'),; EXPLAIN(CROSS(MDI,PDI),'PDI线从上向下跌破MDI线,显示有新空头进场,为卖出信号'),; EXPLAIN((ADX > REF(ADX,1)),'ADX值持续高于前一日,行情将维持原趋势'),; EXPLAIN(((ADX < REF(ADX,1)) AND (ADX < 20)),'ADX值递减,降到20以下,且横向行进时,市场气氛为盘整'),; EXPLAIN(((((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))),'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)); EXPLAIN((CROSS(J,K) AND (K < 50)),'KDJ金叉'),; EXPLAIN((CROSS(K,J) AND (K > 50)),'KDJ死叉'),; EXPLAIN((J > 84),'KDJ指标高位'),; EXPLAIN((J < 16),'KDJ指标低位'),; TYP:=(((HIGH + LOW) + CLOSE) / 3); CCI:=((TYP - MA(TYP,14)) / (0.015 * AVEDEV(TYP,14))); EXPLAIN((CCI < (0 - 100)),'CCI指标底位,买入机会'),; EXPLAIN((CCI > 100),'CCI指标高位,卖出机会'),; EXPLAIN(((VOL / CAPITAL) > 0.075),'换手过大,小心主力出逃,短期头部'),; WR:=(0 - ((100 * (HHV(HIGH,14) - CLOSE)) / (HHV(HIGH,14) - LLV(LOW,14)))); EXPLAIN((WR > (0 - 20)),'W&R超买,即将见顶,应及时卖出'),; EXPLAIN((WR < (0 - 80)),'W&R超卖,即将见底,应伺机买进'),; MTM:=(CLOSE - REF(CLOSE,6)); MTMMA:=MA(MTM,6); EXPLAIN(CROSS(MTM,MTMMA),'MTM从下向上突破MTMMA,买入信号'),; EXPLAIN(CROSS(MTMMA,MTM),'MTM从上向下跌破MTMMA,卖出信号'),; 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); EXPLAIN((RSI1 > 85),'6日RSI向上突破85,超买,考虑卖出'),; EXPLAIN((RSI1 < 15),'6日RSI向下跌破15,超卖,考虑买入'),; EXPLAIN(CROSS(RSI1,RSI2),'6日RSI向上突破12日RSI,买进信号'),; EXPLAIN(CROSS(RSI2,RSI1),'6日RSI向下跌破12日RSI,卖出信号'),; VAR001:=(((CLOSE + HIGH) + LOW) / 3); VAR002:=(HIGH - LOW); VAR004:=(VAR001 + VAR002); VAR005:=(VAR001 - VAR002); VAR007:=(CLOSE * 1.03); VAR006:=(CLOSE * 0.97); 明天最高价估计:=VAR004; EXPLAINEX((明天最高价估计 >= 0.01),'明天最高价估计: 元',明天最高价估计,2,0),,colorFF; 明天最低价估计:=VAR006; EXPLAINEX((明天最低价估计 >= 0.01),'明天最低价估计: 元',明天最低价估计,2,0),,colorFFFFFF; BBI:=((((MA(CLOSE,3) + MA(CLOSE,6)) + MA(CLOSE,12)) + MA(CLOSE,24)) / 4); EXPLAIN(CROSS(BBI,CLOSE),'卖出信号'),,colorFF00; EXPLAIN(CROSS(CLOSE,BBI),'买入信号'),,colorFF; EXPLAIN(((CLOSE > BBI) AND (BBI > REF(BBI,1))),'多头势强'),,colorFFFF; EXPLAIN(((CLOSE < BBI) AND (BBI < REF(BBI,1))),'空头势强'),,colorFFFFCC; 仅提供源码 |