您现在的位置:好股网 >> 股票公式 >> 飞狐股票公式 >> 一键转帖:分时界面叠加两日k线公式(调整参数可以叠加对应大盘K线+个股当日K线)

分时界面叠加两日k线公式(调整参数可以叠加对应大盘K线+个股当日K线)


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

引用公式:
{行情引用}
INPUT:P1(5,3,21),P2(10,7,60);
OO:O;
HH:H;
LL:L;
CC:C;
VV:V;
额:AMOUNT;
昨收:REF(C,1);
前收:REF(C,2);
首日:REF(DATE,BARPOS-1);

创业板:=INBLOCK('深圳创业');
中小企业:=INBLOCK('中小企业');
上证A股:=STRCMP(MARKETLABEL, 'SH')=0;
深证A股:=STRCMP(MARKETLABEL, 'SZ')=0;
上海基金:=INBLOCK('上海基金');
深圳基金:=INBLOCK('深圳基金');
开:IF(上海基金=1,"SH000011$OPEN",IF(深圳基金=1,"399305$OPEN",IF(中小企业=1,"399101$OPEN",IF(创业板=1,"399102$OPEN",IF(上证A股=1,"SH000001$OPEN",IF(深证A股=1,"399001$OPEN",0)))))),LINETHICK;
高:IF(上海基金=1,"SH000011$HIGH",IF(深圳基金=1,"399305$HIGH",IF(中小企业=1,"399101$HIGH",IF(创业板=1,"399102$HIGH",IF(上证A股=1,"SH000001$HIGH",IF(深证A股=1,"399001$HIGH",0)))))),LINETHICK;
低:IF(上海基金=1,"SH000011$LOW",IF(深圳基金=1,"399305$LOW",IF(中小企业=1,"399101$LOW",IF(创业板=1,"399102$LOW",IF(上证A股=1,"SH000001$LOW",IF(深证A股=1,"399001$LOW",0)))))),LINETHICK;
收:IF(上海基金=1,"SH000011$CLOSE",IF(深圳基金=1,"399305$CLOSE",IF(中小企业=1,"399101$CLOSE",IF(创业板=1,"399102$CLOSE",IF(上证A股=1,"SH000001$CLOSE",IF(深证A股=1,"399001$CLOSE",0)))))),LINETHICK;

E:=(HIGH+LOW+OPEN+2*CLOSE)/5;
明日阻力:=2*E-LOW;
明日支撑:=2*E-HIGH;
明日突破:=E+(HIGH-LOW);
明日反转:=E-(HIGH-LOW);
阻力:REF(明日阻力 , 1);
支撑:REF(明日支撑 , 1);
突破:REF(明日突破,1);
反转:REF(明日反转,1);
M1:MA(C,P1);
M2:MA(C,P2);
昨日阻力:REF(阻力,1);
昨日支撑:REF(支撑,1);
昨日突破:REF(突破,1);
昨日反转:REF(反转,1);
昨日M1:REF(M1,1);
昨日M2:REF(M2,1);


 




主公式:


{分时日K线-飞狐版-创幻论坛-舍得快乐}
{用法:请在日线以下周期使用,其它周期可能不正常}
{调整参数P,P默认等于零,叠加【个股】上周期 + 当周期日K线,P等于1,叠加【个股】 + 【对应大盘】 的当周期日K线}
{参数N为显示K线宽度,一般默认即可,参数M为K线显示位置,默认为上午十点钟位置--参数T为叠加支撑、均线等的设置,默认1为只在当日叠加K线上显示均线、支撑}
INPUT:P(0,0,1),N(25,10,99999),M(30,30,240),T(1,0,2);
{数据引用}
创业板:=INBLOCK('深圳创业');
中小企业:=INBLOCK('中小企业');
上证A股:=STRCMP(MARKETLABEL, 'SH')=0;
深证A股:=STRCMP(MARKETLABEL, 'SZ')=0;
上海基金:=INBLOCK('上海基金');
深圳基金:=INBLOCK('深圳基金');
开A:=STKINDI('','行情引用.开',0,6),LINETHICK;
高A:=STKINDI('','行情引用.高',0,6),LINETHICK;
低A:=STKINDI('','行情引用.低',0,6),LINETHICK;
收A:=STKINDI('','行情引用.收',0,6),LINETHICK;
昨A:=IF(上海基金=1,STKINDI('SH000011','行情引用.昨收',0,6),IF(深圳基金=1,STKINDI('399305','行情引用.昨收',0,6),IF(中小企业=1,STKINDI('399101','行情引用.昨收',0,6),IF(创业板=1,STKINDI('399102','行情引用.昨收',0,6),IF(上证A股=1,STKINDI('SH000001','行情引用.昨收',0,6),IF(深证A股=1,STKINDI('399001','行情引用.昨收',0,6),0)))))),LINETHICK;
前A:=IF(上海基金=1,STKINDI('SH000011','行情引用.前收',0,6),IF(深圳基金=1,STKINDI('399305','行情引用.前收',0,6),IF(中小企业=1,STKINDI('399101','行情引用.前收',0,6),IF(创业板=1,STKINDI('399102','行情引用.前收',0,6),IF(上证A股=1,STKINDI('SH000001','行情引用.前收',0,6),IF(深证A股=1,STKINDI('399001','行情引用.前收',0,6),0)))))),LINETHICK;
大盘阻力A:=IF(上海基金=1,STKINDI('SH000011','行情引用.昨日阻力',0,6),IF(深圳基金=1,STKINDI('399305','行情引用.昨日阻力',0,6),IF(中小企业=1,STKINDI('399101','行情引用.昨日阻力',0,6),IF(创业板=1,STKINDI('399102','行情引用.昨日阻力',0,6),IF(上证A股=1,STKINDI('SH000001','行情引用.昨日阻力',0,6),IF(深证A股=1,STKINDI('399001','行情引用.昨日阻力',0,6),0)))))),LINETHICK;
大盘支撑A:=IF(上海基金=1,STKINDI('SH000011','行情引用.昨日支撑',0,6),IF(深圳基金=1,STKINDI('399305','行情引用.昨日支撑',0,6),IF(中小企业=1,STKINDI('399101','行情引用.昨日支撑',0,6),IF(创业板=1,STKINDI('399102','行情引用.昨日支撑',0,6),IF(上证A股=1,STKINDI('SH000001','行情引用.昨日支撑',0,6),IF(深证A股=1,STKINDI('399001','行情引用.昨日支撑',0,6),0)))))),LINETHICK;
大盘突破A:=IF(上海基金=1,STKINDI('SH000011','行情引用.昨日突破',0,6),IF(深圳基金=1,STKINDI('399305','行情引用.昨日突破',0,6),IF(中小企业=1,STKINDI('399101','行情引用.昨日突破',0,6),IF(创业板=1,STKINDI('399102','行情引用.昨日突破',0,6),IF(上证A股=1,STKINDI('SH000001','行情引用.昨日突破',0,6),IF(深证A股=1,STKINDI('399001','行情引用.昨日突破',0,6),0)))))),LINETHICK;
大盘反转A:=IF(上海基金=1,STKINDI('SH000011','行情引用.昨日反转',0,6),IF(深圳基金=1,STKINDI('399305','行情引用.昨日反转',0,6),IF(中小企业=1,STKINDI('399101','行情引用.昨日反转',0,6),IF(创业板=1,STKINDI('399102','行情引用.昨日反转',0,6),IF(上证A股=1,STKINDI('SH000001','行情引用.昨日反转',0,6),IF(深证A股=1,STKINDI('399001','行情引用.昨日反转',0,6),0)))))),LINETHICK;
大盘M1A:=IF(上海基金=1,STKINDI('SH000011','行情引用.昨日M1',0,6),IF(深圳基金=1,STKINDI('399305','行情引用.昨日M1',0,6),IF(中小企业=1,STKINDI('399101','行情引用.昨日M1',0,6),IF(创业板=1,STKINDI('399102','行情引用.昨日M1',0,6),IF(上证A股=1,STKINDI('SH000001','行情引用.昨日M1',0,6),IF(深证A股=1,STKINDI('399001','行情引用.昨日M1',0,6),0)))))),LINETHICK;
大盘M2A:=IF(上海基金=1,STKINDI('SH000011','行情引用.昨日M2',0,6),IF(深圳基金=1,STKINDI('399305','行情引用.昨日M2',0,6),IF(中小企业=1,STKINDI('399101','行情引用.昨日M2',0,6),IF(创业板=1,STKINDI('399102','行情引用.昨日M2',0,6),IF(上证A股=1,STKINDI('SH000001','行情引用.昨日M2',0,6),IF(深证A股=1,STKINDI('399001','行情引用.昨日M2',0,6),0)))))),LINETHICK;
QOO:="行情引用.OO##DAY",LINETHICK;
QHH:="行情引用.HH##DAY",LINETHICK;
QLL:="行情引用.LL##DAY",LINETHICK;
//QZC:="行情引用.昨收##DAY",LINETHICK;
OO:=STKINDI('','行情引用.OO',0,6),LINETHICK;
HH:=STKINDI('','行情引用.HH',0,6),LINETHICK;
LL:=STKINDI('','行情引用.LL',0,6),LINETHICK;
CC:=STKINDI('','行情引用.CC',0,6),LINETHICK;
昨B:=STKINDI('','行情引用.昨收',0,6),LINETHICK;
前B:=STKINDI('','行情引用.前收',0,6),LINETHICK;
{大盘个股比例}
BLO:=IF(P>0,开A,QOO)/IF(P>0,昨A,昨B)/(OO/昨B),LINETHICK;{大盘开盘比例}
BLH:=IF(P>0,高A,QHH)/IF(P>0,昨A,昨B)/(HH/昨B),LINETHICK;{大盘最高比例}
BLL:=IF(P>0,低A,QLL)/IF(P>0,昨A,昨B)/(LL/昨B),LINETHICK;{大盘最低比例}
BLC:=IF(P>0,收A,昨B)/IF(P>0,昨A,昨B)/(CC/昨B),LINETHICK;{大盘收盘比例}
{模拟大盘数据}
开:BLO*OO,LINETHICK;
高:BLH*HH,LINETHICK;
低:BLL*LL,LINETHICK;
收:BLC*CC,LINETHICK;
{画背景图}{调节参数N确定背景高度}
//DRAWGBK(1,COLORRGB(100,100,100),COLORRGB(50,50,50),1);
DRAWTEXT(BARPOS=SYSPARAM(2),L,'创幻论坛の舍得快乐'),COLORFFFFCC,ALIGN5;
{画大盘K线}
点:=OPENMINUTES(TIME)=M OR OPENMINUTES(TIME)<M AND ISLASTBAR;
STICKLINE(收>开 AND 点,高,低,N,0),COLOR5DA8FE;
STICKLINE(收<开 AND 点,高,低,N,0),COLORBLUE;
STICKLINE(收>开 AND 点,收,开,10.6*N,0),COLOR00AAFF;
STICKLINE(收>开 AND 点,收,开,8.8*N,0),COLOR00BBFF;
STICKLINE(收>开 AND 点,收,开,5.86*N,0),COLOR00CCFF;
STICKLINE(收>开 AND 点,收,开,4.4*N,0),COLOR00DDFF;
STICKLINE(收>开 AND 点,收,开,2.9*N,0),COLOR00EEFF;
STICKLINE(收>开 AND 点,收,开,1.46*N,0),COLOR00FFFF;
STICKLINE(收<开 AND 点,收,开,10.6*N,0),COLORAA00BB;
STICKLINE(收<开 AND 点,收,开,8.8*N,0),COLORBB11BB;
STICKLINE(收<开 AND 点,收,开,5.86*N,0),COLORCC22BB;
STICKLINE(收<开 AND 点,收,开,4.4*N,0),COLORDD33BB;
STICKLINE(收<开 AND 点,收,开,2.9*N,0),COLOREE44BB;
STICKLINE(收<开 AND 点,收,开,1.46*N,0),COLORFF55BB;
STICKLINE(收=开 AND (收>昨A OR 收=昨A AND 昨A<前A) AND 点 AND 高>低,低,高,N,0),Color102099,LINETHICK2;
STICKLINE(收=开 AND (收<昨A OR 收=昨A AND 昨A>前A) AND 点 AND 高>低,低,高,N,0),COLOR808000,LINETHICK2;
STICKLINE(收=开 AND (收>昨A OR 收=昨A AND 昨A<前A) AND 点,收*0.9995,开*1.00095,10.6*N,0),COLORBROWN,LINETHICK2;
STICKLINE(收=开 AND (收<昨A OR 收=昨A AND 昨A>前A) AND 点,收*0.9995,开*1.00095,10.6*N,0),COLORGRAY,LINETHICK2;
{画个股K线}
STICKLINE(CC>OO AND 点,LL,HH,N,0),COLOR8080FF,SHIFT30;
STICKLINE(CC<OO AND 点,LL,HH,N,0),COLORFFFF00,SHIFT30;
STICKLINE(点,CC,OO,10.6*N,0),COLOR353500,SHIFT30;
STICKLINE(点,CC,OO,8.8*N,0),COLOR454500,SHIFT30;
STICKLINE(点,CC,OO,5.86*N,0),COLOR555500,SHIFT30;
STICKLINE(点,CC,OO,4.4*N,0),COLOR656500,SHIFT30;
STICKLINE(点,CC,OO,2.9*N,0),COLOR757500,SHIFT30;
STICKLINE(点,CC,OO,1.46*N,0),COLOR858500,SHIFT30;
STICKLINE(CC>OO AND 点,CC,OO,10.6*N,0),COLOR000045,SHIFT30;
STICKLINE(CC>OO AND 点,CC,OO,8.8*N,0),COLOR000065,SHIFT30;
STICKLINE(CC>OO AND 点,CC,OO,5.86*N,0),COLOR000085,SHIFT30;
STICKLINE(CC>OO AND 点,CC,OO,4.4*N,0),COLOR0000A5,SHIFT30;
STICKLINE(CC>OO AND 点,CC,OO,2.9*N,0),COLOR0000C5,SHIFT30;
STICKLINE(CC>OO AND 点,CC,OO,1.46*N,0),COLOR0000E5,SHIFT30;
////////////////十字影线
STICKLINE(CC=OO AND (CC>昨B OR CC=昨B AND 昨B<前B) AND 点 AND HH>LL,LL,HH,N,0),Color102099,LINETHICK2,SHIFT30;
STICKLINE(CC=OO AND (CC<昨B OR CC=昨B AND 昨B>前B) AND 点 AND HH>LL,LL,HH,N,0),COLOR808000,LINETHICK2,SHIFT30;
//////////一字上涨实体K线
STICKLINE(CC=OO AND (CC>昨B OR CC=昨B AND 昨B<前B) AND 点,CC*0.99995,OO*1.00095,10.6*N,0),Color0020FF,LINETHICK2,SHIFT30;
STICKLINE(CC=OO AND (CC>昨B OR CC=昨B AND 昨B<前B) AND 点,CC*0.99995,OO*1.00095,8.8*N,0),Color0042FF,LINETHICK2,SHIFT30;
STICKLINE(CC=OO AND (CC>昨B OR CC=昨B AND 昨B<前B) AND 点,CC*0.99995,OO*1.00095,5.86*N,0),Color0064FF,LINETHICK2,SHIFT30;
STICKLINE(CC=OO AND (CC>昨B OR CC=昨B AND 昨B<前B) AND 点,CC*0.99995,OO*1.00095,4.4*N,0),Color0086FF,LINETHICK2,SHIFT30;
STICKLINE(CC=OO AND (CC>昨B OR CC=昨B AND 昨B<前B) AND 点,CC*0.99995,OO*1.00095,2.9*N,0),Color00A8FF,LINETHICK2,SHIFT30;
//////////一字下跌实体K线
STICKLINE(CC=OO AND (CC<昨B OR CC=昨B AND 昨B>前B) AND 点,CC*0.99995,OO*1.00095,10.6*N,0),COLOR6B0059,LINETHICK2,SHIFT30;
STICKLINE(CC=OO AND (CC<昨B OR CC=昨B AND 昨B>前B) AND 点,CC*0.99995,OO*1.00095,8.8*N,0),Color8D0059,LINETHICK2,SHIFT30;
STICKLINE(CC=OO AND (CC<昨B OR CC=昨B AND 昨B>前B) AND 点,CC*0.99995,OO*1.00095,5.86*N,0),ColorAF0059,LINETHICK2,SHIFT30;
STICKLINE(CC=OO AND (CC<昨B OR CC=昨B AND 昨B>前B) AND 点,CC*0.99995,OO*1.00095,4.4*N,0),ColorD10059,LINETHICK2,SHIFT30;
STICKLINE(CC=OO AND (CC<昨B OR CC=昨B AND 昨B>前B) AND 点,CC*0.99995,OO*1.00095,2.9*N,0),ColorF30059,LINETHICK2,SHIFT30;
//BI:=IF(昨B-LL>HH-昨B,LL,昨B-(HH-昨B));
DRAWTEXT(OPENMINUTES(TIME)=1 AND P=0,C,'叠加【个股】【上周期 + 当周期日K线】'),COLORFFFFCC,ALIGN5,PXUP30;
DRAWTEXT(OPENMINUTES(TIME)=1 AND P=1,C,'叠加【个股 + 对应大盘】【当周期日K线】'),COLORCCFFFF,ALIGN5,PXUP30;
{阻力、支撑、突破、反转}
IF T>0 THEN BEGIN
阻力:STKINDI('','行情引用.阻力',0,6),LINETHICK;
支撑:STKINDI('','行情引用.支撑',0,6),LINETHICK;
突破:STKINDI('','行情引用.突破',0,6),LINETHICK;
反转:STKINDI('','行情引用.反转',0,6),LINETHICK;
M1:"行情引用.M1#DAY",LINETHICK,COLORWHITE;
M2:"行情引用.M2#DAY",LINETHICK,COLORYELLOW;
BL阻力:=大盘阻力A/昨A/(阻力/昨B);
BL支撑:=大盘支撑A/昨A/(支撑/昨B);
BL突破:=大盘突破A/昨A/(突破/昨B);
BL反转:=大盘反转A/昨A/(反转/昨B);
BLM1:=大盘M1A/昨A/(M1/昨B);
BLM2:=大盘M2A/昨A/(M2/昨B);
大盘阻力:=BL阻力*阻力,LINETHICK;
大盘支撑:=BL支撑*支撑,LINETHICK;
大盘突破:=BL突破*突破,LINETHICK;
大盘反转:=BL反转*反转,LINETHICK;
大盘M1:=BLM1*M1,LINETHICK;
大盘M2:=BLM2*M2,LINETHICK;
昨日阻力:=IF(P=0,"行情引用.阻力##DAY",大盘阻力),LINETHICK;
昨日支撑:=IF(P=0,"行情引用.支撑##DAY",大盘支撑),LINETHICK;
昨日突破:=IF(P=0,"行情引用.突破##DAY",大盘突破),LINETHICK;
昨日反转:=IF(P=0,"行情引用.反转##DAY",大盘反转),LINETHICK;
昨日M1:=IF(P=0,"行情引用.M1##DAY",大盘M1),LINETHICK,COLORWHITE;
昨日M2:=IF(P=0,"行情引用.M2##DAY",大盘M2),LINETHICK,COLORYELLOW;
{画线}
DRAWLINE(OPENMINUTES(TIME)=1,突破,CROSS(C,突破) AND DATATYPE=-1,突破,1),LINEDASH;
DRAWLINE(OPENMINUTES(TIME)=1,反转,CROSS(反转,C) AND DATATYPE=-1,反转,1),LINEDASH;
DRAWLINE(OPENMINUTES(TIME)=1,阻力,CROSS(C,阻力) AND DATATYPE=-1,阻力,1),LINEDASH;
DRAWLINE(OPENMINUTES(TIME)=1,支撑,CROSS(支撑,C) AND DATATYPE=-1,支撑,1),LINEDASH;
STICKLINE(点,阻力,阻力,8.6*N,0),LINETHICK2,SHIFT30,COLOR808000;
STICKLINE(点,支撑,支撑,8.6*N,0),LINETHICK2,SHIFT30,COLOR8000FF;
STICKLINE(点,突破,突破,8.6*N,0),LINETHICK2,SHIFT30,COLOR00FF80;
STICKLINE(点,反转,反转,8.6*N,0),LINETHICK2,SHIFT30,ColorFF6400;
STICKLINE(点,M1,M1,8.6*N,0),LINETHICK2,SHIFT30,COLORFFFFCC;
STICKLINE(点,M2,M2,8.6*N,0),LINETHICK2,SHIFT30,COLORYELLOW;
DRAWTEXT(点,阻力,'↖阻力 '+NUMTOSTR(阻力,2)),SHIFT50,COLOR808000;
DRAWTEXT(点,支撑,'↖支撑 '+NUMTOSTR(支撑,2)),SHIFT50,COLOR8000FF;
DRAWTEXT(点,突破,'↖突破 '+NUMTOSTR(突破,2)),SHIFT50,COLOR00FF80;
DRAWTEXT(点,反转,'↖反转 '+NUMTOSTR(反转,2)),SHIFT50,ColorFF6400;
DRAWTEXT(点,M1,NUMTOSTR(M1,2)+' M1↗'),SHIFT20,COLORFFFFCC,ALIGN2;
DRAWTEXT(点,M2,NUMTOSTR(M2,2)+' M2↗'),SHIFT20,COLORYELLOW,ALIGN2;
END
ELSE
STICKLINE(T>1 AND 点,昨日阻力,昨日阻力,8.6*N,0),LINETHICK2,COLOR808000;
STICKLINE(T>1 AND 点,昨日支撑,昨日支撑,8.6*N,0),LINETHICK2,COLOR8000FF;
STICKLINE(T>1 AND 点,昨日突破,昨日突破,8.6*N,0),LINETHICK2,COLOR00FF80;
STICKLINE(T>1 AND 点,昨日反转,昨日反转,8.6*N,0),LINETHICK2,ColorFF6400;
STICKLINE(T>1 AND 点,昨日M1,昨日M1,8.6*N,0),LINETHICK2,COLORFFFFCC;
STICKLINE(T>1 AND 点,昨日M2,昨日M2,8.6*N,0),LINETHICK2,COLORYELLOW;












 


[url=http://www.goodgupiao.com/gupiaogongshi/22284.html][B]分时界面叠加两日k线公式(调整参数可以叠加对应大盘K线+个股当日K线)[/B][/url]