通达信铁血乾坤
{铁血乾坤 }
P:=3;
DRAWGBK(C>0,RGB(0,0,155),RGB(0,0,60),0,' ',0);
DRAWRECTREL(500,0,1000,982,RGB(0,0,155));
DRAWRECTREL(500,187.6,1000,794.4,RGB(0,55,5));
DRAWRECTREL(500,375.1,1000,606.9,RGB(0,5,55));
DRAWRECTREL(500,491,1000,491,RGB(255,00,00));
MA(C,7),COLORMAGENTA,LINETHICK2;
IF(MA(C,7)<REF(MA(C,7),1),MA(C,7),DRAWNULL),COLORLIGREEN,LINETHICK2;
DRAWBAND(MA(C,2),RGB(80,0,80),MA(C,7),RGB(0,80,0));
B1:=REF(C,1);
B2:=REF(C,2);
SS:=IF(C>REF(C,1) AND REF(C,1)>=REF(C,2),1,
IF(C>REF(C,2) AND REF(C,2)>REF(C,1),2,
IF(C<REF(C,1) AND REF(C,1)<=REF(C,2),-1,
IF(C<REF(C,2) AND REF(C,2)<REF(C,1),-2,0))));
SM:=IF(REF(SS,1)=0,REF(SS,1),
IF(REF(SS,2)=0,REF(SS,2),
IF(REF(SS,3)=0,REF(SS,3),
IF(REF(SS,5)=0,REF(SS,5),
IF(REF(SS,6)=0,REF(SS,6),
IF(REF(SS,7)=0,REF(SS,7),0))))));
STICKLINE(CLOSE>OPEN OR CLOSE=OPEN AND CLOSE>REF(CLOSE,1),LOW,HIGH,0.0,0),COLORRED;
STICKLINE(CLOSE>OPEN OR CLOSE=OPEN AND CLOSE>REF(CLOSE,1),OPEN,CLOSE,0,0),COLORRED;
STICKLINE(CLOSE<OPEN OR CLOSE=OPEN AND CLOSE<=REF(CLOSE,1),LOW,HIGH,0.0,0),COLORCYAN;
STICKLINE(CLOSE<OPEN OR CLOSE=OPEN AND CLOSE<=REF(CLOSE,1),OPEN,CLOSE,0,0),COLORCYAN;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,2.5,0 ),COLOR006600;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,2,0 ),COLOR00CC00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,0,0 ),COLOR00FF00;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2.5,0) ,COLOR000066;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2,0) ,COLOR0000CC;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,0,0) ,COLOR0000FF;
STICKLINE(SS=1 OR (SM>=1 AND SS=0),B1,C,2.5,0),COLOR0099FF;
STICKLINE(SS=2,B2,C,2.5,0),COLOR0099FF;
STICKLINE((SS=-1 OR SS=-2) AND SM>0,B2,B1,2.5,0),COLOR0099FF;
HH:=CONST(HHV(H,120));
LH:=CONST(LLV(H,120));
WN:=P;{原码 N:=3;}
WA1:=REF(H,WN)=HHV(H,2*WN+1); WB1:=FILTER(WA1,WN);
WC1:=BACKSET(WB1,WN+1);
WD1:=FILTER(WC1,WN);{高点}
WA2:=REF(L,WN)=LLV(L,2*WN+1); WB2:=FILTER(WA2,WN);
WC2:=BACKSET(WB2,WN+1);
WD2:=FILTER(WC2,WN);{低点}
WR1:=BACKSET(ISLASTBAR,BARSLAST(WD1)+1); WS1:=WR1>REF(WR1,1); {前一高}
WT1:=BACKSET(ISLASTBAR,BARSLAST(WD2)+1); WU1:=WT1>REF(WT1,1); {前一低}
WR2:=BACKSET(WS1,REF(BARSLAST(WD1),1)+2); WS2:=WR2>REF(WR2,1); {前二高}
WT2:=BACKSET(WU1,REF(BARSLAST(WD2),1)+2); WU2:=WT2>REF(WT2,1); {前二低}
WR3:=BACKSET(WS2,REF(BARSLAST(WD1),1)+2); WS3:=WR3>REF(WR3,1); {前三高}
WT3:=BACKSET(WU2,REF(BARSLAST(WD2),1)+2); WU3:=WT3>REF(WT3,1); {前三低}
WR4:=BACKSET(WS3,REF(BARSLAST(WD1),1)+2); WS4:=WR4>REF(WR4,1); {前四高}
WT4:=BACKSET(WU3,REF(BARSLAST(WD2),1)+2); WU4:=WT4>REF(WT4,1); {前四高};
未来函数检测结果如下:
该公式包含未来函数:BACKSET
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
{铁血乾坤 }
P赋值:3
填充背景(C>0,RGB(0,0,155),RGB(0,0,60),0,' ',0)
DRAWRECTREL(500,0,1000,982,RGB(0,0,155))
DRAWRECTREL(500,187.6,1000,794.4,RGB(0,55,5))
DRAWRECTREL(500,375.1,1000,606.9,RGB(0,5,55))
DRAWRECTREL(500,491,1000,491,RGB(255,00,00))
C的7日简单移动平均,画洋红色, 线宽为2
IF(C的7日简单移动平均[
DRAWBAND(C的2日简单移动平均,RGB(80,0,80),C的7日简单移动平均,RGB(0,80,0))]
B1赋值:1日前的C
B2赋值:2日前的C
SS赋值:IF(C>1日前的C AND 1日前的C>=2日前的C,1,
IF(C>2日前的C AND 2日前的C>1日前的C,2,
IF(C<1日前的C AND 1日前的C<=2日前的C,-1,
IF(C<2日前的C AND 2日前的C<1日前的C,-2,0))))
SM赋值:IF(1日前的SS=0,1日前的SS,
IF(2日前的SS=0,2日前的SS,
IF(3日前的SS=0,3日前的SS,
IF(5日前的SS=0,5日前的SS,
IF(6日前的SS=0,6日前的SS,
IF(7日前的SS=0,7日前的SS,0))))))
STICKLINE(收盘价>开盘价 OR 收盘价=开盘价 AND 收盘价>1日前的收盘价,最低价,最高价,0.0,0),画红色
STICKLINE(收盘价>开盘价 OR 收盘价=开盘价 AND 收盘价>1日前的收盘价,开盘价,收盘价,0,0),画红色
STICKLINE(收盘价<开盘价 OR 收盘价=开盘价 AND 收盘价<=1日前的收盘价,最低价,最高价,0.0,0),画青色
STICKLINE(收盘价<开盘价 OR 收盘价=开盘价 AND 收盘价<=1日前的收盘价,开盘价,收盘价,0,0),画青色
当满足条件开盘价>=收盘价 时,在收盘价 和开盘价之间画柱状线
当满足条件开盘价>=收盘价 时,在收盘价 和开盘价之间画柱状线
当满足条件开盘价>=收盘价 时,在收盘价 和开盘价之间画柱状线
当满足条件收盘价>开盘价时,在收盘价和开盘价之间画柱状线
当满足条件收盘价>开盘价时,在收盘价和开盘价之间画柱状线
当满足条件收盘价>开盘价时,在收盘价和开盘价之间画柱状线
STICKLINE(SS=1 OR (SM>=1 AND SS=0),B1,C,2.5,0),COLOR0099FF
当满足条件SS=2时,在B2和C之间画柱状线
STICKLINE((SS=-1 OR SS=-2) AND SM>0,B2,B1,2.5,0),COLOR0099FF
HH赋值:CONST(120日内H最高值)
LH赋值:CONST(120日内H最低值)
WN赋值:P
{原码 N赋值:3
}
WA1赋值:WN日前的H=2*WN+1日内H最高值
WB1赋值:WA1的WN过滤
WC1赋值:BACKSET(WB1,WN+1)
WD1赋值:WC1的WN过滤
{高点}
WA2赋值:WN日前的L=2*WN+1日内L最低值
WB2赋值:WA2的WN过滤
WC2赋值:BACKSET(WB2,WN+1)
WD2赋值:WC2的WN过滤
{低点}
WR1赋值:BACKSET(ISLASTBAR,上次WD1距今天数+1)
WS1赋值:WR1>1日前的WR1
{前一高}
WT1赋值:BACKSET(ISLASTBAR,上次WD2距今天数+1)
WU1赋值:WT1>1日前的WT1
{前一低}
WR2赋值:BACKSET(WS1,REF(上次WD1距今天数,1)+2)
WS2赋值:WR2>1日前的WR2
{前二高}
WT2赋值:BACKSET(WU1,REF(上次WD2距今天数,1)+2)
WU2赋值:WT2>1日前的WT2
{前二低}
WR3赋值:BACKSET(WS2,REF(上次WD1距今天数,1)+2)
WS3赋值:WR3>1日前的WR3
{前三高}
WT3赋值:BACKSET(WU2,REF(上次WD2距今天数,1)+2)
WU3赋值:WT3>1日前的WT3
{前三低}
WR4赋值:BACKSET(WS3,REF(上次WD1距今天数,1)+2)
WS4赋值:WR4>1日前的WR4
{前四高}
WT4赋值:BACKSET(WU3,REF(上次WD2距今天数,1)+2)
WU4赋值:WT4>1日前的WT4
{前四高}