网友求助:
请老师写个公式
通达信软件
设想:最新一天的交易日,K线图,K线下方显示为1(如图)
往后数,顺序依次为:1,5,10,20,30,60,120,240,显示周期为任意周期!!
解答如下:
如果一定要历史信号,这样
A:=REF(C,BARSLAST(CURRBARSCOUNT=10));
B:=CURRBARSCOUNT=5 AND C/A>=0.99 AND C/A<=1.01;
DRAWICON(B,L*0.99,11);
DRAWNUMBER(CURRBARSCOUNT<=20,L,CURRBARSCOUNT),COLORYELLOW;
DRAWNUMBER(CURRBARSCOUNT=10,L,CURRBARSCOUNT),COLORMAGENTA;
DRAWNUMBER(CURRBARSCOUNT=5,L,CURRBARSCOUNT),COLORMAGENTA;
D:=BARSLAST(MOD(CURRBARSCOUNT,5)=0);
E:=C/REF(REF(C,D),1)*100-100;
F:=ABS(E)<=1 AND D=0 AND CURRBARSCOUNT>=10;
DRAWICON(F,L*0.99,11);