赢在起点主图中长线趋势指标源码分享
现手买:=BUYVOL*DYNAINFO(7)*100/10000 COLOR0000FF,NODRAW;
现手卖:=SELLVOL*DYNAINFO(7)*100/10000 COLOR00FF00,NODRAW;
合:=ABS(现手买)+ABS(现手卖)COLOR80FFFF,NODRAW;
差:=ABS(现手买)-ABS(现手卖)COLOR80FFFF,NODRAW;
MPB1:=ABS(现手买)/合*100;
MPB2:=ABS(现手卖)/合*100;
TESTSKIP(NOT(现手买 OR 现手卖 OR 合 OR 差 OR MPB1 OR MPB2)!=0);
{}
N:=C;
A:=N;
S:=5;
B:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+14*REF(A,6)
+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8*REF(A,12)
+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+
REF(A,20))/210,COLORRED,LINETHICK1;
D07:=EMA(B,1*S),COLORRED,LINETHICK1;
D14:=EMA(B,2*S),COLORRED,LINETHICK1;
D21:=EMA(B,3*S),COLORRED,LINETHICK1;
D28:=EMA(B,4*S),COLORRED,LINETHICK1;
大值:=MAX(B,MAX(D07,MAX(D14,MAX(D21,D28))));
小值:=MIN(B,MIN(D07,MIN(D14,MIN(D21,D28))));
UB:=EMA(大值*1.09,5);
LB:=EMA(小值*0.91,5);
X1:=IF(B>小值,小值,DRAWNULL);
X2:=IF(B<大值,大值,DRAWNULL);
STICKLINE(B=大值,UB,LB,5,0),COLORFF0000;
STICKLINE(B=小值,UB,LB,5,0),COLORLICYAN;
STICKLINE(B<大值 AND B>小值,UB,LB,5,0),COLOR888888;
DRAWBAND(X1,RGB(80,180,80),B,RGB(200,0,128));
DRAWBAND(X2,RGB(80,180,80),B,RGB(200,0,128));
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
{显示买卖量};
DRAWRECTREL(100,1000,400,940,RGB(190,190,190));
DRAWRECTREL(100,995,400,945,RGB(200,200,200));
DRAWRECTREL(100,990,400,950,RGB(210,210,210));
DRAWRECTREL(100,985,400,955,RGB(220,220,220));
DRAWRECTREL(100,980,400,960,RGB(230,230,230));
DRAWRECTREL(100,975,400,965,RGB(240,240,240));
DRAWRECTREL(100,970,400,970,RGB(250,250,250));
DRAWRECTREL(250-现手卖*200/合,1000,250,940,RGB(0,128,0));
DRAWRECTREL(250-现手卖*200/合,995,250,945,RGB(0,148,0));
DRAWRECTREL(250-现手卖*200/合,990,250,950,RGB(0,168,0));
DRAWRECTREL(250-现手卖*200/合,985,250,955,RGB(0,188,0));
DRAWRECTREL(250-现手卖*200/合,980,250,960,RGB(0,208,0));
DRAWRECTREL(250-现手卖*200/合,975,250,965,RGB(0,228,0));
DRAWRECTREL(250-现手卖*200/合,970,250,970,RGB(0,248,0));
DRAWRECTREL(250,1000,250+现手买*200/合,940,RGB(128,0,0));
DRAWRECTREL(250,995,250+现手买*200/合,945,RGB(148,0,0));
DRAWRECTREL(250,990,250+现手买*200/合,950,RGB(168,0,0));
DRAWRECTREL(250,985,250+现手买*200/合,955,RGB(188,0,0));
DRAWRECTREL(250,980,250+现手买*200/合,960,RGB(208,0,0));
DRAWRECTREL(250,975,250+现手买*200/合,965,RGB(228,0,0));
DRAWRECTREL(99.8,1000.2,99.8,939.8,RGB(250,250,0));{左}
DRAWRECTREL(400.2,939.8,400.2,1000.2,RGB(250,250,0));{右}
DRAWRECTREL(99.8,939.8,400.2,939.8,RGB(250,250,0));{上}
DRAWRECTREL(250,1000,250,940,RGB(250,250,0));{中}
DRAWTEXT_FIX(1,0.38,0.9,0,STRCAT(STRCAT('',CON2STR(现手买,1)),'万')),COLORFF00FF;
DRAWTEXT_FIX(1,0.08,0.9,0,STRCAT(STRCAT('',CON2STR(现手卖,1)),'万')),COLORFFFF00;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(差)>0,0.21,0.9,0,STRCAT(' ',STRCAT(CON2STR(差,1),'万'))) COLORFF00FF;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(差)<0,0.21,0.9,0,STRCAT(' ',STRCAT(CON2STR(差,1),'万'))) COLOR00FFFF;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(差)=0,0.21,0.9,0,STRCAT(' ',STRCAT(CON2STR(差,1),'万'))) COLORFFFF00;
DRAWTEXT_FIX(1,0.048,0.95,0,STRCAT(STRCAT(' ',CON2STR(MPB2,1)),'%%')),COLORFFFF00;
DRAWTEXT_FIX(1,0.408,0.95,0,STRCAT(STRCAT('',CON2STR(MPB1,1)),'%%')),COLORFF00FF;
{显示日期};
D1:=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,'六','日')))))));
AA5:=STRCAT(STRCAT(STRCAT(AA1,AA2),STRCAT(AA3,AA4)),'】');
DRAWTEXT_FIX(D1,0.7,0.95,0,AA5),COLORFFFF00;
未来函数检测结果如下:
该公式包含未来函数:DYNAINFO
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
现手买赋值:BUY成交量*DYNAINFO(7)*100/10000 COLOR0000FF,NODRAW
现手卖赋值:SELL成交量*DYNAINFO(7)*100/10000 COLOR00FF00,NODRAW
合赋值:现手买的绝对值+ABS(现手卖)COLOR80FFFF,NODRAW
差赋值:现手买的绝对值-ABS(现手卖)COLOR80FFFF,NODRAW
MPB1赋值:现手买的绝对值/合*100
MPB2赋值:现手卖的绝对值/合*100
TESTSKIP(NOT(现手买 OR 现手卖 OR 合 OR 差 OR MPB1 OR MPB2)!=0)
{}
N赋值:C
A赋值:N
S赋值:5
B赋值:(20*A+19*1日前的A+18*2日前的A+17*3日前的A+16*4日前的A+15*5日前的A+14*6日前的A
+13*7日前的A+12*8日前的A+11*9日前的A+10*10日前的A+9*11日前的A+8*12日前的A
+7*13日前的A+6*14日前的A+5*15日前的A+4*16日前的A+3*17日前的A+2*18日前的A+
20日前的A)/210,画红色,LINETHICK1
D07赋值:B的1*S日指数移动平均,画红色,LINETHICK1
D14赋值:B的2*S日指数移动平均,画红色,LINETHICK1
D21赋值:B的3*S日指数移动平均,画红色,LINETHICK1
D28赋值:B的4*S日指数移动平均,画红色,LINETHICK1
大值赋值:MAX(B,MAX(D07,MAX(D14,MAX(D21,D28))))
小值赋值:MIN(B,MIN(D07,MIN(D14,MIN(D21,D28))))
UB赋值:大值*1.09的5日指数移动平均
LB赋值:小值*0.91的5日指数移动平均
如果B>小值返回小值否则返回DRAWNULL
如果B<大值返回大值否则返回DRAWNULL
当满足条件B=大值时,在UB和LB之间画柱状线
当满足条件B=小值时,在UB和LB之间画柱状线
当满足条件B<大值 AND B>小值时,在UB和LB之间画柱状线
DRAWBAND(X1,RGB(80,180,80),B,RGB(200,0,128))
DRAWBAND(X2,RGB(80,180,80),B,RGB(200,0,128))
DRAWKLINE(最高价,开盘价,最低价,CLOSE)
{显示买卖量}
DRAWRECTREL(100,1000,400,940,RGB(190,190,190))
DRAWRECTREL(100,995,400,945,RGB(200,200,200))
DRAWRECTREL(100,990,400,950,RGB(210,210,210))
DRAWRECTREL(100,985,400,955,RGB(220,220,220))
DRAWRECTREL(100,980,400,960,RGB(230,230,230))
DRAWRECTREL(100,975,400,965,RGB(240,240,240))
DRAWRECTREL(100,970,400,970,RGB(250,250,250))
DRAWRECTREL(250-现手卖*200/合,1000,250,940,RGB(0,128,0))
DRAWRECTREL(250-现手卖*200/合,995,250,945,RGB(0,148,0))
DRAWRECTREL(250-现手卖*200/合,990,250,950,RGB(0,168,0))
DRAWRECTREL(250-现手卖*200/合,985,250,955,RGB(0,188,0))
DRAWRECTREL(250-现手卖*200/合,980,250,960,RGB(0,208,0))
DRAWRECTREL(250-现手卖*200/合,975,250,965,RGB(0,228,0))
DRAWRECTREL(250-现手卖*200/合,970,250,970,RGB(0,248,0))
DRAWRECTREL(250,1000,250+现手买*200/合,940,RGB(128,0,0))
DRAWRECTREL(250,995,250+现手买*200/合,945,RGB(148,0,0))
DRAWRECTREL(250,990,250+现手买*200/合,950,RGB(168,0,0))
DRAWRECTREL(250,985,250+现手买*200/合,955,RGB(188,0,0))
DRAWRECTREL(250,980,250+现手买*200/合,960,RGB(208,0,0))
DRAWRECTREL(250,975,250+现手买*200/合,965,RGB(228,0,0))
DRAWRECTREL(99.8,1000.2,99.8,939.8,RGB(250,250,0))
{左}
DRAWRECTREL(400.2,939.8,400.2,1000.2,RGB(250,250,0))
{右}
DRAWRECTREL(99.8,939.8,400.2,939.8,RGB(250,250,0))
{上}
DRAWRECTREL(250,1000,250,940,RGB(250,250,0))
{中}
DRAWTEXT_FIX(1,0.38,0.9,0,STRCAT(STRCAT('',CON2STR(现手买,1)),'万')),COLORFF00FF
DRAWTEXT_FIX(1,0.08,0.9,0,STRCAT(STRCAT('',CON2STR(现手卖,1)),'万')),COLORFFFF00
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(差)>0,0.21,0.9,0,STRCAT(' ',STRCAT(CON2STR(差,1),'万'))) COLORFF00FF
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(差)<0,0.21,0.9,0,STRCAT(' ',STRCAT(CON2STR(差,1),'万'))) COLOR00FFFF
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(差)=0,0.21,0.9,0,STRCAT(' ',STRCAT(CON2STR(差,1),'万'))) COLORFFFF00
DRAWTEXT_FIX(1,0.048,0.95,0,STRCAT(STRCAT(' ',CON2STR(MPB2,1)),'%%')),COLORFFFF00
DRAWTEXT_FIX(1,0.408,0.95,0,STRCAT(STRCAT('',CON2STR(MPB1,1)),'%%')),COLORFF00FF
{显示日期}
D1赋值: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,'六','日')))))))
AA5:=STRCAT(STRCAT(STRCAT(AA1,AA2),STRCAT(AA3,AA4)),'】')
当满足条件D1时,在横轴0.7纵轴0.95位置书写文字