一个通达信分时主图,现上传源码供大家分享。
说明: 1、图上的压力、支撑数据是按"黄金分割"数学原理计算;
2、需要建立一个名称为"fsyy"引用指标;
3、股价线按红、白两色显示涨跌。
分时引用的公式:
{FSYY}
ZS:=DYNAINFO(7),NODRAW;
XJ:=DYNAINFO(3),NODRAW;
分时主图源码:
{分时主图}
TBX:=REF(EMA(C,14),1);
A1X:=(EMA(C,10)-TBX)/TBX*100;
DFX:=IF(A1X>=0,REF(EMA(C,10),BARSLAST(CROSS(A1X,0))+1),DRAWNULL);
KFX:=IF(A1X<0,REF(EMA(C,10),BARSLAST(CROSS(0,A1X))+1),DRAWNULL);
STICKLINE(A1X>=0,DFX,TBX,10,0),COLOR000066;
STICKLINE(A1X<0,KFX,TBX,10,0),COLOR006600;
NXX:EMA(C,120),COLOR0080FF,LINETHICK2;
DRAWTEXT(BARSTATUS=2,NXX,'牛熊线');
最新:C,LINETHICK1,COLORWHITE;
IF(C>=REF(C,1),C,DRAWNULL),LINETHICK3,COLORRED;
AA:=SUM(AMOUNT,BARSCOUNT(C))/SUM(VOL*100,BARSCOUNT(C));
BB:=BETWEEN(C/AA,C+H,C-H);
DRAWICON(ISLASTBAR AND C>REF(C,1),C,1);
DRAWICON(ISLASTBAR AND C<REF(C,1),C,2);
ZS:=IF(PERIOD=0 ,"FSYY.ZS#DAY",DRAWNULL),NODRAW;
XJ:=IF(PERIOD=0 ,"FSYY.XJ#DAY",DRAWNULL),NODRAW;
今阻①:=ZS*(1+0.191*0.1);
今阻②:=ZS*(1+0.382*0.1);
今阻③:=ZS*(1+0.618*0.1);
明阻①:=XJ*(1+0.191*0.1);
明阻②:=XJ*(1+0.382*0.1);
明阻③:=XJ*(1+0.618*0.1);
今撑①:=ZS*(1-0.191*0.1);
今撑②:=ZS*(1-0.383*0.1);
今撑③:=ZS*(1-0.618*0.1);
明撑①:=XJ*(1-0.191*0.1);
明撑②:=XJ*(1-0.382*0.1);
明撑③:=XJ*(1-0.618*0.1);
DRAWTEXT_FIX(1,0.1,0,0,STRCAT('今日阻力①',CON2STR(今阻①,2))),COLOR00FF00;
DRAWTEXT_FIX(1,0.4,0,0,STRCAT('今日阻力②',CON2STR(今阻②,2))),COLOR00FF00;
DRAWTEXT_FIX(1,0.7,0,0,STRCAT('今日阻力③',CON2STR(今阻③,2))),COLOR00FF00;
DRAWTEXT_FIX(1,0.1,1-0.95,0,STRCAT('明日阻力①',CON2STR(明阻①,2))),COLORFFFF00;
DRAWTEXT_FIX(1,0.4,1-0.95,0,STRCAT('明日阻力②',CON2STR(明阻②,2))),COLORFFFF00;
DRAWTEXT_FIX(1,0.7,1-0.95,0,STRCAT('明日阻力③',CON2STR(明阻③,2))),COLORFFFF00;
DRAWTEXT_FIX(1,0.1,1-0.9,0,STRCAT('今日支撑①',CON2STR(今撑①,2))),COLOR00FFFF;
DRAWTEXT_FIX(1,0.4,1-0.9,0,STRCAT('今日支撑②',CON2STR(今撑②,2))),COLOR00FFFF;
DRAWTEXT_FIX(1,0.7,1-0.9,0,STRCAT('今日支撑③',CON2STR(今撑③,2))),COLOR00FFFF;
DRAWTEXT_FIX(1,0.1,1-0.85,0,STRCAT('明日支撑①',CON2STR(明撑①,2))),COLORFF00FF;
DRAWTEXT_FIX(1,0.4,1-0.85,0,STRCAT('明日支撑②',CON2STR(明撑②,2))),COLORFF00FF;
DRAWTEXT_FIX(1,0.7,1-0.85,0,STRCAT('明日支撑③',CON2STR(明撑③,2))),COLORFF00FF;
20152282314721775.png
20152282315346262.png
|