simon 4 months ago
commit
d6213d6aca
1 changed files with 184 additions and 0 deletions
  1. 184 0
      紫开多红.AICOIN

+ 184 - 0
紫开多红.AICOIN

@@ -0,0 +1,184 @@
+// @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='柱状图', color='red', fill=true, display=show_var5);
+// STICKLINE(VAR5>REF(VAR5,1),0,VAR5,5,0 ),COLOR000055;
+plotColumn(VAR5, title='柱状图', color='000055', fill=true, display=show_var5);
+// STICKLINE(VAR5>REF(VAR5,1),0,VAR5,4,0 ),COLOR000077;
+plotColumn(VAR5, title='柱状图', color='000077', fill=true, display=show_var5);
+// STICKLINE(VAR5>REF(VAR5,1),0,VAR5,3.1,0 ),COLOR000099;
+plotColumn(VAR5, title='柱状图', color='000099', fill=true, display=show_var5);
+// STICKLINE(VAR5>REF(VAR5,1),0,VAR5,2.5,0 ),COLOR0000BB;
+plotColumn(VAR5, title='柱状图', color='0000BB', fill=true, display=show_var5);
+// STICKLINE(VAR5>REF(VAR5,1),0,VAR5,1.5,0 ),COLOR0000DD;
+plotColumn(VAR5, title='柱状图', color='0000DD', fill=true, display=show_var5);
+// STICKLINE(VAR5>REF(VAR5,1),0,VAR5,1,0 ),COLOR0000FF;
+plotColumn(VAR5, title='柱状图', 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,6,0),COLORGREEN;
+plotColumn(VAR5, title='柱状图', color='green', fill=true, display=!show_var5);
+// STICKLINE(VAR5<REF(VAR5,1),0,VAR5,5,0),COLOR005500;
+plotColumn(VAR5, title='柱状图', color='005500', fill=true, display=!show_var5);
+// STICKLINE(VAR5<REF(VAR5,1),0,VAR5,4,0),COLOR007700;
+plotColumn(VAR5, title='柱状图', color='007700', fill=true, display=!show_var5);
+// STICKLINE(VAR5<REF(VAR5,1),0,VAR5,3,0),COLOR009900;
+plotColumn(VAR5, title='柱状图', color='009900', fill=true, display=!show_var5);
+// STICKLINE(VAR5<REF(VAR5,1),0,VAR5,2.5,0),COLOR00BB00;
+plotColumn(VAR5, title='柱状图', color='00BB00', fill=true, display=!show_var5);
+// STICKLINE(VAR5<REF(VAR5,1),0,VAR5,1.5,0),COLOR00DD00;
+plotColumn(VAR5, title='柱状图', color='00DD00', fill=true, display=!show_var5);
+// STICKLINE(VAR5<REF(VAR5,1),0,VAR5,1,0),COLOR00FF00;
+plotColumn(VAR5, title='柱状图', color='00FF00', 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,6,0),COLORFF00FF;
+plotColumn(VAR15, title='柱状图', color='FF00FF', fill=true, display=show_var15);
+// STICKLINE(VAR15>REF(VAR15,1),0,VAR15,5,0 ),COLOR550055;
+plotColumn(VAR15, title='柱状图', color='550055', fill=true, display=show_var15);
+// STICKLINE(VAR15>REF(VAR15,1),0,VAR15,4,0 ),COLOR770077;
+plotColumn(VAR15, title='柱状图', color='770077', fill=true, display=show_var15);
+// STICKLINE(VAR15>REF(VAR15,1),0,VAR15,3,0 ),COLOR990099;
+plotColumn(VAR15, title='柱状图', color='990099', fill=true, display=show_var15);
+// STICKLINE(VAR15>REF(VAR15,1),0,VAR15,2.5,0 ),COLORBB00BB;
+plotColumn(VAR15, title='柱状图', color='BB00BB', fill=true, display=show_var15);
+// STICKLINE(VAR15>REF(VAR15,1),0,VAR15,1.5,0 ),COLORDD00DD;
+plotColumn(VAR15, title='柱状图', color='DD00DD', fill=true, display=show_var15);
+// STICKLINE(VAR15>REF(VAR15,1),0,VAR15,1,0 ),COLORFF00FF;
+plotColumn(VAR15, title='柱状图', color='FF00FF', 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,6,0 ),COLORYELLOW;
+plotColumn(VAR15, title='柱状图', color='yellow', fill=true, display=!show_var15);
+// STICKLINE(VAR15<REF(VAR15,1),0,VAR15,5,0),COLOR005555;
+plotColumn(VAR15, title='柱状图', color='005555', fill=true, display=!show_var15);
+// STICKLINE(VAR15<REF(VAR15,1),0,VAR15,4,0),COLOR007777;
+plotColumn(VAR15, title='柱状图', color='007777', fill=true, display=!show_var15);
+// STICKLINE(VAR15<REF(VAR5,1),0,VAR15,3,0),COLOR009999;
+plotColumn(VAR15, title='柱状图', color='009999', fill=true, display=!show_var15);
+// STICKLINE(VAR15<REF(VAR15,1),0,VAR15,2.5,0),COLOR00BBBB;
+plotColumn(VAR15, title='柱状图', color='00BBBB', fill=true, display=!show_var15);
+// STICKLINE(VAR15<REF(VAR15,1),0,VAR15,1.5,0),COLOR00DDDD;
+plotColumn(VAR15, title='柱状图', color='00DDDD', fill=true, display=!show_var15);
+// STICKLINE(VAR15<REF(VAR15,1),0,VAR15,1,0),COLOR00FFFF;
+plotColumn(VAR15, title='柱状图', color='00FFFF', 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));