非常准的【红进绿出】主图指标 通达信
年:=YEAR,NODRAW;
月:=MONTH,NODRAW;
星期:=WEEKDAY,NODRAW;
日1:=DATETODAY(DATE);
上市日:=REF(DATE,TOTALBARSCOUNT-CURRBARSCOUNT);
自然日:=日1-DATETODAY(上市日)+1;
ZB:=(自然日-REF(自然日,1))!=星期-REF(星期,1)
OR TOTALBARSCOUNT-CURRBARSCOUNT=0;
本周第几天:(BARSLAST(ZB)+1),NODRAW;
本月第几天:=BARSLAST(年*100+月!=REF(年*100+月,1))+1;
MA1:=REF(C,本周第几天);
MA2:=REF(MA1,本周第几天);
MA3:=REF(MA2,本周第几天);
MA4:=REF(MA3,本周第几天);
五周价:(C+MA1+MA2+MA3+MA4)/5,COLORFF48AA,NODRAW;
五周线:=REFDATE(五周价,DATE);
STICKLINE(ISLASTBAR AND 五周价,五周线,五周线,200,1),COLORFF00AA;{参考线}
五日:MA(C,5),COLORGREEN,LINETHICK2;
IF(C>=MA(C,5),MA(C,5),DRAWNULL),COLORRED,LINETHICK4;
涨停:ZTPRICE(REF(C,1),0.1),COLORYELLOW,NODRAW;跌停:DTPRICE(REF(C,1),0.1),COLORGREEN,NODRAW;
止赢:REF(C,1)*1.02,COLORFF00FF,NODRAW;止损:REF(C,1)*0.98,COLORGREEN,NODRAW;
STICKLINE(C>=MA(C,5) AND O>=C,C,O,-1,0),COLORRED;
STICKLINE(C>=MA(C,5) AND O>=C,L,H,0,0),COLORRED;
STICKLINE(C<=MA(C,5) AND O<=C,O,C,-1,1),COLORCYAN;
STICKLINE(C<=MA(C,5) AND O<=C,O,L,0,1),COLORCYAN;
STICKLINE(C<=MA(C,5) AND O<=C,C,H,0,1),COLORCYAN;
{财务板块}
DRAWTEXT_FIX(1,0,0.02,0,'市盈率:'),COLORYELLOW;
DRAWNUMBER_FIX(1,0.05,0.02,0,CONST(DYNAINFO(39))),COLORYELLOW;
DRAWTEXT_FIX(1,0.11,0.02,0,'市净率:'),COLOR0080FF;
DRAWNUMBER_FIX(1,0.16,0.02,0,CONST(C/FINANCE(34))),COLOR0080FF;
DRAWTEXT_FIX(1,0.21,0.02,0,'每股收益(元):'),COLORFF00FF;
DRAWNUMBER_FIX(1,0.3,0.02,0,CONST(FINANCE(33))),COLORFF00FF;
Z1:=STRCAT(HYBLOCK,' ');
Z2:=STRCAT(Z1,DYBLOCK);
Z3:=STRCAT(Z2,' ');
DRAWTEXT_FIX(ISLASTBAR,0.98,1,1,STRCAT(Z3,GNBLOCK)),COLORYELLOW;
未来函数检测结果如下:
该公式包含未来函数:DYNAINFO
该公式包含未来函数:FINANCE
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
年赋值:YEAR,NODRAW
月赋值:MONTH,NODRAW
星期赋值:WEEKDAY,NODRAW
日1赋值:DATETODAY(DATE)
上市日赋值:TOTALBARSCOUNT- 到最后交易的周期日前的DATE
自然日赋值:日1-DATETODAY(上市日)+1
ZB赋值:(自然日-1日前的自然日)!=星期-1日前的星期
OR TOTALBARSCOUNT- 到最后交易的周期=0
输出
本周第几天:(上次ZB距今天数+1),NODRAW
本月第几天赋值:上次年*100+月!=1日前的年*100+月距今天数+1
MA1赋值:本周第几天日前的C
MA2赋值:本周第几天日前的MA1
MA3赋值:本周第几天日前的MA2
MA4赋值:本周第几天日前的MA3
输出
五周价:(C+MA1+MA2+MA3+MA4)/5,COLORFF48AA,NODRAW
五周线赋值:REFDATE(五周价,DATE)
当满足条件ISLASTBAR AND 五周价时,在五周线和五周线之间画柱状线
输出{参考线}
五日:C的5日简单移动平均,画绿色, 线宽为2
IF(C>=C的5日简单移动平均,C的5日简单移动平均,DRAWNULL),画红色,LINETHICK4
输出
涨停:ZTPRICE(1日前的C,0.1),画黄色,NODRAW
输出跌停:DTPRICE(1日前的C,0.1),画绿色,NODRAW
输出
止赢:1日前的C*1.02,COLORFF00FF,NODRAW
输出止损:1日前的C*0.98,画绿色,NODRAW
STICKLINE(C>=C的5日简单移动平均 AND O>=C,C,O,-1,0),画红色
STICKLINE(C>=C的5日简单移动平均 AND O>=C,L,H,0,0),画红色
STICKLINE(C<=C的5日简单移动平均 AND O<=C,O,C,-1,1),画青色
STICKLINE(C<=C的5日简单移动平均 AND O<=C,O,L,0,1),画青色
STICKLINE(C<=C的5日简单移动平均 AND O<=C,C,H,0,1),画青色
当满足条件1时,在横轴0纵轴0.02位置书写文字
DRAWNUMBER_FIX(1,0.05,0.02,0,CONST(DYNAINFO(39))),画黄色
当满足条件1时,在横轴0.11纵轴0.02位置书写文字
DRAWNUMBER_FIX(1,0.16,0.02,0,CONST(C/FINANCE(34))),COLOR0080FF
输出
DRAWTEXT_FIX(1,0.21,0.02,0,'每股收益(元):'),COLORFF00FF
DRAWNUMBER_FIX(1,0.3,0.02,0,CONST(FINANCE(33))),COLORFF00FF
Z1赋值:STRCAT(HYBLOCK,' ')
Z2赋值:STRCAT(Z1,DYBLOCK)
Z3赋值:STRCAT(Z2,' ')
DRAWTEXT_FIX(ISLASTBAR,0.98,1,1,STRCAT(Z3,GNBLOCK)),画黄色