123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- // @version=2
- // 在这里创建您的自定义脚本
- // RSV:=(CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*100;
- RSV = (close - lowest(low, 5)) / (highest(high, 5) - lowest(low, 5)) * 100;
- // K0:=SMA(RSV,3,1);
- K0 = smma(RSV, 3, 1);
- // K:=K0;D:=SMA(K0,2,1);
- K = K0;
- D = smma(K0, 2, 1);
- // J1:(3*K0-2*D),COLORYELLOW;J2:=MA(J1,2);
- J1 = (3 * K0 - 2 * D);
- plot(J1, title='J1', color='yellow');
- J2 = ma(J1, 2);
- //MAV:=(2*C+H+L)/4;
- MAV = (2 * close + high + low) / 4;
- // VR1:=LLV(LOW,21);
- VR1 = lowest(low, 21);
- // VR2:=HHV(HIGH,21);
- VR2 = highest(high, 21);
- // SK: EMA((MAV-VR1)/(VR2-VR1)*100,8),COLORWHITE;
- SK = ema((MAV - VR1) / ( VR2 - VR1) * 100,8);
- plot(SK, title='SK', color='white');
- // SD: EMA(0.667*REF(SK,1)+0.333*SK,1),COLORCYAN;
- SD = ema(0.667 * SK[1] + 0.333 * SK, 1);
- plot(SD, title='SD', color='cyan');
- // SJ:=3*SK-2*SD;
- SJ = 3 * SK - 2 * SD;
- // A1:=REF(CLOSE,2);
- A1 = close[2];
- // A2:=SMA(MAX(CLOSE-A1,0),7,1)/SMA(ABS(CLOSE-A1),7,1)*100;
- A2 = smma(max(close - A1, 0), 7, 1) / sma(abs(close - A1), 7, 1) * 100;
- // 波段介入点:IF(A2<19,19,0),COLORWHITE;
- 波段介入点 = A2 < 19 ? 19 : 0
- plot(波段介入点, title='波段介入点', color='white');
- // VAR1:=REF((LOW+OPEN+CLOSE+HIGH)/4,1);
- VAR1 = (low[1] + open[1] + close[1] + high[1]) / 4;
- // VAR2:=SMA(ABS(LOW-VAR1),13,1)/SMA(MAX(LOW-VAR1,0),10,1);
- VAR2 = smma(abs(low - VAR1), 13, 1) / smma(max(low - VAR1, 0), 10, 1);
- // VAR3:=EMA(VAR2,10);
- VAR3 = ema(VAR2, 10);
- // plot(VAR3, title='VAR3', color='red');
- // VAR4:=LLV(LOW,33);
- VAR4 = lowest(low, 33);
- // plot(VAR4, title='VAR4', color='red');
- // VAR5:=EMA(IF(LOW<=VAR4,VAR3,0),3);
- VAR5 = ema(low <= VAR4 ? VAR3 : 0, 3);
- // plot(VAR5, title='VAR5', color='red');
- // 主力进场:IF(VAR5>REF(VAR5,1),VAR5,0),LINETHICK0,COLORRED;
- 主力进场 = VAR5 > VAR5[1] ? VAR5 : 0;
- plot(主力进场, title='主力进场', color='red');
- show_var5 = VAR5 > VAR5[1];
- // STICKLINE(VAR5>REF(VAR5,1),0,VAR5,6,0),COLORRED;
- plotColumn(VAR5, title='VAR5', color='red', fill=true, display=show_var5);
- // STICKLINE(VAR5>REF(VAR5,1),0,VAR5,5,0 ),COLOR000055;
- plotColumn(VAR5, title='VAR5', color='000055', fill=true, display=show_var5);
- // STICKLINE(VAR5>REF(VAR5,1),0,VAR5,4,0 ),COLOR000077;
- plotColumn(VAR5, title='VAR5', color='000077', fill=true, display=show_var5);
- // STICKLINE(VAR5>REF(VAR5,1),0,VAR5,3.1,0 ),COLOR000099;
- plotColumn(VAR5, title='VAR5', color='000099', fill=true, display=show_var5);
- // STICKLINE(VAR5>REF(VAR5,1),0,VAR5,2.5,0 ),COLOR0000BB;
- plotColumn(VAR5, title='VAR5', color='0000BB', fill=true, display=show_var5);
- // STICKLINE(VAR5>REF(VAR5,1),0,VAR5,1.5,0 ),COLOR0000DD;
- plotColumn(VAR5, title='VAR5', color='0000DD', fill=true, display=show_var5);
- // STICKLINE(VAR5>REF(VAR5,1),0,VAR5,1,0 ),COLOR0000FF;
- plotColumn(VAR5, title='VAR5', color='0000FF', fill=true, display=show_var5);
- // 洗盘:IF(VAR5<REF(VAR5,1),VAR5,0),LINETHICK0,COLORGREEN;
- 洗盘 = VAR5 < VAR5[1] ? VAR5 : 0;
- plot(洗盘, title='洗盘', color='green');
- // STICKLINE(VAR5<REF(VAR5,1),0,VAR5,1,0),COLOR00FF00;
- plotColumn(VAR5, title='VAR5', color='red', fill=true, display=!show_var5);
- // VAR12:=SMA(ABS(VAR1-H),13,1)/SMA(MAX(VAR1-H,0),10,1);
- VAR12 = smma(abs(VAR1 - high), 13, 1) / smma(max(VAR1 - high, 0), 10, 1);
- // VAR13:=EMA(VAR12,10);
- VAR13 = ema(VAR12, 10);
- // VAR14:=HHV(H,33);
- VAR14 = highest(high, 33);
- // VAR15:=EMA(IF(H>=VAR14,VAR13,0),3);
- VAR15 = ema(high >= VAR14 ? VAR13 : 0, 3);
- // 冲顶:IF(VAR15>REF(VAR15,1),VAR15,0),LINETHICK0,COLORFF00FF;
- 冲顶 = VAR15 > VAR15[1] ? VAR15 : 0;
- plot(冲顶, title = '冲顶', color='FF00FF');
- show_var15 = VAR15 > VAR15[1];
- // STICKLINE(VAR15>REF(VAR15,1),0,VAR15,1,0 ),COLORFF00FF;
- plotColumn(VAR15, title='VAR15', color='red', fill=true, display=show_var15);
- // 主力出场:IF(VAR15<REF(VAR15,1),VAR15,0),LINETHICK0,COLORYELLOW;
- 主力出场 = VAR15 < VAR15[1] ? VAR15 : 0;
- plot(主力出场, title = '主力出场', color='yellow');
- // STICKLINE(VAR15<REF(VAR15,1),0,VAR15,1,0),COLOR00FFFF;
- plotColumn(VAR15, title='VAR15', color='green', fill=true, display=!show_var15);
- // X_1:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*20;
- X_1 =(close - ma(close, 13)) / ma(close, 13) * 20;
- // X_2:=(CLOSE-MA(CLOSE,4))/MA(CLOSE,4)*20;
- X_2 =(close - ma(close, 4)) / ma(close, 4) * 20;
- // 红柱:SMA(X_1,3,1),COLORRED,LINETHICK0;
- 红柱 = smma(X_1, 3, 1);
- plot(红柱, title = '红柱', color='red');
- // 蓝柱:SMA(X_2,3,1),COLORSTICK,COLORCYAN;
- 蓝柱 = smma(X_2, 3, 1);
- plot(蓝柱, title = '蓝柱', color='cyan');
- // STICKLINE(红柱<REF(红柱,0.5) AND 红柱>0,0,红柱,4,0),COLORRED;
- plotColumn(红柱, title='红柱', color='red', fill=true, display=(红柱 < 红柱[0.5] && 红柱 > 0));
- // STICKLINE(红柱<REF(红柱,1) AND 红柱>0,0,红柱,2,0),COLORGREEN;
- plotColumn(红柱, title='红柱', color='green', fill=true, display=(红柱 < 红柱[1] && 红柱 > 0));
- // STICKLINE(红柱>REF(红柱,1) AND 红柱>0,0,红柱,3,0),COLORRED;
- plotColumn(红柱, title='红柱', color='red', fill=true, display=(红柱 > 红柱[1] && 红柱 > 0));
- // STICKLINE(蓝柱<REF(蓝柱,1) AND 蓝柱>0,0,蓝柱,2,0),COLOR00DDFF;
- plotColumn(蓝柱, title='蓝柱', color='00DDFF', fill=true, display=(蓝柱 < 蓝柱[1] && 蓝柱 > 0));
- // STICKLINE(红柱>REF(红柱,1) AND 红柱<0,0,红柱,2,0),COLORFFDD00;
- plotColumn(红柱, title='红柱', color='FFDD00', fill=true, display=(红柱 > 红柱[1] && 红柱 < 0));
- // STICKLINE(红柱<REF(红柱,1) AND 红柱<0,0,红柱,3,0),COLORFFCC00;
- plotColumn(红柱, title='红柱', color='FFCC00', fill=true, display=(红柱 < 红柱[1] && 红柱 < 0));
- // STICKLINE(蓝柱>REF(蓝柱,1) AND 蓝柱<0,0,蓝柱,2,0),COLORMAGENTA;
- plotColumn(蓝柱, title='蓝柱', color='magenta', fill=true, display=(蓝柱 > 蓝柱[1] && 蓝柱 < 0));
|