通达信止损,止盈主图源码
也许你会用 【源码、主图、附图、说明】
说明;它们合并后使用,也许更好、也许使人更糊涂!
也许你会用主图源码
获利%:WINNER(CLOSE)*100,NODRAW,COLORWHITE;
DRAWTEXT_FIX(获利%>=95 AND ISLASTBAR,0.97,0.97,0,'高危'),COLORRED;
DRAWTEXT_FIX(获利%>=80 AND 获利%<95 AND ISLASTBAR,0.97,0.97,0,'风险'),COLORYELLOW;
DRAWTEXT_FIX(获利%>=50 AND 获利%<80 AND ISLASTBAR,0.97,0.97,0,'安全'),COLORGREEN;
DRAWTEXT_FIX(获利%<50 AND ISLASTBAR,0.97,0.97,0,'空头'),COLORBLUE;
STICKLINE((C-REF(C,1))*100/REF(C,1)>=(10-0.01*100/REF(C,1)),OPEN,CLOSE,3,0),COLOR0055FF;
STICKLINE((REF(C,1)-C)*100/REF(C,1)>=(10-0.01*100/REF(C,1)),OPEN,CLOSE,3,0),COLOR00FF00;
DP:=IF(C=INDEXC,0,1);
GJ:=AMOUNT/V/100;
【明日阻力】:L+(GJ-L)+(C-L),NODRAW;
【明日支撑】:L+(C-GJ),NODRAW;
今日阻力:REF(【明日阻力】 , 1),NODRAW;
今日支撑:REF(【明日支撑】 , 1),NODRAW;
{STICKLINE(ISLASTBAR AND DP=1 AND C>=今日阻力,今日阻力,今日阻力,30,0),COLOR0000FF;
STICKLINE(ISLASTBAR AND DP=1 AND C<今日阻力,今日阻力,今日阻力,30,0),COLOR00FF00;
STICKLINE(ISLASTBAR AND DP=1 AND C>=今日支撑,今日支撑,今日支撑,30,0),COLORFF00FF;
STICKLINE(ISLASTBAR AND DP=1 AND C<今日支撑,今日支撑,今日支撑,30,0),COLORFF0000;}
{A:=ISLASTBAR;
B:=ISLASTBAR;
D:=A-B;
E:=HHV(H,D);}
DRAWTEXT(C>0 AND DP=1 AND ISLASTBAR,【明日支撑】,'-----------------------------------'),COLOR00FFFF;
DRAWTEXT(C>0 AND DP=1 AND ISLASTBAR, 【明日阻力】,'-----------------------------------'),COLORFFFFFF;
DRAWTEXT(C>0 AND DP=1 AND ISLASTBAR,今日支撑,'-----------------------------------'),COLORFF00FF;
DRAWTEXT(C>0 AND DP=1 AND ISLASTBAR, 今日阻力,'-----------------------------------'),COLOR33FF33;
DRAWTEXT(C>0 AND DP=1 AND ISLASTBAR AND 【明日阻力】, 【明日阻力】*1.01,'明日阻力=: '),COLORFFFFFF;
DRAWTEXT(C>0 AND DP=1 AND ISLASTBAR AND 今日支撑, 今日支撑*0.99,'今日支撑=:'),COLORFF33FF;
DRAWTEXT(C>0 AND DP=1 AND ISLASTBAR AND 【明日支撑】, 【明日支撑】*0.99,'明日支撑=:'),COLOR00FFFF;
DRAWTEXT(C>0 AND DP=1 AND ISLASTBAR AND 今日阻力, 今日阻力*1.01,'今日阻力=:' ),COLOR33FF33;
Z1:=STRCAT(HYBLOCK,' ');
Z2:=STRCAT(Z1,DYBLOCK);
Z3:=STRCAT(Z2,' ');
DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(Z3,GNBLOCK));
DRAWTEXT_FIX(C>0,0.001,0.050,0,'主题库:'),COLORYELLOW,LINETHICK2;
DRAWTEXT_FIX(C>0,0.057,0.050,0,EXTERNSTR(0,2)),COLORRED,LINETHICK2;
DRAWTEXT_FIX(C>0,0.001,0.098,0,'2012业绩预测:'),COLORYELLOW,LINETHICK2;
DRAWTEXT_FIX(C>0,0.2,0.098,0,EXTERNSTR(0,4)),COLORRED,LINETHICK2;
DRAWTEXT_FIX(C>0,0.001,0.2.0,0,'中报预告:'),COLORYELLOW,LINETHICK2;
DRAWTEXT_FIX(C>0,0.080,0.2.0,0,EXTERNSTR(0,3)),COLORRED,LINETHICK2;
{T+1止赢、止损}
CC:IF(CURRBARSCOUNT<18,CONST(REF(C,1)),DRAWNULL),COLORWHITE;
止赢:1.05*CC,COLORYELLOW;
止损:0.97*CC,COLORFF00FF;