价:=(2*C+(H-L)/2+L+o)/4;
变:=(eMA(价,3)*7+eMA(价,7)*3)/10;
参:=EMA((7*价+6*REF(价,1)+5*REF(价,2)+4*REF(价,3)+3*REF(价,4)+2*REF(价,5)+1*REF(价,6))/28,1);
DRAWGBK(变=参,COLORRGB(30,30,30),COLORRGB(130,130,130),1);
DRAWGBK(变>参,COLORRGB(110,0,0),COLORRGB(0,0,0),0);
DRAWGBK(变<参,COLORRGB(0,110,0),COLORRGB(0,0,0),0);
均价:=(2*C+(H-L)/2+L+o)/4;
价差:=SUM(均价-REF(均价,1),2)/2;
高低:=(均价+价差);
实价:=(高低+均价)/2;
aa:=eMA(((SLOPE(实价,21)*20)+实价),63),COLORYELLOW,LINETHICK1;
bb:=eMA(((SLOPE(均价,21)*20)+均价),63),COLORYELLOW,LINETHICK1;
多空:=((AA+bb)/2),COLORRED,PRECISION2;
dif:=(3*多空-2*EMA(多空,84))/EMA(多空,84)-1;
dea:=MA(dif,5);
庄持仓:=IF(STKTYPE=0,5000*(dif-dea),10*(dif-dea))COLORYELLOW,LINETHICK;
zqMACD:=DATATYPE;
rmacd:=OPENMINUTES(TIME);
zsmacd:=ref(实价,rmacd);
zsrmacd:=DYNAINFO( 3);
jmacd:=SUM(实价*V,SUMBARS(VOL,CAPITAL))/SUM(V,SUMBARS(VOL,CAPITAL));
jjmacd:=SUM(实价*V,0)/SUM(V,0);
jjmacd1:=SUM(实价*V,rmacd)/SUM(V,rmacd)LINETHICK0;
jjamacd:=if(zqmacd=6,jjmacd,if(zqmacd=1,jjmacd1,jjmacd));
zsamacd:=if(zqmacd=6,zsrmacd,if(zqmacd=1,zsmacd,zsrmacd));
crmacd:=if(zqmacd=6,c>0,if(zqmacd=1,rmacd>1,c>0));
PARTLINE(crmacd,zsamacd),COLORGRAY,POINTDOT;
dkmacd:=(SMA(C,2,1)-SMA(C,6,1))*2.1,LINETHICK0;
FILLRGN(庄持仓>0 and jjamacd>0 ,zsamacd,ZSamacd+庄持仓),ColorB40084,COLORBROWN;
FILLRGN(庄持仓<=0 and jjamacd>0 ,zsamacd,ZSamacd+庄持仓),Color80A180;
///如觉得MACD影响K线以上原码可删除
YC:=REF(CLOSE,1);
止损价位:=(YC*1.0035*97+0.2)/99.65,COLORRED,LINETHICK0;
DRAWTEXTEX(1,0,15,20,'★ ======================'),COLORRED;
DRAWTEXTEX(1,0,15,30,'操 '),COLORRED;
DRAWTEXTEX(1,0,15,50,'盘 '),COLORRED;
DRAWTEXTEX(1,0,15,70,'铁'),COLORRED;
DRAWTEXTEX(1,0,15,89,'律'),COLORRED;
DRAWTEXTEX(1,0,15,105,'★ ======================'),COLORRED;
DRAWTEXTEX(1,0,15,41,' 买入条件 多空线'),colorYellow;
DRAWTEXTEX(1,0,15,57,' 买入时间 2:30以后' ),colorYellow;
DRAWTEXTEX(1,0,15,73,' 止损价位 '+NUMTOSTR(止损价位,2)+'元'),colorYellow;
DRAWTEXTEX(1,0,15,89,' 线上:工作 线下:休息'),color00FFFF;
明日阻力:=2*价-LOW;
明日支撑:=2*价-HIGH;
明日突破:=价+(HIGH-LOW);
明日反转:=价-(HIGH-LOW);
今日阻力:=REF(明日阻力,1);
今日支撑:=REF(明日支撑,1);
次日心理价:=(价+明日突破+明日阻力+明日支撑+明日反转)/5,COLORWHITE,LINETHICK;
今日保护价:=(REF(价,1)+REF(价,2)+价)/3,COLOR0099FF,LINETHICK;
DRAWTEXTEX(1,0,200,25,'今日阻力=:'+NUMTOSTR(今日阻力,2)),ColorFFFF00;
DRAWTEXTEX(1,0,200,41,'今日支撑=:'+NUMTOSTR(今日支撑,2)),Colorred;
DRAWTEXTEX(1,0,200,57,'明日突破=:'+NUMTOSTR(明日突破,2)),ColorFF00FF;
DRAWTEXTEX(1,0,200,73,'明日阻力=:'+NUMTOSTR(明日阻力,2)),ColorFFFF00;
DRAWTEXTEX(1,0,200,89,'明日支撑=:'+NUMTOSTR(明日支撑,2)),COLORRED;
DRAWTEXTEX(1,0,200,105,'明日反转=:'+NUMTOSTR(明日反转,2)),COLORYellow;
DRAWTEXTEX(1,0,200,121,'次日心理价=:'+NUMTOSTR(次日心理价,2)),COLORRED;
DRAWTEXTEX(1,0,200,137,'今日保护价=:'+NUMTOSTR(今日保护价,2)),COLORGREEN;
缺口:=(L>REF(H,1));
不破:=(ALL(L>REF(H,BARSLAST(缺口)+1),BARSLAST(缺口)+1));
STICKLINE(不破,REF(H,BARSLAST(缺口)+1),REF(L,BARSLAST(缺口)),10,0),COLORGRAY;
下缺口:=(H<REF(L,1));
不补:=(ALL(H<REF(L,BARSLAST(下缺口)+1),BARSLAST(下缺口)+1));
STICKLINE(不补,REF(L,BARSLAST(下缺口)+1),REF(H,BARSLAST(下缺口)),10,0),COLORBLUE;
STICKLINE(OPEN>=CLOSE,HIGH,LOW,0.2,0),colorFFCC00;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,8,0),colorFF9F68;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,7,0),colorFF9900;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,6,0),colorFFAA11;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,5,0),colorFFBB11;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,4,0),colorFFCC22;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,3,0),colorFFDD22;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,2,0),colorFFEE33;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,1,0),colorFFFF33;
STICKLINE(CLOSE>OPEN,HIGH,LOW,0.2,0),colorFF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,8,0),colorCC;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,7,0),color3300CC;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,6,0),color33CC;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,5,0),color6633CC;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,4,0),color3333FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3,0),color6633FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2,0),color3366FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1,0),color6666FF;
{K线卖提示}
Qc0:=3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1);
stickline(Qc0>=91 AND (CLOSE-LLV(CLOSE,5))/(HHV(CLOSE,5)-LLV(CLOSE,5))*100>99.9,open,close,3,0),COLOR3366FF;
stickline(Qc0>=91 AND (CLOSE-LLV(CLOSE,5))/(HHV(CLOSE,5)-LLV(CLOSE,5))*100>99.9,H,L,0.5,0),COLOR3366FF;
{VAR11:=ZIG(3,10)<REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)>REF(ZIG(3,10),2);{ZIG 有未来}
VAR123:=ZIG(3,10)>REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)<REF(ZIG(3,10),2);}
KSD:=IF(O>C,O,C);
VAR12:=IF(TROUGHBARS(KSD,10,1)=1,1,0);
VAR1:=IF(PEAKBARS(KSD,10,1)=1,1,0);
STICKLINE(VAR1,C,O,10,0),COLORYELLOW,LINETHICK2;{高位黄色}
STICKLINE(VAR1,C,O,6,0),COLORGRAY,LINETHICK2;{高位黄色}
STICKLINE(VAR1,H,L,1,0),COLORYELLOW,LINETHICK2;{高位黄色}
STICKLINE(VAR12,C,O,10,0),COLOR9900FF,LINETHICK2;{底位红色}
STICKLINE(VAR12,C,O,6,0),COLORWHITE,LINETHICK2;{底位红色}
STICKLINE(VAR12,H,L,1,0),COLORRED,LINETHICK2;{底位红色}
M1n:=MA(实价,8);
M1m:=MA(均价,8);
操盘线:(M1N+M1M)/2,COLORWHITE,LINETHICK1,PRECISION2;
X:=SLOPE(操盘线,2);
PARTLINE(x>0,操盘线),COLORRED,LINETHICK2;
上档线:ma(HHV(操盘线,24),1),COLORYELLOW,LINEDOT,PRECISION2;
下档线:MA(LLV(操盘线,48),1),COLORGREEN,LINEDOT,PRECISION2;
CC:=ABS(实价-多空)/多空;
DD:=DMA(实价,cc);
多:(1+7/100)*DD,COLOR7F00FF;
多空线:dd,COLORWHITE,LINETHICK2;
空:(1-7/100)*DD,COLORAAAA00;
天:(1+14/100)*DD,LINEDOT,COLORGRAY;
地:(1-14/100)*DD,LINEDOT,COLORGRAY;
PARTLINE(多<REF(多,1), 多),COLORAAAA00;
PARTLINE(多空线>=REF(多空线,1), 多空线),COLORRED,LINETHICK2;
PARTLINE(空>=REF(空,1), 空),COLOR7F00FF;