您现在的位置:好股网 >> 股票公式 >> 通达信公式 >> 一键转帖:在分时图上加入日K线 有图有说明

在分时图上加入日K线 有图有说明


指标功能:[B]国产软件[/B]
指标类型:简体中文
所需积分:0
推荐星级:
授权方式:共享版
公式大小:8.00 KB
更新时间:2014-11-21 22:36:00
公式简介:

在分时图里加进日K线,早有人发过。说实话在我看来都有瑕疵。我现在是站在各位前辈的肩膀上,尽自己最大努力修改了关键部位的不足。自己认为尚可能用。我自己用的分时加了自己的MACD在里面,放在这里的没加,特别说明。日K线在上午,我让他在分时图的右半部分显示,下午自动跳转到左办部分显示。这样不影响我们看盘。
提供的是导出来的指标,不加密、不限时。主要是考虑有些童鞋们不会自己装嵌套指标,因为这个指标要用线建立应用指标,有些人不会。所以干脆弄现成的给你。直接导入用就是。勿喜绕道,最见不得啥都给大家不干还屁话一大堆。
此指标还有个瑕疵就是极个别票日K线乖离太大的话,分时日K线会显示失真。暂时还没办法完美解决。主要是解决它有会引起压缩分时图的问题。这只是极个别票。

当然日K线数量可以想加多少加多少。这里只加了9天的。自己需要可以动手加。

1、应用指标,名称必须是“FSKY”
预测量:IF(CURRBARSCOUNT=1 AND PERIOD=5,VOL*240/FROMOPEN,VOL);
VAR1:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));
主买:IF(CLOSE>OPEN,VAR1*(HIGH-LOW),IF(CLOSE<OPEN,VAR1*((HIGH-OPEN)+(CLOSE-LOW)),VOL/2));
今量:VOL;
昨量:REF(VOL,1);
前量:REF(VOL,2);
昨开:REF(O,1);
昨收:REF(C,1);
前开:REF(O,2);
前收:REF(C,2);
ZO:REF(O,1);
ZC:REF(C,1);
ZH:REF(H,1);
ZL:REF(L,1);
JO:REF(O,2);
JC:REF(C,2);
JH:REF(H,2);
JL:REF(L,2);
JO3:REF(O,3);
JC3:REF(C,3);
JH3:REF(H,3);
JL3:REF(L,3);
JO4:REF(O,4);
JC4:REF(C,4);
JH4:REF(H,4);
JL4:REF(L,4);
JO5:REF(O,5);
JC5:REF(C,5);
JH5:REF(H,5);
JL5:REF(L,5);
JO6:REF(O,6);
JC6:REF(C,6);
JH6:REF(H,6);
JL6:REF(L,6);
JO7:REF(O,7);
JC7:REF(C,7);
JH7:REF(H,7);
JL7:REF(L,7);
JO8:REF(O,8);
JC8:REF(C,8);
JH8:REF(H,8);
JL8:REF(L,8);
MA2:MA(C,2);
MA3:MA(C,3);
MA4:MA(C,4);
MA5:MA(C,5);
MA10:MA(C,10);
MA20:MA(C,20);
MA60:MA(C,60);
上涨家数:INDEXADV;
下跌家数:INDEXDEC;

2、分时主图指标
{年月日}
DA:=YEAR AND MONTH AND DAY;
AA1:=STRCAT(CON2STR(YEAR,0),'年');
AA2:=STRCAT(CON2STR(MONTH,0),'月');
AA3:=STRCAT(CON2STR(DAY,0),'日');
AA4:=STRCAT('【',IF(WEEKDAY=1,'一',IF(WEEKDAY=2,'二',IF(WEEKDAY=3,'三',IF(WEEKDAY=4,'四',IF
(WEEKDAY=5,'五',IF(WEEKDAY=6,'六','日')))))));
AA:=STRCAT(STRCAT(STRCAT(AA1,AA2),STRCAT(AA3,AA4)),'】');
DRAWTEXT_FIX(DA,0.85,0.01,0,AA),COLORWHITE;
{分时K线}
KP:=DYNAINFO(4);
ZX:=DYNAINFO(7);
ZS:=DYNAINFO(3);
ZG:=DYNAINFO(5);
ZD:=DYNAINFO(6);
OP:=400-(KP/ZS-1)*4000;
CL:=400-(ZX/ZS-1)*4000;
HI:=400-(ZG/ZS-1)*4000;
LO:=400-(ZD/ZS-1)*4000;
N1:=IF(FROMOPEN<=120,950,360);
Q:=IF(ZX>KP,RGB(255,0,0),IF(ZX<KP,RGB(84,255,255),IF(ZX=KP,RGB(255,255,255),DRAWNULL)));
DRAWRECTREL(N1+4,HI,N1+8,LO,Q );
DRAWRECTREL(N1-10,OP,N1+22,CL,Q );

ZO:="FSKY.ZO#DAY";
ZC:="FSKY.ZC#DAY";
ZH:="FSKY.ZH#DAY";
ZL:="FSKY.ZL#DAY";
ZKP:=400-(ZO/ZS-1)*4000;
ZCP:=400-(ZC/ZS-1)*4000;
ZZG:=400-(ZH/ZS-1)*4000;
ZZD:=400-(ZL/ZS-1)*4000;
Q1:=IF(ZC>ZO,RGB(255,0,0),IF(ZC<ZO,RGB(84,255,255),IF(ZC=ZO,RGB(255,255,255),DRAWNULL)));
DRAWRECTREL(N1-36,ZZG,N1-32,ZZD,Q1);
DRAWRECTREL(N1-49,ZKP,N1-17,ZCP,Q1);
JO:="FSKY.JO#DAY";
JC:="FSKY.JC#DAY";
JH:="FSKY.JH#DAY";
JL:="FSKY.JL#DAY";
ZZKP:=400-(JO/ZS-1)*4000;
ZZCP:=400-(JC/ZS-1)*4000;
ZZZG:=400-(JH/ZS-1)*4000;
ZZZD:=400-(JL/ZS-1)*4000;
Q2:=IF(JC>JO,RGB(255,0,0),IF(JC<JO,RGB(84,255,255),IF(JC=JO,RGB(255,255,255),DRAWNULL)));
DRAWRECTREL(N1-76,ZZZG,N1-72,ZZZD,Q2);
DRAWRECTREL(N1-89,ZZKP,N1-57,ZZCP,Q2);

JO3:="FSKY.JO3#DAY";
JC3:="FSKY.JC3#DAY";
JH3:="FSKY.JH3#DAY";
JL3:="FSKY.JL3#DAY";
ZZKP3:=400-(JO3/ZS-1)*4000;
ZZCP3:=400-(JC3/ZS-1)*4000;
ZZZG3:=400-(JH3/ZS-1)*4000;
ZZZD3:=400-(JL3/ZS-1)*4000;
Q3:=IF(JC3>JO3,RGB(255,0,0),IF(JC3<JO3,RGB(84,255,255),IF(JC3=JO3,RGB(255,255,255),DRAWNULL)));
DRAWRECTREL(N1-116,ZZZG3,N1-112,ZZZD3,Q3);
DRAWRECTREL(N1-129,ZZKP3,N1-97,ZZCP3,Q3);

JO4:="FSKY.JO4#DAY";
JC4:="FSKY.JC4#DAY";
JH4:="FSKY.JH4#DAY";
JL4:="FSKY.JL4#DAY";
ZZKP4:=400-(JO4/ZS-1)*4000;
ZZCP4:=400-(JC4/ZS-1)*4000;
ZZZG4:=400-(JH4/ZS-1)*4000;
ZZZD4:=400-(JL4/ZS-1)*4000;
Q4:=IF(JC4>JO4,RGB(255,0,0),IF(JC4<JO4,RGB(84,255,255),IF(JC4=JO4,RGB(255,255,255),DRAWNULL)));
DRAWRECTREL(N1-156,ZZZG4,N1-152,ZZZD4,Q4);
DRAWRECTREL(N1-169,ZZKP4,N1-137,ZZCP4,Q4);

JO5:="FSKY.JO5#DAY";
JC5:="FSKY.JC5#DAY";
JH5:="FSKY.JH5#DAY";
JL5:="FSKY.JL5#DAY";
ZZKP5:=400-(JO5/ZS-1)*4000;
ZZCP5:=400-(JC5/ZS-1)*4000;
ZZZG5:=400-(JH5/ZS-1)*4000;
ZZZD5:=400-(JL5/ZS-1)*4000;
Q5:=IF(JC5>JO5,RGB(255,0,0),IF(JC5<JO5,RGB(84,255,255),IF(JC5=JO5,RGB(255,255,255),DRAWNULL)));
DRAWRECTREL(N1-196,ZZZG5,N1-192,ZZZD5,Q5);
DRAWRECTREL(N1-209,ZZKP5,N1-177,ZZCP5,Q5);

JO6:="FSKY.JO6#DAY";
JC6:="FSKY.JC6#DAY";
JH6:="FSKY.JH6#DAY";
JL6:="FSKY.JL6#DAY";
ZZKP6:=400-(JO6/ZS-1)*4000;
ZZCP6:=400-(JC6/ZS-1)*4000;
ZZZG6:=400-(JH6/ZS-1)*4000;
ZZZD6:=400-(JL6/ZS-1)*4000;
Q6:=IF(JC6>JO6,RGB(255,0,0),IF(JC6<JO6,RGB(84,255,255),IF(JC6=JO6,RGB(255,255,255),DRAWNULL)));
DRAWRECTREL(N1-236,ZZZG6,N1-232,ZZZD6,Q6);
DRAWRECTREL(N1-249,ZZKP6,N1-217,ZZCP6,Q6);

JO7:="FSKY.JO7#DAY";
JC7:="FSKY.JC7#DAY";
JH7:="FSKY.JH7#DAY";
JL7:="FSKY.JL7#DAY";
ZZKP7:=400-(JO7/ZS-1)*4000;

ZZCP7:=400-(JC7/ZS-1)*4000;
ZZZG7:=400-(JH7/ZS-1)*4000;
ZZZD7:=400-(JL7/ZS-1)*4000;
Q7:=IF(JC7>JO7,RGB(255,0,0),IF(JC7<JO7,RGB(0,255,255),IF(JC7=JO7,RGB(255,255,255),DRAWNULL)));
DRAWRECTREL(N1-276,ZZZG7,N1-272,ZZZD7,Q7);
DRAWRECTREL(N1-289,ZZKP7,N1-257,ZZCP7,Q7);
JO8:="FSKY.JO8#DAY";
JC8:="FSKY.JC8#DAY";
JH8:="FSKY.JH8#DAY";
JL8:="FSKY.JL8#DAY";
ZZKP8:=400-(JO8/ZS-1)*4000;
ZZCP8:=400-(JC8/ZS-1)*4000;
ZZZG8:=400-(JH8/ZS-1)*4000;
ZZZD8:=400-(JL8/ZS-1)*4000;
Q8:=IF(JC8>JO8,RGB(255,0,0),IF(JC8<JO8,RGB(0,255,255),IF(JC8=JO8,RGB(255,255,255),DRAWNULL)));
DRAWRECTREL(N1-316,ZZZG8,N1-312,ZZZD8,Q8);
DRAWRECTREL(N1-329,ZZKP8,N1-297,ZZCP8,Q8);
{分时均价线和分时线}
最新:CLOSE,COLORWHITE;
AQA:=SUM(AMOUNT,BARSCOUNT(C))/SUM(VOL*100,BARSCOUNT(C));
DRAWTEXT( ISLASTBAR AND 最新>REF(最新,1),最新,STRCAT(' 涨▲',CON2STR(最新,2))),COLORMAGENTA;
DRAWTEXT( ISLASTBAR AND 最新<REF(最新,1),最新,STRCAT(' 跌▼',CON2STR(最新,2))),COLOR00FF00;
均价:SUM(V*C,0)/SUM(V,0),COLORGREEN,LINETHICK1;
IF(均价<=REF(均价,1),均价,DRAWNULL),COLORGREEN,LINETHICK3;
IF(均价>=REF(均价,1),均价,DRAWNULL),COLORYELLOW,LINETHICK3;
DRAWTEXT(CURRBARSCOUNT=8,均价,'均'),COLORYELLOW,LINETHICK3;
DRAWNUMBER(CURRBARSCOUNT=1,均价,均价),COLORYELLOW,LINETHICK3;
{板块概念}{www.goodgupiao.com}
DRAWTEXT_FIX(1,0.000,1-0.05,0,DYBLOCK),COLORWHITE;
DRAWTEXT_FIX(1,0.0550,1-0.05,0,HYBLOCK),COLORYELLOW;
DRAWTEXT_FIX(1,0.1050,1-0.05,0,GNBLOCK),COLORYELLOW;
 





[url=http://www.goodgupiao.com/gupiaogongshi/35407.html][B]在分时图上加入日K线 有图有说明[/B][/url]