金字塔自动分类板块[金字塔模型]
IF ISLASTBAR THEN
BEGIN
Y:=YEAR;
YY:=STRRIGHT(NUMTOSTR(Y,0),2);
MT:=MONTH; //真实月份
DY:=STRCAT(YY,NUMTOSTREX(MT,0,2));
SIZETEST:=OPTIONSIZE(\'QQ510050\',STRTONUM(DY),0); //取合约数量
M:=IF(SIZETEST>0,MT,IF(MT<12,MT+1,1)); //合约数量大于0则当月未到期,否则下月成当月
当月:=STRCAT(YY,NUMTOSTREX(M,0,2));
次月:=IF(M=12,STRCAT(STRRIGHT(NUMTOSTR(Y+1,0),2),\'01\'),STRCAT(YY,NUMTOSTREX(M+1,0,2)));
XJY:=IF(M=2 OR M=3 OR M=4,6,IF(M=5 OR M=6 OR M=7,9,IF(M=8 OR M=9 OR M=10,12,3)));
下季月:=IF(M>10,STRCAT(STRRIGHT(NUMTOSTR(Y+1,0),2),\'03\'),STRCAT(YY,NUMTOSTREX(XJY,0,2)));
GJY:=IF(M=2 OR M=3 OR M=4,9,IF(M=5 OR M=6 OR M=7,12,IF(M=8 OR M=9 OR M=10,3,6)));
隔季月:=IF(M>10,STRCAT(STRRIGHT(NUMTOSTR(Y+1,0),2),\'06\'),STRCAT(YY,NUMTOSTREX(GJY,0,2)));
CLEARBLOCK(\'50当月\');
CLEARBLOCK(\'50次月\');
CLEARBLOCK(\'50下季月\');
CLEARBLOCK(\'50隔季月\');
SIZEDY:=OPTIONSIZE(\'QQ510050\',STRTONUM(当月),0); //取当月合约数量
FOR I = 1 TO SIZEDY DO
BEGIN
ADDTOBLOCK(OPTIONLABEL(I),\'50当月\');
END
SIZECY:=OPTIONSIZE(\'QQ510050\',STRTONUM(次月),0); //取次月合约数量
FOR I = 1 TO SIZECY DO
BEGIN
ADDTOBLOCK(OPTIONLABEL(I),\'50次月\');
END
SIZEXJY:=OPTIONSIZE(\'QQ510050\',STRTONUM(下季月),0); //取下季月合约数量
FOR I = 1 TO SIZEXJY DO
BEGIN
ADDTOBLOCK(OPTIONLABEL(I),\'50下季月\');
END
SIZEGJY:=OPTIONSIZE(\'QQ510050\',STRTONUM(隔季月),0); //取隔季月合约数量
FOR I = 1 TO SIZEGJY DO
BEGIN
ADDTOBLOCK(OPTIONLABEL(I),\'50隔季月\');
END
OPOBYPRIRCE(\'QQ510050\',2.2,0,0,1);
IF ISLASTBAR THEN MSGOUT(1,OPOBYPRIRCE(\'QQ510050\',2.25,0,0,1));
END
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 511411198 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容