N:=0;
M:=60;
TOTAL:=IF(PERIOD=1,5,IF(PERIOD=2,15,IF(PERIOD=3,30,IF(PERIOD=4,60,IF(PERIOD=5,240,1)))));
MTIME:=MOD(FROMOPEN,TOTAL);
CTIME:=IF(MTIME<0.5,TOTAL,MTIME);
VVOL:=IF(CURRBARSCOUNT=1,V*TOTAL/CTIME,V);
VAR1:=VVOL/CAPITAL*100; {换手率}
VAR2:=HHV(VAR1,0); {上市以来的最大换手率}
VAR3:=VAR1/VAR2*100; {当前换手率与最大换手率的比值}
VAR4:=(H-L)/L*100; {当日涨幅}
VAR5:=BARSLAST(VAR3>N); {换手率达80以上至今日的交易天数}
VAR6:=REF(HIGH,VAR5);{80以上换手率的最高价}
VAR7:=COUNT(CLOSE<VAR6,VAR5);
平均成本:=IF(VAR5=0,CLOSE,SUM(CLOSE*VVOL,VAR5)/SUM(VVOL,VAR5));
进出:=(CLOSE-平均成本)/平均成本*IF((CLOSE-平均成本)/平均成本<1,1000,10);
主力入场:=DRAWICON(进出=0,LOW,1);
买入:=STICKLINE(CROSS(CLOSE,VAR6) AND VAR3<M AND VAR7>VAR5*9/10,0,70,1,1);
{中线趋势}
MDAY:=BARSLAST(VAR3>60 AND VAR3<=70);
HIGHM:=REF(HIGH,MDAY);
COUNTM:=COUNT(CLOSE<HIGHM,MDAY);
MEDIUMCOST:=IF(MDAY=0,CLOSE,SUM(CLOSE*VVOL,MDAY)/SUM(VVOL,MDAY));
拉升资金:=(CLOSE-MEDIUMCOST)/MEDIUMCOST*IF((CLOSE-MEDIUMCOST)/MEDIUMCOST<1,1000,10);
{LS:=MA(拉升资金,5);}
中线买入:=STICKLINE(CROSS(CLOSE,HIGHM) AND VAR3<50 AND COUNTM>MDAY*9/10,0,50,1,1);
{短线}
SDAY:=BARSLAST(VAR3>40 AND VAR3<=50);
HIGHS:=REF(HIGH,SDAY);
COUNTS:=COUNT(CLOSE<HIGHS,SDAY);
SHORTCOST:=SUM(CLOSE,SDAY)/SDAY;
散户进出:=MA((CLOSE-SHORTCOST)/SHORTCOST*IF((CLOSE-SHORTCOST)/SHORTCOST<1,1000,10),10);
短线买入:=STICKLINE(CROSS(CLOSE,HIGHS) AND VAR3<30 AND COUNTS>SDAY*9/10,0,50,1,1);
一剑封喉:=(CROSS(CLOSE,VAR6) AND VAR3<M AND VAR7>VAR5*9/10 AND 拉升资金>散户进出)
OR (CROSS(CLOSE,HIGHM) AND VAR3<50 AND COUNTM>MDAY*9/10 AND 拉升资金>散户进出) ;
IF(一剑封喉,50,0);
九毛八公式解读
N赋值:0 M赋值:60 TOTAL赋值:如果周期类型=1,返回5,否则返回如果周期类型=2,返回15,否则返回如果周期类型=3,返回30,否则返回如果周期类型=4,返回60,否则返回如果周期类型=5,返回240,否则返回1 MTIME赋值:当前离开盘分钟数关于TOTAL的模 CTIME赋值:如果MTIME<0.5,返回TOTAL,否则返回MTIME VVOL赋值:如果到最后交易的周期=1,返回成交量(手)*TOTAL/CTIME,否则返回成交量(手) VAR1赋值:VVOL/当前流通股本(手)*100 VAR2赋值:0日内VAR1的最高值 VAR3赋值:VAR1/VAR2*100 VAR4赋值:(最高价-最低价)/最低价*100 VAR5赋值:上次VAR3>N距今天数 VAR6赋值:VAR5日前的最高价 VAR7赋值:统计VAR5日中满足收盘价VAR5*9/10时,在0和70位置之间画柱状线,宽度为1,1不为0则画空心柱. MDAY赋值:上次VAR3>60ANDVAR3<=70距今天数 HIGHM赋值:MDAY日前的最高价 COUNTM赋值:统计MDAY日中满足收盘价 MDAY*9/10时,在0和50位置之间画柱状线,宽度为1,1不为0则画空心柱. SDAY赋值:上次VAR3>40ANDVAR3<=50距今天数 HIGHS赋值:SDAY日前的最高价 COUNTS赋值:统计SDAY日中满足收盘价 SDAY*9/10时,在0和50位置之间画柱状线,宽度为1,1不为0则画空心柱. 一剑封喉赋值:(收盘价上穿VAR6 AND VAR3 VAR5*9/10 AND 拉升资金>散户进出)OR (收盘价上穿HIGHM AND VAR3<50 AND COUNTM>MDAY*9/10 AND 拉升资金>散户进出) 如果一剑封喉,返回50,否则返回0