{-----------------------☆功能开关------------------------} {箱体部分} cc:=c; oo:=o; hh:=h; ll:=l; top:=h; bot:=l; xx[1]:=1; kk:=1; for i=1 to datacount do begin if xx=1 then begin top:=hh; end; if xx[i-1]=1 then begin if hh>top[i-1] then begin top:=hh; xx:=1; end;else begin top:=top[i-1]; xx:=2; end; end; if xx[i-1]=2 then begin if hh>top[i-1] then begin top:=hh; xx:=1; end;else begin top:=top[i-1]; bot:=ll; xx:=3; end; end; if xx[i-1]=3 then begin top:=top[i-1]; if ll<bot[i-1] then begin bot:=ll; xx:=3; end;else begin bot:=bot[i-1]; xx:=4; end; end; if xx[i-1]=4 then begin top:=top[i-1]; if ll<bot[i-1] then begin bot:=ll; xx:=3; end;else begin bot:=bot[i-1]; xx:=5; end; end; if xx[i-1]=5 then begin if ll<bot[i-1] or hh>top[i-1] then begin top:=hh; bot:=hh; xx:=1; end;else begin bot:=bot[i-1]; top:=top[i-1]; xx:=5; end; end; end; for j=1 to datacount do begin if xx[j]=5 and xx[j-1]=4 then begin for k=j-1 downto j-kk do begin top[k]:=top[j]; bot[k]:=bot[j]; end; end; if xx[j-1]=5 and xx[j]=1 then kk:=0; kk:=kk+1; end; 中位线:=(top+bot)/2;{信号部分---参考} 买点:=FILTER((TROUGHBARS(3,15,1)<4)=1,3); 卖点:=FILTER((PEAKBARS(3,15,1)<4)=1,3); {短波--未来} F:=100*(C-REF(C,1))/REF(C,1); p1:=IF(C<REF(O,1) AND f<0,1,0); p3:=IF(C>REF(O,1) AND f>0,1,0); p2:=IF(C<REF(O,2) AND f<0,1,0); p4:=IF(C>REF(O,2) AND f>0,1,0); 买D5:=P1=0 AND REF(P1,1)=1 AND P2=0 AND REF(P2,1)=1; 卖D6:=P3=0 AND REF(P3,1)=1 AND P4=0 AND REF(P4,1)=1; FZ:=PEAK(3,5,1); FW:=PEAKBARS(3,5,1); GZ:=TROUGH(3,5,1); GW:=TROUGHBARS(3,5,1); AS:=ZIG(3,3); 涨AL:=CROSS(AS,REF(AS,1)); 跌AG:=CROSS(REF(AS,1),AS); Ss1:=IF(FW>GW,FW,0); Ss2:=IF(FW<GW,GW,0); Ss3:=BARSLAST(Ss1); Ss4:=BARSLAST(Ss2); {---------立体K线--------} M1:MA(CLOSE,5); M2:MA(CLOSE,13); M3:MA(CLOSE,30); M4:MA(CLOSE,60); STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,9,0 ),COLOR009900; STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,6,0 ),COLOR00cc00; STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,2.4,0 ),COLOR33ff00; STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,1.1,0 ),COLOR66ff00;STICKLINE(CLOSE>OPEN,CLOSE,OPEN,9,0 ),COLOr000099; STICKLINE(CLOSE>OPEN,CLOSE,OPEN,6 ,0 ),COLOR0000cc; STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2.4 ,0 ),COLOR0000ff; STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1.1 ,0 ),COLOR0033ff;STICKLINE(CLOSE>OPEN,OPEN,LOW,0.5,0 ),COLOR9933ff; STICKLINE(CLOSE>OPEN,CLOSE,HIGH,0.5 ,0 ),COLOR9933ff; STICKLINE(OPEN>=CLOSE,CLOSE,LOW,0.5 ,0 ),COLOR66cc33; STICKLINE(OPEN>=CLOSE,OPEN,HIGH,0.5 ,0 ),COLOR66cc33;A0:=NUMTOSTR(MA(VOL,5),2); B0:=NUMTOSTR(MA(VOL/CAPITAL*100,5)*5,2); TYP:=(HIGH+LOW+CLOSE)/3; LL:=LLV(LOW,12); HH:=HHV(HIGH,12); WR:=TYP+(TYP-LL); WS:=TYP-(HH-TYP); WA:=NUMTOSTR(WR,2); WB:=NUMTOSTR(WS,2); MM:=BUYVOL/(BUYVOL+SELLVOL)*100; ZLM1:=(DYNAINFO(23)/2+DYNAINFO(22)/10)/2; ZLM2:=MA(VOL,60)*0.333; ZLM3:=CAPITAL*(MA(VOL/CAPITAL*100,60)*60-INDEXV/ESTDATA(1)*1000); ZLM:=(ZLM1+ZLM2+ZLM3)/3; T:=NUMTOSTR(ZLM/10000,2);DRAWTEXT(BARPOS=SYSPARAM(2),HIGH,'\n'+BLKNAME+';五日均量:'+A0+',五日换手:'+B0+'%'+',支撑:' +WB+',压力:'+WA+',\n主力持仓:'+T),align4,COLORGREEN;A1:=BARSLAST(REF(CROSS("macd.diff","macd.dea"),1)); B1:=REF(CLOSE,A1+1)>CLOSE and REF("macd.diff",A1+1)<"macd.diff" and CROSS("macd.diff","macd.dea");A2:=BARSLAST(REF(CROSS("kdj.k","kdj.d"),1)); B2:=REF(CLOSE,A2+1)>CLOSE and REF("kdj.k",A2+1)<"kdj.k" and CROSS("kdj.k","kdj.d");A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1)); B3:=REF(CLOSE,A3+1)>CLOSE and REF("RSI.RSI1",A3+1)<"RSI.RSI1" and CROSS("RSI.RSI1","RSI.RSI2");FIL1:=FILTER(B1>0,7) or FILTER(B2>0,7) or FILTER(B3>0,7); DRAWTEXT(FIL1,LOW-0.02,'底背'),COLORRED;C1:=BARSLAST(REF(CROSS("macd.dea","macd.diff"),1)); D1:=REF(CLOSE,C1+1)<CLOSE and REF("macd.diff",C1+1)>"macd.diff" and CROSS("macd.dea","macd.diff");C2:=BARSLAST(REF(CROSS("kdj.d","kdj.k"),1)); D2:=REF(CLOSE,C2+1)<CLOSE and REF("kdj.k",C2+1)>"kdj.k" and CROSS("kdj.d","kdj.k");C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1)); D3:=REF(CLOSE,C3+1)<CLOSE and REF("RSI.RSI1",C3+1)>"RSI.RSI1" and CROSS("RSI.RSI2","RSI.RSI1");FIL2:=FILTER(D1>0,7) OR FILTER(D2>0,7) OR FILTER(D3>0,7); DRAWTEXT(FIL2,HIGH+0.1,'顶背'),COLORBLUE; {-----------------【图解模板】---------------------}; {箱体部分} PARTLINE(top=ref(top,1),top),Color008293;//箱顶 PARTLINE(bot=ref(bot,1),bot),Color008293;//箱底 STICKLINE((top<>ref(top,1) or bot<>ref(bot,1)) and xx=1 and ref(xx,1)=5,top,bot,1,0),Color008293;//左侧竖线 STICKLINE((top<>refx(top,1) or bot<>refx(bot,1)) and xx=5 and refx(xx,1)=1,top,bot,1,0),Color008293;//右侧竖线{-------阻力支撑------} b:=BARSCOUNT(CLOSE)=SYSPARAM(2); d:=BARSLAST(b); hh:=HHV(HIGH,d); DRAWTEXT(BARSTATUS=2,hh,STKLABEL+' '+STKNAME+' '),ColorFFFF80,pxdn20,align4,align2; 换手率:=100*VOL/CAPITAL,colorfffFff; RH:=HIGH-LOW; R:=DYNAINFO(13)*100; DRAWTEXT(BARSTATUS=2,hh,'当日振幅:'+NUMTOSTR(R,2)+'% '+NUMTOSTR(RH,2)+'元 '+' 当前换手率:'+NUMTOSTR(换手率,2)+'% '+' '),ColorFFFFFF,pxdn20,align4,align2; DRAWTEXT(BARSTATUS=2,hh,' 机构评级:'+SELFSTRING('评级')+' '),colorffffff,pxdn80,align4,align2; gj:=IF(CLOSE=INDEXC,(INDEXC+INDEXH+INDEXL+INDEXO)/4,AMOUNT/(VOL+0.01)/100); 明日阻力:=LOW+(gj-LOW)+(CLOSE-LOW); 明日支撑:=LOW+(CLOSE-gj); 今日阻力:=REF(明日阻力 , 1); 今日支撑:=REF(明日支撑 , 1); STICKLINE(BARSTATUS=2 and CLOSE>=今日阻力,今日阻力,今日阻力,30,0),Color0000FF; STICKLINE(BARSTATUS=2 and CLOSE<今日阻力,今日阻力,今日阻力,30,0),Color00FF00; STICKLINE(BARSTATUS=2 and CLOSE>=今日支撑,今日支撑,今日支撑,30,0),ColorFF00FF; STICKLINE(BARSTATUS=2 and CLOSE<今日支撑,今日支撑,今日支撑,30,0),,Color0000FF; DRAWTEXT(BARSTATUS=2 ,hh,'---------------------------------- '),ColorFFFFFF,pxdn2,align4,align2; DRAWTEXT(BARSTATUS=2 and CLOSE>=今日支撑,hh,' 今日支撑=:'+NUMTOSTR(今日支撑 ,2 )+' '),ColorFF00FF,pxdn50,align4,align2; DRAWTEXT(BARSTATUS=2 and CLOSE<今日支撑,hh,' 今日支撑=:'+NUMTOSTR(今日支撑 ,2 )+' '),,Color0000FF,pxdn50,align4,align2; DRAWTEXT(BARSTATUS=2 and CLOSE>=今日阻力,hh,' 今日阻力=:'+NUMTOSTR(今日阻力 ,2 )+' '),align4,Color0000FF,pxdn20,align2; DRAWTEXT(BARSTATUS=2 and CLOSE<今日阻力,hh,' 今日阻力=:'+NUMTOSTR(今日阻力 ,2 )+' '),Color00FF00,pxdn20,align4,align2; DRAWTEXT(BARSTATUS=2 ,hh,' 明日阻力=:'+NUMTOSTR(明日阻力 ,2 )+' '),Color00FFFF,pxdn20,align4,align2; DRAWTEXT(BARSTATUS=2 ,hh,' 明日支撑=:'+NUMTOSTR(明日支撑 ,2 )+' '),Color00FFFF,pxdn50,align4,align2; DRAWTEXT(BARSTATUS=2 ,hh,'---------------------------------- '),ColorFFFFFF,pxdn70,align4,align2; DRAWTEXT(BARSTATUS=2 and VOL>REF(VOL,1) and MA(VOL,5)>REF(MA(VOL,5),1),hh,'今日成交量大于昨日,且有继续增大趋势'+' '),Color8285FF,pxdn90,align4,align2; DRAWTEXT(BARSTATUS=2 and VOL<REF(VOL,1) and MA(VOL,5)>REF(MA(VOL,5),1),hh,'今日成交量小于昨日,但有放大迹象'+' '),Color8285FF,pxdn90,align4,align2; DRAWTEXT(BARSTATUS=2 and VOL>REF(VOL,1)and MA(VOL,5)<REF(MA(VOL,5),1),hh,'今日成交量大于昨日, 但有缩小迹象'+' '),Color8285FF,pxdn90,align4,align2; DRAWTEXT(BARSTATUS=2 and VOL<REF(VOL,1)and MA(VOL,5)<REF(MA(VOL,5),1),hh,'今日成交量小于昨日,且有缩小迹象'+' '),Color8285FF,pxdn90,align4,align2;哪位大侠高手可以改写成TDX可用?一些附贴通达信可实现的别人的一种思路。请高手帮忙~~~ 附贴源码如下: {箱体--TDX} {HH:=HHV(HIGH,5); LL:=LLV(LOW ,5); XH:=CONST(IF(ISLASTBAR,IF(1<=1,HH,REF(HH,1-1)),DRAWNULL)); XL:=CONST(IF(ISLASTBAR,IF(1<=1,LL,REF(LL,1-1)),DRAWNULL)); STICKLINE(CURRBARSCOUNT=1+FLOOR(5/2),XH,XL,5*4+1,1),COLORWHITE; DRAWKLINE(HIGH,OPEN,LOW,CLOSE);}[这个应该是个飞狐的源码,可惜测试不通过,希望高手能修正一下,附件里下载的,是源码,并非公式]
 |