KDJ变体、RSI、MACD、动量、超买超卖指标
发布日期: 2025-08-24 | 阅读量:37
K1 := (CLOSE - LLV(LOW, 4)) / (HHV(HIGH, 4) - LLV(LOW, 4)) * 100;
D1 := SMA(K1, 3, 1);
LONG := SMA(D1, 2, 1);
K2 := SMA(LONG, 5, 1);
DRAWBAND(K2, RGB(0,104,154), LONG, RGB(255,0,0));
WPR := (CLOSE - LLV(LOW, 11)) / (HHV(HIGH, 11) - LLV(LOW, 11)) * 200 - 60;
FENGX := SMA(WPR, 3, 1), COLORYELLOW;
FENGX_SLOW := SMA(FENGX, 3, 1), COLORRED;
DRAWBAND(FENGX_SLOW, RGB(0,128,0), FENGX, RGB(255,97,0));
DIFF := EMA(CLOSE, 12) - EMA(CLOSE, 26);
DEA := EMA(DIFF, 9);
OSC := 1000 * (2 * (DIFF - DEA)) / EMA(C, 30); { 放大波动 }
REF_C1 := EMA(REF(CLOSE, 1), 4);
RSI_LIKE := SMA(MAX(CLOSE - REF_C1, 0), 6, 1) / SMA(ABS(CLOSE - REF_C1), 6, 1) * 100;
{程序化指标 条件买入信号1:OSC触底回升 + RSI_LIKE < 20 }
BUY1 := FILTER(OSC < 0 AND OSC > REF(OSC, 1) AND RSI_LIKE < 20, 5);
{ 条件买入信号2:RSI_LIKE上穿90(极端强势启动)}
BUY2 := CROSS(RSI_LIKE, 90);
LOW_LEVEL := IF(RSI_LIKE < 3.5, 15, 0), COLORCYAN, LINETHICK2;
DRAWTEXT(RSI_LIKE < 3.5, 7, '准备'), COLORRED;
LL10 := LLV(LOW, 10);
HH25 := HHV(HIGH, 25);
WAVE := EMA((C - LL10) / (HH25 - LL10) * 4, 4);
DRAWTEXT(CROSS(3.5, WAVE), 110, '急卖');
{ 抄底信号:WAVE上穿0.3 }
STICKLINE(CROSS(WAVE, 0.3), -50, -30, 3, 0), COLOR00AAFF, LINETHICK1;
STICKLINE(CROSS(WAVE, 0.3), -40, -30, 3, 0), COLORRED, LINETHICK1;
DRAWTEXT(CROSS(WAVE, 0.3), -45, '抄'), COLORYELLOW;
DRAWTEXT(CROSS(80, RSI_LIKE), 100, ''), COLORGREEN; { 超买预警(空提示)}
DRAWTEXT(CROSS(RSI_LIKE, 20), 0, '来'), COLORRED; { 低位启动}
STICKLINE(CROSS(3.5, WAVE), 100, 120, 2, 0), COLORRED, LINETHICK2;
R := RSI;
RSI_MA := MA(R, 3);
F := 100 * (C - REF(C, 1)) / REF(C, 1); { 涨跌幅百分比 }
RSI_PEAK := REF(R,1) > REF(R,2) AND REF(R,1) > R; { RSI见顶 }
RSI_BOTTOM := (REF(R,1) < REF(R,2) AND REF(R,1) < R) OR
(REF(R,1)=REF(R,2) AND REF(R,1)<R AND REF(R,2)<REF(R,3)); { RSI见底 }
RSI_LINE := EMA(R, 25) + 6, COLORBLUE;
RSI_CROSS_UP := CROSS(RSI_LINE, R);
RSI_BUY_SIGNAL :=
REF(R,2) > REF(R,3) AND
REF(R,2) > REF(R,1) AND
R > REF(R,1) AND
RSI_MA > REF(RSI_MA,1) + 1 AND
REF(RSI_MA,2) - REF(RSI_MA,1) > -1 AND
REF(R,1) < REF(RSI_MA,1) AND
REF(R,2) - REF(RSI_MA,2) > -3 AND
REF(R,1) < 38 AND
R < RSI_LINE AND
F < 8;
STICKLINE(RSI_BUY_SIGNAL, 100, 120, 2, 0), COLORRED;
DRAWTEXT(RSI_BUY_SIGNAL, 110, 'RSI买'), COLORYELLOW;
FAST_LINE := 3 * SMA((C - LLV(L,55)) / (HHV(H,55)-LLV(L,55)) * 100, 5, 1) -
2 * SMA(SMA((C - LLV(L,55)) / (HHV(H,55)-LLV(L,55)) * 100, 5, 1), 3, 1);
SLOW_LINE := EMA(FAST_LINE, 5), LINETHICK2, COLOR6600FF;
WAVE60 := 100 * (HHV(HIGH,60) - CLOSE) / (HHV(HIGH,60) - LLV(LOW,60)), LINETHICK2;
STICKLINE(CROSS(FAST_LINE, WAVE60), 0, 20, 2, 0);
DRAWTEXT(CROSS(FAST_LINE, WAVE60), 20, '见底');
D1 := SMA(K1, 3, 1);
LONG := SMA(D1, 2, 1);
K2 := SMA(LONG, 5, 1);
DRAWBAND(K2, RGB(0,104,154), LONG, RGB(255,0,0));
WPR := (CLOSE - LLV(LOW, 11)) / (HHV(HIGH, 11) - LLV(LOW, 11)) * 200 - 60;
FENGX := SMA(WPR, 3, 1), COLORYELLOW;
FENGX_SLOW := SMA(FENGX, 3, 1), COLORRED;
DRAWBAND(FENGX_SLOW, RGB(0,128,0), FENGX, RGB(255,97,0));
DIFF := EMA(CLOSE, 12) - EMA(CLOSE, 26);
DEA := EMA(DIFF, 9);
OSC := 1000 * (2 * (DIFF - DEA)) / EMA(C, 30); { 放大波动 }
REF_C1 := EMA(REF(CLOSE, 1), 4);
RSI_LIKE := SMA(MAX(CLOSE - REF_C1, 0), 6, 1) / SMA(ABS(CLOSE - REF_C1), 6, 1) * 100;
{程序化指标 条件买入信号1:OSC触底回升 + RSI_LIKE < 20 }
BUY1 := FILTER(OSC < 0 AND OSC > REF(OSC, 1) AND RSI_LIKE < 20, 5);
{ 条件买入信号2:RSI_LIKE上穿90(极端强势启动)}
BUY2 := CROSS(RSI_LIKE, 90);
LOW_LEVEL := IF(RSI_LIKE < 3.5, 15, 0), COLORCYAN, LINETHICK2;
DRAWTEXT(RSI_LIKE < 3.5, 7, '准备'), COLORRED;
LL10 := LLV(LOW, 10);
HH25 := HHV(HIGH, 25);
WAVE := EMA((C - LL10) / (HH25 - LL10) * 4, 4);
DRAWTEXT(CROSS(3.5, WAVE), 110, '急卖');
{ 抄底信号:WAVE上穿0.3 }
STICKLINE(CROSS(WAVE, 0.3), -50, -30, 3, 0), COLOR00AAFF, LINETHICK1;
STICKLINE(CROSS(WAVE, 0.3), -40, -30, 3, 0), COLORRED, LINETHICK1;
DRAWTEXT(CROSS(WAVE, 0.3), -45, '抄'), COLORYELLOW;
DRAWTEXT(CROSS(80, RSI_LIKE), 100, ''), COLORGREEN; { 超买预警(空提示)}
DRAWTEXT(CROSS(RSI_LIKE, 20), 0, '来'), COLORRED; { 低位启动}
STICKLINE(CROSS(3.5, WAVE), 100, 120, 2, 0), COLORRED, LINETHICK2;
R := RSI;
RSI_MA := MA(R, 3);
F := 100 * (C - REF(C, 1)) / REF(C, 1); { 涨跌幅百分比 }
RSI_PEAK := REF(R,1) > REF(R,2) AND REF(R,1) > R; { RSI见顶 }
RSI_BOTTOM := (REF(R,1) < REF(R,2) AND REF(R,1) < R) OR
(REF(R,1)=REF(R,2) AND REF(R,1)<R AND REF(R,2)<REF(R,3)); { RSI见底 }
RSI_LINE := EMA(R, 25) + 6, COLORBLUE;
RSI_CROSS_UP := CROSS(RSI_LINE, R);
RSI_BUY_SIGNAL :=
REF(R,2) > REF(R,3) AND
REF(R,2) > REF(R,1) AND
R > REF(R,1) AND
RSI_MA > REF(RSI_MA,1) + 1 AND
REF(RSI_MA,2) - REF(RSI_MA,1) > -1 AND
REF(R,1) < REF(RSI_MA,1) AND
REF(R,2) - REF(RSI_MA,2) > -3 AND
REF(R,1) < 38 AND
R < RSI_LINE AND
F < 8;
STICKLINE(RSI_BUY_SIGNAL, 100, 120, 2, 0), COLORRED;
DRAWTEXT(RSI_BUY_SIGNAL, 110, 'RSI买'), COLORYELLOW;
FAST_LINE := 3 * SMA((C - LLV(L,55)) / (HHV(H,55)-LLV(L,55)) * 100, 5, 1) -
2 * SMA(SMA((C - LLV(L,55)) / (HHV(H,55)-LLV(L,55)) * 100, 5, 1), 3, 1);
SLOW_LINE := EMA(FAST_LINE, 5), LINETHICK2, COLOR6600FF;
WAVE60 := 100 * (HHV(HIGH,60) - CLOSE) / (HHV(HIGH,60) - LLV(LOW,60)), LINETHICK2;
STICKLINE(CROSS(FAST_LINE, WAVE60), 0, 20, 2, 0);
DRAWTEXT(CROSS(FAST_LINE, WAVE60), 20, '见底');
