双线持币单线持股公式指标源码
操盘线:MA(C,4),COLORRED,LINETHICK3;
安全线:MA(C,19),COLORGRAY,LINESTICK,LINETHICK1;
牛熊分界线: MA(C,200),COLORYELLOW,CIRCLEDOT,LINETHICK1;
DRAWTEXT(CROSS(安全线,操盘线),H*1.01,'←S卖出'),COLOR00FF00,LINETHICK9;
DRAWTEXT(CROSS(操盘线,安全线),L*0.99,'←B买入'),COLORYELLOW,LINETHICK9;
STICKLINE(CROSS(操盘线,安全线) AND BACKSET(CLOSE>操盘线,2) AND (操盘线>安全线) AND (CLOSE>安全线),OPEN,CLOSE,2,1),COLORYELLOW;
STICKLINE(CROSS(安全线,操盘线) AND BACKSET(CLOSE<操盘线,2) AND (操盘线<安全线),OPEN,CLOSE,2,1),COLORLIGREEN;
DRAWICON(CROSS(操盘线,安全线),L*0.98,9);
DRAWICON(CROSS(安全线,操盘线),H*1,2);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);
DRAWTEXT_FIX(C>O,0.01,0.9,0,' COLORRED;
DRAWTEXT_FIX(C>O,1,1,0,'程序化交易模型'),COLORRED;
GDTS:=IF(CC,CURRBARSCOUNT,0);
DINGBU:=IF(DDD,ref(H,DDD),H);{顶部}
DINGBUTS:=IF(DDD,ref(GDTS,DDD),GDTS);
DINGBU1:=ref(DINGBU,DDD+1); {本文来至CXH99.COM}
GDCS1:=CONST(DINGBUTS);
DINGBUTS1:=ref(DINGBUTS,DDD+1);
GDCS2:=CONST(DINGBUTS1);
DINGBU2:=ref(DINGBU1,DDD+1);
MM:=IF(CURRBARSCOUNT>GDCS2,0,1}
高点压力:DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1) COLORGREEN,LINETHICK2;
DRAWLINE(CURRBARSCOUNT=GDCS2,H,ISLASTBAR,ref(H,GDCS2-1),1),COLOR0055FF,POINTDOT;
DRAWLINE(CURRBARSCOUNT=GDCS1,H,ISLASTBAR,ref(H,GDCS1-1),1),COLORYELLOW,POINTDOT;
AA1:=ref(L,LOWN)=LLV(L,2*LOWN+1);
QY1:=BACKSET(AA1,LOWN+1);
CC1:=FILTER(QY1,LOWN) AND L=LLV(L,LOWN+1);
DRAWICON(CC1,L*0.98,1);
DD1:=BARSLAST(CC1);
DDTS:=IF(CC1,CURRBARSCOUNT,0);
YDB:=IF(DD1,ref(L,DD1),L);
DDTS1:=IF(DD1,ref(DDTS,DD1),DDTS);
DDCS1:=CONST(DDTS1);
ZDB:=ref(YDB,DD1+1);
DDTS2:=ref(DDTS1,DD1+1);
DDCS2:=CONST(DDTS2);
低点支撑:DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1) COLORRED,LINETHICK2;
ZGSTAR:=(高点压力+低点支撑)/2;
ZGEND:=CONST((高点压力+低点支撑)/2);
STARDAY:=IF(DDCS2<GDCS2,DDCS2,GDCS2);
中轨:DRAWLINE(CURRBARSCOUNT=STARDAY,ZGSTAR,ISLASTBAR,ZGEND,1),COLORFF55BB,LINETHICK2;
DRAWLINE(CURRBARSCOUNT=DDCS1,L,ISLASTBAR,ref(L,DDCS1-1),1),COLORMAGENTA,POINTDOT,;
DRAWLINE(CURRBARSCOUNT=DDCS2,L,ISLASTBAR,ref(L,DDCS2-1),1),COLORCYAN,POINTDOT;
双线持币:HHV(MA(HIGH,2),2),COLORGREEN,LINETHICK2;
单线持股:LLV(MA(HIGH,2),1),COLORRED,LINETHICK2; |