通达信生命线
VAR4:=100*(CLOSE-LLV(HIGH,240))/LLV(HIGH,240);
VAR5:=(CLOSE-LLV(LOW,528))/(HHV(HIGH,528)-LLV(LOW,528))*100;
VAR6:=(CLOSE-LLV(CLOSE,530))/(HHV(CLOSE,530)-LLV(CLOSE,530))*100;
VAR8:=SMA(MAX(CLOSE-REF(CLOSE,1),0),34,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),7,1)*100;
VAR9:=SMA(MAX(CLOSE-REF(CLOSE,1),0),13,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),13,1)*100;
VAR10:=IF(TROUGHBARS(3,16,1)=0 AND HIGH>LOW+0.04,4,0);
VAR11:=ZIG(3,6)>REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)<=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)<=REF(ZIG(3,6),3);
VAR12:=ZIG(3,6)<REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)>=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)>=REF(ZIG(3,6),3);
VAR13:=ZIG(3,22)>REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)<=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)<=REF(ZIG(3,22),3);
VAR14:=ZIG(3,22)<REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)>=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)>=REF(ZIG(3,22),3);
VAR15:=ZIG(3,51)>REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)<=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)<=REF(ZIG(3,51),3);
VAR16:=ZIG(3,51)<REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)>=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)>=REF(ZIG(3,51),3);
VAR17:=ZIG(3,72)>REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)<=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)<=REF(ZIG(3,72),3);
VAR18:=ZIG(3,72)<REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)>=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)>=REF(ZIG(3,72),3);
VAR19:=EMA(CLOSE,2)-EMA(CLOSE,150);
顶:BBI+3*STD(BBI,13),COLORFFFF00,LINETHICK1;
底:BBI-3*STD(BBI,13),COLORFFFF00,LINETHICK1;
DRAWBAND(BBI,RGB(100,50,50),顶,RGB(100,50,50));
DRAWBAND(BBI,RGB(0,60,100),底,RGB(0,60,100));
生命线:EMA(((SLOPE(CLOSE,22) * 23) + CLOSE),50),COLORLIRED,LINETHICK2;
IF(C<生命线,生命线,DRAWNULL),COLORGREEN,LINETHICK3;
STICKLINE(C>O ,H,L,0,0),COLORRED;
STICKLINE(C>O ,O,C,3,1),COLORRED;
STICKLINE(C<=O ,H,L,0,0),COLORCYAN;
STICKLINE(C<=O ,O,C,3,1),COLORCYAN;
MID:=(3*CLOSE+LOW+OPEN+HIGH)/6;
牛线:(20*MID+19*REF(MID,1)+18*REF(MID,2)+17*REF(MID,3)+16*REF(MID,4)+15*REF(MID,5)+14*REF(MID,6)+13*REF(MID,7)+12*REF(MID,8)+11*REF(MID,9)+10*REF(MID,10)+9*REF(MID,11)+8*REF(MID,12)+7*REF(MID,13)+6*REF(MID,14)+5*REF(MID,15)+4*REF(MID,16)+3*REF(MID,17)+2*REF(MID,18)+REF(MID,20))/210,COLORRED;
马线:MA(牛线,6),COLORGREEN;
五日线:MA(CLOSE,5),POINTDOT,COLORLIBLUE;
水平面:MA(CLOSE,60),POINTDOT,COLORYELLOW;
HIGHN:=10;LOWN:=10;HIGHDISPLAY:=0;LOWDISPLAY:=0;ZGDISPLAY:=0;MADISPLAY:=0;
AA:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);
QY:=BACKSET(AA,HIGHN+1);
CC:=FILTER(QY,HIGHN) AND H=HHV(H,HIGHN+1);
DRAWICON(CC,H*1.02,2);
DDD:=BARSLAST(CC);
GDTS:=IF(CC,CURRBARSCOUNT,0);
DINGBU:=IF(DDD,REF(H,DDD),H);{顶部}
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);
DINGBU1:=REF(DINGBU,DDD+1);
GDCS1:=CONST(DINGBUTS);
DINGBUTS1:=REF(DINGBUTS,DDD+1);
GDCS2:=CONST(DINGBUTS1);
DINGBU2:=REF(DINGBU1,DDD+1);
MM:=IF(CURRBARSCOUNT>GDCS2,0,1);
买1:=VAR10;
买2:=(VAR11+VAR13+VAR15+VAR17);
卖1:=(VAR12+VAR14+VAR16+VAR18);
DRAWTEXT(买1>0 OR 买2>0,LOW*0.98,'买入'),COLORRED;
买入:IF(买1>0 OR 买2>0,LOW*0.97,DRAWNULL),CROSSDOT,LINETHICK3,COLORRED;
DRAWTEXT(卖1>0,HIGH*1.01,'卖出'),COLORGREEN;
卖出:IF(卖1>0,HIGH*1.02,DRAWNULL),CROSSDOT,LINETHICK3,COLORGREEN;
高:=REF(HHV(H,80),3);
低:=REF(LLV(L,80),3);
顶点:REFDATE(高,DATE),COLORGREEN,LINETHICK3;
低点:REFDATE(低,DATE),COLORRED,LINETHICK2;
未来函数检测结果如下:
该公式包含未来函数:ZIG
该公式包含未来函数:TROUGH
该公式包含未来函数:TROUGHBARS
该公式包含未来函数:BACKSET
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
VAR4赋值:100*(收盘价-240日内最高价最低值)/240日内最高价最低值
VAR5赋值:(收盘价-528日内最低价最低值)/(528日内最高价最高值-528日内最低价最低值)*100
VAR6赋值:(收盘价-530日内收盘价最低值)/(530日内收盘价最高值-530日内收盘价最低值)*100
VAR8赋值:SMA(收盘价-1日前的收盘价和0较大值,34,1)/SMA(收盘价-1日前的收盘价的绝对值,7,1)*100
VAR9赋值:SMA(收盘价-1日前的收盘价和0较大值,13,1)/SMA(收盘价-1日前的收盘价的绝对值,13,1)*100
VAR10赋值:IF(TROUGHBARS(3,16,1)=0 AND 最高价>最低价+0.04,4,0)
VAR11赋值:ZIG(3,6)>REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)<=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)<=REF(ZIG(3,6),3)
VAR12赋值:ZIG(3,6)[=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)>=REF(ZIG(3,6),3)]
VAR13赋值:ZIG(3,22)>REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)<=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)<=REF(ZIG(3,22),3)
VAR14赋值:ZIG(3,22)[=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)>=REF(ZIG(3,22),3)]
VAR15赋值:ZIG(3,51)>REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)<=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)<=REF(ZIG(3,51),3)
VAR16赋值:ZIG(3,51)[=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)>=REF(ZIG(3,51),3)]
VAR17赋值:ZIG(3,72)>REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)<=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)<=REF(ZIG(3,72),3)
VAR18赋值:ZIG(3,72)[=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)>=REF(ZIG(3,72),3)]
VAR19赋值:收盘价的2日指数移动平均-收盘价的150日指数移动平均
输出
顶:BBI+3*BBI的13估算标准差,COLORFFFF00,LINETHICK1
输出
底:BBI-3*BBI的13估算标准差,COLORFFFF00,LINETHICK1
DRAWBAND(BBI,RGB(100,50,50),顶,RGB(100,50,50))
DRAWBAND(BBI,RGB(0,60,100),底,RGB(0,60,100))
输出
生命线:EMA(((SLOPE(收盘价,22) * 23) + 收盘价),50),COLORLIRED, 线宽为2
如果C<生命线返回生命线否则返回DRAWNULL
当满足条件C>O 时,在H和L之间画柱状线
当满足条件C>O 时,在O和C之间画柱状线
当满足条件C<=O 时,在H和L之间画柱状线
当满足条件C<=O 时,在O和C之间画柱状线
MID赋值:(3*收盘价+最低价+开盘价+最高价)/6
输出
牛线:(20*MID+19*1日前的MID+18*2日前的MID+17*3日前的MID+16*4日前的MID+15*5日前的MID+14*6日前的MID+13*7日前的MID+12*8日前的MID+11*9日前的MID+10*10日前的MID+9*11日前的MID+8*12日前的MID+7*13日前的MID+6*14日前的MID+5*15日前的MID+4*16日前的MID+3*17日前的MID+2*18日前的MID+20日前的MID)/210,画红色
输出
马线:牛线的6日简单移动平均,画绿色
输出
五日线:收盘价的5日简单移动平均,POINTDOT,COLORLIBLUE
输出
水平面:收盘价的60日简单移动平均,POINTDOT,画黄色
HIGHN赋值:10
LOWN赋值:10
HIGHDISPLAY赋值:0
LOWDISPLAY赋值:0
ZGDISPLAY赋值:0
MADISPLAY赋值:0
AA赋值:最高价N日前的H=2*最高价N+1日内H最高值
QY赋值:BACKSET(AA,最高价N+1)
CC赋值:QY的最高价N过滤 AND H=最高价N+1日内H最高值
当满足条件CC时,在H*1.02和2之间画图标
DDD赋值:上次CC距今天数
如果CC返回 到最后交易的周期否则返回0
DINGBU赋值:IF(DDD,DDD日前的H,H)
{顶部}
DINGBUTS:=IF(DDD,DDD日前的GDTS,GDTS)
DINGBU1:=DDD+1日前的DINGBU
GDCS1赋值:CONST(DINGBUTS)
DINGBUTS1:=DDD+1日前的DINGBUTS
GDCS2赋值:CONST(DINGBUTS1)
DINGBU2:=DDD+1日前的DINGBU1
如果 到最后交易的周期>GDCS2返回0否则返回1
买1赋值:VAR10
买2赋值:(VAR11+VAR13+VAR15+VAR17)
卖1赋值:(VAR12+VAR14+VAR16+VAR18)
当满足条件买1>0 OR 买2>0时,在最低价*0.98和'买入'位置书写文字
如果买1>0 OR 买2>0返回最低价*0.97否则返回DRAWNULL
当满足条件卖1>0时,在最高价*1.01和'卖出'位置书写文字
如果卖1>0返回最高价*1.02否则返回DRAWNULL
高赋值:REF(80日内H最高值,3)
低赋值:REF(80日内L最低值,3)
顶点:REFDATE(高,DATE),画绿色, 线宽为3
低点:REFDATE(低,DATE),画红色, 线宽为2