未来函数检测结果如下:
该公式包含未来函数:BACKSET
指标源码:
原理解析:
SJ赋值:1
输出两种共振信号:0,NODRAW,COLORFFFFFF
输出画线加背离多空:0,NODRAW,COLORFFFFFF
输出画线加多空:0,NODRAW,COLORFFFFFF
DIFF8赋值:(CLOSE的12日指数移动平均*SJ - CLOSE的26日指数移动平均*SJ)
DEA8赋值:DIFF8的9日指数移动平均*SJ
MACD28赋值:(2 * (DIFF8 - DEA8))*SJ,COLORSTICK
DRAWBAND(DIFF8,RGB(200,50,55),DEA8,RGB(50,100,10))
输出NOTEXTSDIFF:DIFF8,画白色
输出NOTEXTSDEA:DEA8,COLORYELLOW
输出DIFF:(CLOSE的12日指数移动平均*SJ-CLOSE的26日指数移动平均*SJ),COLORFFFFFF
输出DEA:DIFF的9日指数移动平均*SJ,COLOR00FFFF
输出MACD2:(2 * (DIFF - DEA))*SJ,COLORSTICK
J赋值:DIFF上穿DEA
S赋值:DEA上穿DIFF
JC:=COUNT(J,上次DIFF>0&&DEA>0上穿0.5距今天数)=1&&J
SC:=COUNT(S,上次0.5上穿DIFF>0&&DEA>0距今天数)=1&&S
JC2:=COUNT(S,上次0.5上穿DIFF>0&&DEA>0距今天数)=2&&S
SC2:=COUNT(J,上次DIFF>0&&DEA>0上穿0.5距今天数)=2&&J
N1赋值:SUMBARS(DEA上穿DIFF,1)
N2赋值:SUMBARS(DIFF上穿DEA,1)
DRAWTEXT(N2=1&&N1>5&&N1<=13*SJ&&DIFF>0&&DEA*SJ>0 最近N1日一直存在&&JC,DIFF,'多'),画红色
M赋值:SUMBARS((DIFF<0&&0上穿DEA)||(0上穿DIFF&&DEA<0),1)
M1:=SUMBARS(DIFF上穿DEA,1)
M2:=SUMBARS(DEA上穿DIFF,1)
DRAWTEXT(M2=1&&M1*SJ>5&&M1<=13*SJ&&DIFF<0&&DEA<0最近N2日一直存在 &&SC,DIFF,'空'),画绿色
NDTJ赋值:SUMBARS(N2=1&&N1>5&&N1<=13&&DIFF>0&&DEA>0最近N1日一直存在,1)
NKTJ赋值:SUMBARS(M2=1&&M1>5&&M1<=13&&DIFF<0&&DEA<0最近N2日一直存在,1)
{DRAWTEXT(NDTJ<=4*SJ&&DEA上穿DIFF AND JC2,DIFF,'风险'),画红色
DRAWTEXT(NKTJ<=4*SJ&&DIFF上穿DEA AND SC2,DIFF,'风险'),画绿色
}
JC222:=DIFF上穿DEA
SC222:=DEA上穿DIFF
N133:=上次JC222距今天数+1
N233:=上次SC222距今天数+1
HH赋值:REF(N133日内H最高值,N233)
HH2:=1日前的HH,N233)
MHD:=VALUEWHEN(SC222,N133日内DIFF最高值)
MHD2:=VALUEWHEN(SC222,1日前的MHD)
LL赋值:REF(N233日内L最低值,N133)
LL2:=1日前的LL,N133)
MLD:=VALUEWHEN(JC222,N233日内DIFF最低值)
MLD2:=VALUEWHEN(JC222,1日前的MLD)
A赋值:MACD<0&&HH>HH2&&MHD
A1:=BACKSET(A上穿0.5,REF(HHVBARS(DIFF,N133),1)+1+1)
A2:=BACKSET(A上穿0.5,REF(HHVBARS(DIFF,N133),SC222累加至2的天数)+SC222累加至2的天数+1)
B1:=BACKSET(B上穿0.5,REF(LLVBARS(DIFF,N233),1)+1+1)
B2:=BACKSET(B上穿0.5,REF(LLVBARS(DIFF,N233),JC222累加至2的天数)+JC222累加至2的天数+1)
DRAWLINE(A2上穿0.5,DIFF,A1上穿0.5,DIFF,0),画红色,LINETHICK2
DRAWLINE(B2上穿0.5,DIFF,B1上穿0.5,DIFF,0),画绿色,LINETHICK2
VAR6:=(2*CLOSE+最高价+最低价)/4
VAR8:=20日内最低价最低值
VARAA赋值:26日内最高价最高值
B8:=EMA((VAR6-VAR8)/(VARAA-VAR8)*100,8)
B18:=B8的5日指数移动平均
K22赋值:B8>80 AND B18上穿B8
K1赋值:上次K22距今天数
K2赋值:1日前的K1
K底赋值:B8<20 AND B8上穿B18
K底1:=上次K底距今天数
K底2:=1日前的K底1
DRAWTEXT(1日前的B8*SJ>80 AND B18上穿B8 AND 1日前的B8
DRAWTEXT(B8<25*SJ AND B8上穿B18 AND B8>K底2日前的B8 AND C