比价线指标,与大盘对比的。
zy:=CLOSE/INDEXDATA("1A0001",&CLOSE)*2000;
买线:EMA(zy,3);
卖线:EMA(SLOPE(zy,21)*20+zy,55);
买卖差:=买线-卖线;
STICKLINE(买卖差>=0,(买线-买卖差*0.05),(买线-买卖差*0.15),3,0) ,COLOR00ffff;
STICKLINE(买卖差>=0,(买线-买卖差*0.2),(买线-买卖差*0.35),3,0) ,COLOR00ccff;
STICKLINE(买卖差>=0,(买线-买卖差*0.4),(买线-买卖差*0.55),3,0) ,COLOR0099ff;
STICKLINE(买卖差>=0,(买线-买卖差*0.6),(买线-买卖差*0.75),3,0) ,COLOR0066ff;
STICKLINE(买卖差>=0,(买线-买卖差*0.8),(买线-买卖差*0.95),3,0) ,COLOR0000cc;
STICKLINE(买卖差<0,(卖线+买卖差*0.05),(卖线+买卖差*0.15),3,0) ,COLOR006600;
STICKLINE(买卖差<0,(卖线+买卖差*0.2),(卖线+买卖差*0.35),3,0) ,COLOR009900;
STICKLINE(买卖差<0,(卖线+买卖差*0.4),(卖线+买卖差*0.55),3,0) ,COLOR00cc00;
STICKLINE(买卖差<0,(卖线+买卖差*0.6),(卖线+买卖差*0.75),3,0) ,COLOR00ff00;
STICKLINE(买卖差<0,(卖线+买卖差*0.8),(卖线+买卖差*0.95),3,0) ,COLOR66ff00;
YnXG:HHV(买线,55);
tj1:=买线=ynxg;
tj2:=tj1 AND NOT(REF(tj1,1));
DRAWICON(tj2,卖线,1);
DRAWICON(CROSS(卖线,买线),买线,2);
买线1:=EMA(C,3);
卖线1:=EMA(SLOPE(C,21)*20+C,55);
YnXG1:=HHV(买线1,55);
tj3:=买线1=ynxg1;
FILLRGN(买线,卖线,tj1 AND 买线1>卖线1,coloryellow);
FILLRGN(买线,卖线,tj1 AND tj3,colorred);
tj6:=tj1 AND 买线1>卖线1;
tj7:=tj6 AND NOT(REF(tj6,1));
DRAWTEXT(tj7,卖线,'↖买'),colorwhite;
tj4:=tj1 AND tj3;
tj5:=tj4 AND NOT(REF(tj4,1));
DRAWTEXT(tj5,卖线,'↖买'),colorred;
tj12:=买线>卖线;
tj13:=CROSS(卖线,买线);
tj14:=tj1 AND NOT(REF(tj1,1));
tj15:=tj14 AND tj12;
ts1:=BARSLAST(tj15);
ts2:=BARSLAST(tj13);
DRAWICON(CROSS(卖线,买线),买线,2);
FILLRGN(买线,ynxg,ts2<ts1,colorwhite);
DRAWGBK(ts2<ts1),colorliblue;