等级: 超级版主
- 注册:
- 2021-5-18
- 曾用名:
|
FirstTradeDay:=WEEKDAY<ref(WEEKDAY,1) or DATEDIFF(ref(date,1),date)>=8;
bars:=barslast(month<>ref(month,1));
//这个就是第几周
num:=count(FirstTradeDay,bars+1);
if (month=4 and num>=3) OR (month>4 and month<8) or (month=8 and num<3) then BEGIN name:='jd09';tempopen:=callstock('jd09',vtopen,6,0) ;temphigh:=callstock('jd09',vtHIGH,6,0);tempclose:=callstock('jd09',vtCLOSE,6,0);templow:=callstock('jd09',vtLOW,6,0); END;
if (month=8 and num>=3) OR (month>8 and month<12) or (month=12 and num<3) then BEGIN name:='jd01';tempopen:=callstock('jd01',vtopen,6,0) ;temphigh:=callstock('jd01',vtHIGH,6,0);tempclose:=callstock('jd01',vtCLOSE,6,0);templow:=callstock('jd01',vtLOW,6,0);END;
if (month=12 and num>=3) OR (month>=1 and month<4) or (month=4 and num<3) then BEGIN name:='jd05';tempopen:=callstock('jd05',vtopen,6,0) ;temphigh:=callstock('jd05',vtHIGH,6,0);tempclose:=callstock('jd05',vtCLOSE,6,0);templow:=callstock('jd05',vtLOW,6,0);END;
cd1:=tempclose>=tempopen;//区分阴阳线的,与上面条件无关
STICKLINE(1 ,tempclose,tempopen,8,if(cd1,1,0),COLORYELLOW);//绘制柱体
//绘制上下影线
STICKLINE(1,if(not(cd1),tempopen,tempclose),temphigh,0,if(cd1,1,0),COLORYELLOW);
STICKLINE(1,if(cd1,tempopen,tempclose),templow,0,if(cd1,1,0),COLORYELLOW);
DRAWTEXT(1 ,low ,name); |
|