等级: 新手上路
- 注册:
- 2023-12-26
- 曾用名:
|
楼主 |
发表于 2024-9-13 14:13
|
显示全部楼层
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) then tempopen:=callstock('jd09',vtopen,6,0) ;temphigh:=callstock('jd09',vtHIGH,6,0);tempclose:=callstock('jd09',vtCLOSE,6,0);templow:=callstock('jd09',vtLOW,6,0);
if (month=8 and num>3) OR (month>8 and month<12) then tempopen:=callstock('jd01',vtopen,6,0) ;temphigh:=callstock('jd01',vtHIGH,6,0);tempclose:=callstock('jd01',vtCLOSE,6,0);templow:=callstock('jd01',vtLOW,6,0);
if (month=12 and num>3) OR (month>=1 and month<4) then tempopen:=callstock('jd05',vtopen,6,0) ;temphigh:=callstock('jd05',vtHIGH,6,0);tempclose:=callstock('jd05',vtCLOSE,6,0);templow:=callstock('jd05',vtLOW,6,0);
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);
绘制出来的K线好像不太对
|
|