[PEL] 复制代码
ma5:ma(c,5);
ma21:ma(c,21);
up:ma21>ref(ma21,1);
down:ma21<ref(ma21,1);
red:=up and c>ma5;
yellow:=up and c<ma5;
blue:=down and c<ma5;
purple:=down and c>ma5;
con1:=red and ref(yellow or purple,1);
con2:=yellow and ref(red,1);
con3:=blue and ref(yellow,1);
con4:=purple and ref(blue,1);
kd:=ref(con1,1);
pd:=ref(con2,1);
kk:=ref(con3,1);
pk:=ref(con4,1);
sell(pd,holding,LIMITR,o);
sellshort(pk,holding,LIMITR,o);
buy(kd and holding=0,1,LIMITR,o);
buyshort(kk and holding=0,1,LIMITR,o);
条件:=red or yellow or blue or purple;
cd:=c>=o;//区分阴阳线的,与上面条件无关
if red then
begin
STICKLINE(条件 ,C,o,8,0,COLORRED);//绘制柱体
//绘制上下影线
STICKLINE(条件,if(not(cd),O,c),h,0,if(cd,1,0),COLORRED);
STICKLINE(条件,if(cd,O,c),L,0,if(cd,1,0),COLORRED);
end
if yellow then
begin
STICKLINE(条件 ,C,o,8,0,COLORYELLOW);//绘制柱体
//绘制上下影线
STICKLINE(条件,if(not(cd),O,c),h,0,if(cd,1,0),COLORYELLOW);
STICKLINE(条件,if(cd,O,c),L,0,if(cd,1,0),COLORYELLOW);
end
if blue then
begin
STICKLINE(条件 ,C,o,8,0,COLORBLUE);//绘制柱体
//绘制上下影线
STICKLINE(条件,if(not(cd),O,c),h,0,if(cd,1,0),COLORBLUE);
STICKLINE(条件,if(cd,O,c),L,0,if(cd,1,0),COLORBLUE);
end
if purple then
begin
STICKLINE(条件 ,C,o,8,0,COLORRGB(128,0,128));//绘制柱体
//绘制上下影线
STICKLINE(条件,if(not(cd),O,c),h,0,0,COLORRGB(128,0,128));
STICKLINE(条件,if(cd,O,c),L,0,if(cd,1,0),COLORRGB(128,0,128));
end