2011年的时候,蔡佑佑老师发表了他的大智慧分时公式,本人一直在关注,感觉非常好用,现在从新把他上传
这是蔡佑佑老师的原图,不知道各位同学还记的吗,下面是源码,我发出来,首先谢谢蔡佑佑老师的无私奉献;
{分时主图}
{引用 预测股价 设定预测范围}
最高价1:"预测股价.最高价1#day",PRECIS2,linethick0;
最低价1:"预测股价.最低价1#day",PRECIS2,linethick0;
预测低一:"预测股价.预测低一#day",PRECIS2,linethick0;
预测低一1:"预测股价.预测低一1#day",PRECIS2,linethick0;
预测低二:"预测股价.预测低二#day",PRECIS2,linethick0;
预测低二1:"预测股价.预测低二1#day",PRECIS2,linethick0;
STICKLINE((预测低二<预测低一),预测低二,预测低一,10,0),COLOR0055ff,linethick0;
STICKLINE((预测低一<预测低二),预测低一,预测低二,10,0),COLOR0055ff,linethick0;
DRAWTEXT(BARSTATUS=2,预测低一,' 预测低一:'+NUMTOSTRN(预测低一,2)+'元' ),COLORffffff,LINETHICK2;
DRAWTEXT(BARSTATUS=2,预测低二,' 预测低二:'+NUMTOSTRN(预测低二,2)+'元' ),COLORffffff,LINETHICK2;
DRAWTEXT(TIME=93000,预测低二*0.999,' ●低吸区 '),Colorffffff,LINETHICK4;
平均价一:"预测股价.平均价一#day",coloryellow,linethick1,layer0;
平均价二:"预测股价.平均价二#day",coloryellow,linethick1,layer0;
STICKLINE((平均价二<平均价一),平均价二,平均价一,10,0),COLORblue,linethick2;
STICKLINE((平均价一<平均价二),平均价一,平均价二,10,0),COLORblue,linethick2;
DRAWTEXT(BARSTATUS=2,平均价一,' 强势高价:'+NUMTOSTRN(平均价一,2)+'元' ),COLORred,LINETHICK2;
DRAWTEXT(BARSTATUS=2,平均价二,' 弱势高价:'+NUMTOSTRN(平均价二,2)+'元' ),COLORred,LINETHICK2;
DRAWTEXT(TIME=93000,平均价一*0.999,' ●高抛区 '),Colorffffff,LINETHICK4;
{引用 分时资金}
净流入:="分时资金.净流入(万)";
{忘了作者 动态阻力及支撑}
MA30:EMA(CLOSE,30),linethick0;
强弱:EMA(CLOSE,900),colorred,linethick1,layer0;
STICKLINE((MA30>强弱),MA30,强弱,1,0),COLOR0000FF;
STICKLINE((MA30<强弱),MA30,强弱,1,0),COLOR00FF00;
H1:=MAX(DYNAINFO(3),DYNAINFO(5));
L1:=MIN(DYNAINFO(3),DYNAINFO(6));
P1:=H1-L1;
阻力:L1+P1*7/8,COLOR00DD00,linethick1,layer0;
支撑:L1+P1*0.5/8,COLOR00DD00,linethick1,layer0;
现价:CLOSE,COLORffffff,LINETHICK1;
支差:现价-支撑,linethick0;
阻差:现价-阻力,linethick0;
支差比:支差/MA30*100,linethick0;
阻差比:阻差/MA30*100,linethick0;
{显示画面}
{HH:=DYNAINFO(5);
LL:=DYNAINFO(6);}
{今天最新价与昨收价差}
今昨差:现价-DYNAINFO(3),linethick0;
今昨差比:今昨差/DYNAINFO(3)*100,linethick0;
{今天最高价与昨收价差}
高昨差:DYNAINFO(5)-DYNAINFO(3),linethick0;
高昨差比:高昨差/DYNAINFO(3)*100,linethick0;
STICKLINE(CROSS(支撑,现价),支撑,阻力,1,0),COLORffffff,linethick1,layer0;
DRAWTEXT(LONGCROSS(支撑,现价,2),支撑*0.998,'低'),COLORgreen,linethick2,layer0;
DRAWTEXT(LONGCROSS(现价,阻力,2),现价*1.001,'高'),COLORffffff,linethick2,layer0;
DRAWTEXTABS(265,318,' 今日 昨日 昨 收 最新价'),COLORffffff,LINETHICK4;
DRAWTEXTABS(340,344,'最高价'),COLORffffff,LINETHICK4;
DRAWTEXTABS(340,370,'最低价'),COLORffffff,LINETHICK4;
DRAWTEXTABS(400,344,' '+NUMTOSTRN(DYNAINFO(3),2)),COLORffffff,LINETHICK4;
{分时横盘公式}
tt:=BARSCOUNT(C);
CC:=CLOSE;
zz:=SUM(AMOUNT,tt)/SUM(VOL*100,tt);
zz1:=BETWEEN(C/zz,1.05,0.95);
均线:IF(zz1=0,MA(C,TT),zz),COLOR00FFFF,LINETHICK0;
上均:均线 + AVEDEV(C,tt)*2,COLOR00FF00,LINETHICK0;
下均:均线 - AVEDEV(C,tt)*2,COLORFF6600,LINETHICK0;
时长:=if(HOUR>=13 AND HOUR<15 ,1,0);
涨幅:=(close/DYNAINFO(3))>=1.03;
跌幅:=(close/DYNAINFO(3))<=0.97;
涨跌幅:=涨幅 OR 跌幅;
yy:=SMA(vol,30,1);
放量:=(yy-LLV(Llv(yy,1),30))/(HHV(Hhv(yy,1),30)-LLV(Llv(yy,1),30))>0;
横盘:=((HHV(CLOSE,TT)-LLV(CLOSE,TT))/CLOSE)<=0.05;
横涨:=涨跌幅=0 and 横盘 and 时长 and 放量 and CROSS(CC,上均)and DYNAINFO(22)<DYNAINFO(23) ;
横跌:=涨跌幅=0 and 横盘 and 时长 and 放量 and CROSS(下均,CC) ;
PP:= FILTER(横涨,100) ;
UU:= FILTER(横跌,50) ;
DRAWTEXT(PP,平均价一*1.005,'▲上冲'),colorffffff,linethick4;
DRAWTEXT(UU,预测低一*0.995,'▼下破'),COLORgreen,linethick4;
VERTLINE( PP,3),colorffffff;
VERTLINE( UU,3),colorffffff;
{变色设计}
PARTLINE(c,c>=REF(c,1),RGB(255,250,250),c<=REF(c,1),RGB(0,255,0)),linethick2,layer0;
{一品老师的盘中急杀----一品茶缘编写,1分钟预警指标,附送急涨指标}
JS1:=L=LLV(L,3) AND (L/HHV(H,3)-1)*100<=(0-3);
JS2:=L=LLV(L,10) AND (L/HHV(H,10)-1)*100<=(0-5);
急杀:=JS1 OR JS2;
DRAWTEXT(急杀,c,'●急杀'),COLORgreen,linethick4;
DRAWTEXT(急杀,c,'●急杀'),COLORgreen,linethick4;
{一品老师的分时过顶}
KP30:=TIME0<36000;
KPGD:=H=HHV(H,0) AND KP30;
GDSJ:=BARSLAST(KPGD);
HH:REF(H,GDSJ),COLORFF00FF,POINTDOT,LINETHICK0;
过顶:IF(CROSS(C,HH),1,0),COLOR00FF00,POINTDOT,LINETHICK0;
冲高:IF(FILTER(CROSS(C,HH*1.01),15),1,0),COLOR00FFFF,POINTDOT,LINETHICK0;
DRAWTEXT(过顶,HH,'↑'),COLORyellow,linethick2;
DRAWTEXT(冲高,HH,'▲'),COLORyellow,linethick2;
{前30分钟的股价}
VERTLINE(TIME=94000,2);
VERTLINE(TIME=95000,2);
VERTLINE(TIME=100000,2);
DRAWTEXT(TIME=94000,C,NUMTOSTR(C)),Colorffffff,LINETHICK2;
DRAWTEXT(TIME=95000,C,NUMTOSTR(C)),Colorffffff,LINETHICK2;
DRAWTEXT(TIME=100000,C,NUMTOSTR(C)),Colorffffff,LINETHICK2;
{引用 分时副图 显示涨跌}
MACD:"分时副图.MACD",PRECIS2,linethick0;
DRAWRECTREL(262,744,686,930,rgb(47,79,79));
DRAWRECTREL(446,744,686,930,rgb(47,79,79));
{DRAWRECTREL(262,680,686,748,rgb(10,10,20));}
{颜色显示涨跌}
ssx0:=现价>DYNAINFO(3);
ssx1:=现价<DYNAINFO(3);
ssx2:=现价=DYNAINFO(3);
IF BARSTATUS=2 AND ssx0 THEN BEGIN
DRAWTEXTABS(529,344,' '+NUMTOSTRN(现价,2)),colorred,LINETHICK4;
END
ELSE
IF BARSTATUS=2 AND ssx1 THEN BEGIN
DRAWTEXTABS(529,344,' '+NUMTOSTRN(现价,2)),colorgreen,LINETHICK4;
END
ELSE
IF BARSTATUS=2 AND ssx2 THEN BEGIN
DRAWTEXTABS(529,344,' '+NUMTOSTRN(现价,2)),coloryellow,LINETHICK4;
END;
上升:((MACD>REF(MACD,1)) AND (MACD<0)) or ((MACD>REF(MACD,1)) AND (MACD>0)),LINETHICK0;
下跌:((MACD<REF(MACD,1)) AND (MACD>0)) or ((MACD<REF(MACD,1)) AND (MACD<0)),LINETHICK0;
ssxd0:=上升;
ssxd1:=下跌;
IF BARSTATUS=2 AND ssxd0 THEN BEGIN
DRAWTEXTABS(550,318,' ▲上升中 '),colorred,LINETHICK4;
DRAWRECTREL(620,810,684,920,rgb(255,0,0));
END
ELSE
IF BARSTATUS=2 AND ssxd1 THEN BEGIN
DRAWTEXTABS(550,318,' ▼下跌中 '),colorgreen,LINETHICK4;
DRAWRECTREL(620,810,684,920,rgb(0,255,0));
END;
ssxd3:=今昨差>0;
ssxd4:=今昨差<0;
IF BARSTATUS=2 AND ssxd3 THEN BEGIN
DRAWTEXTABS(430,370,' 涨:'+NUMTOSTRN(今昨差,2)),colorred,LINETHICK4;
END
ELSE
IF BARSTATUS=2 AND ssxd4 THEN BEGIN
DRAWTEXTABS(430,370,' 跌:'+NUMTOSTRN( |