通达信选股公式简介:
金龙抄底选股公式包含了多个条件判断,用于筛选股票。它综合了价格、均线、成交量等多个因素,通过一系列逻辑运算来确定潜在的投资机会。代码中的每个变量(如JINL1至JINL35)代表一个特定的市场条件或技术指标,最终通过“金龙”变量输出满足所有条件的股票。
公式效果图:
指标源码及源码注释:
JINL1:=1286; {定义常数JINL1为1286}
JINL2:=366; {定义常数JINL2为366}
JINL3:=CLOSE/MA(CLOSE,40)*100<78; {收盘价除以40日均线再乘以100小于78}
JINL4:=CLOSE/MA(CLOSE,60)*100<74; {收盘价除以60日均线再乘以100小于74}
JINL5:=HIGH>LOW*1.051; {最高价大于最低价的1.051倍}
JINL6:=JINL5 AND COUNT(JINL5,5)>1; {JINL5条件成立且过去5天中出现超过1次}
JINL7:=IF(JINL6 AND (JINL3 OR JINL4),2,0); {如果JINL6和JINL3或JINL4中任一条件成立,则JINL7为2,否则为0}
JINL8:=CLOSE/REF(CLOSE,25)<=1.1; {收盘价除以前25天的收盘价小于等于1.1}
JINL9:=SMA(MAX(CLOSE-REF(CLOSE,2),0),7,1)/SMA(ABS(CLOSE-REF(CLOSE,2)),7,1)*100<15; {收盘价与2天前收盘价差的正数部分的7日移动平均除以绝对值的7日移动平均再乘以100小于15}
JINL10:=(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100; {收盘价与8天内最低价差除以8天内最高价与最低价差再乘以100}
JINL11:=SMA(JINL10,2,1); {JINL10的2日平滑移动平均}
JINL12:=SMA(JINL11,2,1); {JINL11的2日平滑移动平均}
JINL13:=IF(JINL11>REF(JINL11,1) AND REF(JINL11,1)<REF(JINL11,2) AND JINL11<23,1.5,0); {如果JINL11大于1天前的值且1天前的值小于2天前的值且JINL11小于23,则JINL13为1.5,否则为0}
JINL14:=LLV(LOW,4)=LLV(LOW,120); {4天内最低价等于120天内最低价}
JINL15:=(CLOSE-MA(CLOSE,58))/MA(CLOSE,58)<(-0.07); {收盘价减去58日均线再除以58日均线小于-0.07}
JINL16:=(INDEXC-HHV(INDEXC,8))/HHV(INDEXC,8)<(-0.05) AND MA(INDEXA,125)/MA(INDEXV,125)/(MA(INDEXA,5)/MA(INDEXV,5))>1.12; {指数收盘价减去8天内最高价再除以8天内最高价小于-0.05且指数平均数的比值大于1.12}
JINL17:=BARSLAST(JINL16)<10; {JINL16条件成立到当前的周期数小于10}
JINL18:=MA(CLOSE,27); {收盘价的27日均线}
JINL19:=(CLOSE-JINL18)/JINL18*100; {收盘价减去27日均线再除以27日均线乘以100}
JINL20:=MA(JINL19,2); {JINL19的2日均线}
JINL21:=BARSLAST(CROSS((-10),JINL20)=1); {JINL20下穿-10到当前的周期数}
JINL22:=JINL20<(-10) AND JINL21>3; {JINL20小于-10且JINL21大于3}
JINL23:=ABS(IF(JINL22,JINL20,0)); {如果JINL22成立,则取JINL20的绝对值,否则为0}
JINL24:=JINL23>0; {JINL23大于0}
JINL25:=MA(CLOSE,80)-MA(CLOSE,13)/3; {收盘价的80日均线减去13日均线的1/3}
JINL26:=MA((CLOSE-JINL25)/JINL25,1); {收盘价减去JINL25再除以JINL25的1日均线}
JINL27:=EMA(JINL26,12)*0.5; {JINL26的12日指数移动平均再乘以0.5}
JINL28:=EMA(JINL26,3); {JINL26的3日指数移动平均}
JINL29:=ABS(IF(LLV(JINL28-JINL27,12)>0,0,1)); {如果JINL28减去JINL27的12天内最低价大于0,则JINL29为0,否则为1}
JINL30:=CLOSE/(EMA(EMA((CLOSE+LOW+HIGH)/3,3),26)*0.9)<0.95; {收盘价除以3倍的(收盘价+最低价+最高价)的3日指数移动平均的26日指数移动平均再乘以0.9小于0.95}
JINL31:=MA((CLOSE-MA(CLOSE,21))/MA(CLOSE,21),3)*100; {收盘价减去21日均线再除以21日均线的3日均线乘以100}
JINL32:=JINL31<(-15); {JINL31小于-15}{公式网WWW.GUKOUDAI.COM}
JINL33:=(CLOSE-MA(CLOSE,28))/MA(CLOSE,28)*100<(-23); {收盘价减去28日均线再除以28日均线乘以100小于-23}
JINL34:=JINL8 AND JINL7 AND JINL9 AND JINL13; {JINL8, JINL7, JINL9, JINL13条件同时成立}
JINL35:=JINL32>0 AND JINL30>0 AND JINL29>0 AND JINL24>0 AND JINL15>0 AND JINL33>0 AND CLOSE>REF(CLOSE,1); {多个条件同时成立且收盘价大于前一天}
金龙:JINL35 AND JINL34; {最终的金龙指标为JINL35和JINL34条件同时成立}