gspt1:=MA(CLOSE,1)/MA(REF(CLOSE,18),18)*100;{收盘价1日均线/18日前收盘价18日均线*100,价格强弱比值}
gspt2:=MA(FORCAST( gspt1,20),6);{ gspt1的20周期线性回归值,再取6日均线}
gspt3:=EMA(CLOSE,240)-EMA(CLOSE,520);{240周期指数均线-520周期指数均线,长期趋势差}
gspt4:=EMA( gspt3,180);{ gspt3的180周期指数均线,平滑长期趋势}
gspt5:= gspt3*2- gspt4;{双倍 gspt3减 gspt4,趋势加速计算}
gspt6:=SMA( gspt5,3,1);{ gspt5的3周期简单移动平均}
gspt7:=60;{参数赋值:60}
gspt8:=130;{参数赋值:130}
gspt9:=45;{参数赋值:45}
gspt10:=EMA(CLOSE, gspt7)-EMA(CLOSE, gspt8);{60周期EMA-130周期EMA,中期趋势差}
gspt11:=EMA( gspt10, gspt9);{ gspt10的45周期EMA,平滑中期趋势}
gspt12:= gspt10*2- gspt11;{双倍 gspt10减 gspt11,中期趋势加速}
gspt13:=SMA( gspt12,3,1);{ gspt12的3周期简单移动平均}
gspt14:=EMA(CLOSE,12)-EMA(CLOSE,26);{12周期EMA-26周期EMA,MACD基础差值}
gspt15:=EMA( gspt14,9);{ gspt14的9周期EMA,MACD信号线}
gspt16:= gspt14*2- gspt15;{双倍MACD差值减信号线}
gspt17:=SMA( gspt16,3,1);{ gspt16的3周期简单移动平均}
gspt18:=LLV(LOW,9);{9周期最低价}
gspt19:=HHV(HIGH,9);{9周期最高价}
gspt20:=EMA((CLOSE- gspt18)/( gspt19- gspt18)*100,3);{9周期强弱指标,3周期EMA}
gspt21:=EMA( gspt20,3);{ gspt20的3周期EMA}
gspt22:=MA( gspt21,3);{ gspt21的3周期简单均线}
gspt23:=IF(CLOSE/REF(CLOSE,1)>1+0.01*9+EXIST(CLOSE/REF(CLOSE,1)>1+0.01*9,10)+CLOSE/REF(CLOSE,1)>1+0.01*9=3,1,0);{连续涨停条件判断}
gspt24:=EMA(2.055*EMA(EMA(HIGH,34),34)-EMA(EMA(LOW,34),34),5)>CLOSE;{压力位判断:当前价在压力线下方}
gspt25:=CLOSE/REF(CLOSE,1)-1>=0.08;{涨幅大于等于8%}
gspt26:=LOW<REF(LOW,2);{最低价小于2日前最低价}
gspt27:=LOW<REF(LOW,1);{最低价小于1日前最低价}
gspt28:=(OPEN-LOW)/(CLOSE-OPEN)>=1.48;{开盘价到最低价的幅度/收盘价到开盘价幅度≥1.48}
gspt29:=CLOSE>REF(CLOSE,1);{收盘价大于昨日收盘价}
gspt30:=CLOSE/REF(CLOSE,1)-1>=0.0502;{涨幅≥5.02%}
gspt31:=(HIGH-CLOSE)/(CLOSE-OPEN)<0.33;{上影线长度占比小于0.33,光头特征}
gspt32:=VOL>REF(VOL,1)*2.5;{成交量大于昨日2.5倍}
gspt33:=VOL>REF(VOL,1);{成交量大于昨日}
gspt34:=CLOSE>REF(CLOSE,1);{收盘价大于昨日收盘价}
gspt35:=CLOSE/REF(CLOSE,1)-1>=0.0502;{涨幅≥5.02%}
gspt36:=(HIGH-CLOSE)/(CLOSE-OPEN)<0.33;{上影线长度占比小于0.33}
gspt37:=CLOSE/REF(CLOSE,1)-1>=0.049;{涨幅≥4.9%}
gspt38:=CLOSE>REF(CLOSE,1);{收盘价大于昨日收盘价}
gspt39:=VOL>REF(VOL,1)*1.9;{成交量大于昨日1.9倍}
gspt40:=IF(FILTER( gspt39 AND gspt38 AND gspt37 AND gspt36 OR ( gspt35 AND gspt34 AND gspt33 AND gspt32 AND gspt31) OR ( gspt30 AND gspt29 AND gspt28 AND gspt27 AND gspt26) OR gspt25 AND gspt24,34),1,0) AND gspt23;{组合强势信号过滤,34周期内只显示一次}
gspt41:=CLOSE/REF(CLOSE,1)>1.048;{涨幅大于4.8%}
gspt42:=CLOSE=HIGH;{收盘价等于最高价,光头K线}
gspt43:=BETWEEN(FORCAST(VOL,4),0.2*FORCAST(VOL,12),2.1*FORCAST(VOL,12));{成交量预测值在合理区间}
gspt44:=LOW>REF(CLOSE,1)*0.93;{最低价大于昨日收盘价的0.93倍}
gspt45:=KDJ.J-REF(KDJ.J,1)>30;{KDJ指标J值单日涨幅大于30}
gspt46:=CLOSE/REF(CLOSE,1)>1.043;{涨幅大于4.3%}
gspt47:=MACD.MACD>0;{MACD柱大于0}
gspt48:=MACD.DEA>0;{MACDDEA线大于0}
gspt49:=SMA(20*(DMA(CLOSE,2.5*MAX(VOL/700000000,1.1*(MAX(HIGH,REF(CLOSE,1))/MIN(LOW,REF(CLOSE,1))-1)))/REF(DMA(CLOSE,2.5*MAX(VOL/700000000,1.1*(MAX(HIGH,REF(CLOSE,1))/MIN(LOW,REF(CLOSE,1))-1))),1)-1),2,1);{自定义量价趋势指标}
gspt50:=EMA(SMA(20*(DMA(CLOSE,2.5*MAX(VOL/700000000,1.1*(MAX(HIGH,REF(CLOSE,1))/MIN(LOW,REF(CLOSE,1))-1)))/REF(DMA(CLOSE,2.5*MAX(VOL/700000000,1.1*(MAX(HIGH,REF(CLOSE,1))/MIN(LOW,REF(CLOSE,1))-1))),1)-1),2,1),2);{ gspt49的2周期EMA}
gspt51:=CLOSE>=REF(CLOSE,1);{收盘价大于等于昨日收盘价}
gspt52:=SMA(20*(DMA(CLOSE,2.5*MAX(VOL/700000000,1.1*(MAX(HIGH,REF(CLOSE,1))/MIN(LOW,REF(CLOSE,1))-1)))/REF(DMA(CLOSE,2.5*MAX(VOL/700000000,1.1*(MAX(HIGH,REF(CLOSE,1))/MIN(LOW,REF(CLOSE,1))-1))),1)-1),2,1);{同 gspt49指标}
gspt53:=EMA(SMA(20*(DMA(CLOSE,2.5*MAX(VOL/700000000,1.1*(MAX(HIGH,REF(CLOSE,1))/MIN(LOW,REF(CLOSE,1))-1)))/REF(DMA(CLOSE,2.5*MAX(VOL/700000000,1.1*(MAX(HIGH,REF(CLOSE,1))/MIN(LOW,REF(CLOSE,1))-1))),1)-1),2,1),2);{同 gspt50指标}
gspt54:=CLOSE>=REF(CLOSE,1);{收盘价大于等于昨日收盘价}
gspt55:=FILTER( gspt41 AND gspt42 AND gspt43,28)*100 AND gspt44 OR ( gspt45 AND gspt46 AND gspt47 AND gspt48) AND CROSS(IF( gspt49>0.24 AND gspt50>=0.005 AND gspt51,1,0),0.5) AND COUNT(IF( gspt52>0.24 AND gspt53>=0.005 AND gspt54,1,0)>0.5,10)=1 OR gspt40;{多重强势信号组合}
gspt56:=2;{参数赋值:2}
gspt57:=CLOSE>=ZTPRICE(REF(CLOSE,1),0.1);{收盘价大于等于涨停价}
gspt58:=COUNT( gspt57, gspt56)=1 AND gspt57;{2周期内首次涨停且当日涨停}
gspt59:=VOL;{成交量赋值}
gspt60:= gspt59>MA(VOL,89);{成交量大于89周期均量}
gspt61:=EXPMA(CLOSE,5);{5周期指数均线}
gspt62:=EXPMA(CLOSE,29);{29周期指数均线}
gspt63:= gspt61> gspt62;{短期均线大于长期均线,多头排列}
gspt64:=REF(CLOSE,1);{昨日收盘价}
gspt65:=SMA(MAX(CLOSE- gspt64,0),12,1)/SMA(ABS(CLOSE- gspt64),12,1)*100;{12周期RSI相对强弱指标}
gspt66:=SMA(MAX(CLOSE- gspt64,0),56,1)/SMA(ABS(CLOSE- gspt64),56,1)*100;{56周期RSI相对强弱指标}
gspt67:= gspt65> gspt66 AND gspt63 AND gspt60;{短期RSI大于长期RSI+多头排列+放量}
gspt68:=HHV(HIGH,30);{30周期最高价}
gspt69:=LLV(LOW,30);{30周期最低价}
gspt70:=REF(( gspt68/ gspt69-1)*100<=30,1);{昨日30周期振幅小于等于30%}
gspt71:=ABS(((3.48*CLOSE+HIGH+LOW)/4-EMA(CLOSE,23))/EMA(CLOSE,23));{价格偏离23周期EMA的幅度}
gspt72:=DMA((2.15*CLOSE+LOW+HIGH)/4, gspt71);{动态加权移动平均,自适应均线}
gspt73:=EMA( gspt72,200)*1.1;{自适应均线的200周期EMA*1.1,长期压力线}
gspt74:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100>5;{涨幅大于5%}
gspt75:=CROSS(CLOSE, gspt73) AND REF(CLOSE*1.097,1)<CLOSE AND gspt67 AND gspt70 AND gspt58;{突破长期压力+涨停+多重条件}
gspt76:=CROSS( gspt1, gspt2) AND IF( gspt16> gspt17 AND gspt12> gspt13 AND gspt5> gspt6,1,0) AND gspt58 AND gspt21- gspt22>=(-1);{金叉+趋势向上+涨停}
gspt77:=CLOSE/REF(CLOSE,1)>1.048 AND CLOSE=HIGH AND BETWEEN(FORCAST(VOL,4),0.2*FORCAST(VOL,12),2.1*FORCAST(VOL,12));{大涨+光头+量能合理}
DRAWTEXT_FIX(1,0.980,20,1,'公式平台,公式源码 HTTP://WWW.GSPT.COM'),COLOR333333;
gspt78:=FILTER( gspt77,28) AND gspt58 AND gspt21- gspt22>=(-1) AND gspt55;{强势信号过滤+涨停+组合条件}
gspt79:=HIGH=CLOSE;{收盘价等于最高价,光头K线}
gspt80:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100>=0.93 AND gspt79;{涨幅≥0.93%+光头K线}
gspt81:=BARSLAST( gspt76 OR gspt78 OR gspt75);{距离上一次信号出现的周期数}
gspt82:= gspt81=2 AND REF(CLOSE,1)<REF(OPEN,1) AND CLOSE<OPEN AND CLOSE<REF(CLOSE,1) AND REF(CLOSE,1)<REF(CLOSE,2) AND CLOSE<MA(CLOSE,5) AND HIGH>MA(CLOSE,3) AND CLOSE>REF(OPEN,2);{低吸条件组合1:信号后2日,连续回调,价格在均线间}
gspt83:= gspt81=2 AND REF(CLOSE,1)>REF(OPEN,1) AND CLOSE<OPEN AND LOW<REF(LOW,1) AND REF(LOW,1)<REF(CLOSE,2);{低吸条件组合2:信号后2日,阴线回调,破前低}
gspt82 OR gspt83 ,COLORGREEN;{输出低吸信号,绿色显示};