近月远月合约的计算及引用 [金字塔]
-
咨询内容:
nn:='AG';
VARIABLE: X[12]=0;
X[1]:=CALLSTOCKEX(nn+'01',vtVOL,6,0,2000);
X[2]:=CALLSTOCKEX(nn+'02',vtVOL,6,0,2000);
X[3]:=CALLSTOCKEX(nn+'03',vtVOL,6,0,2000);
X[4]:=CALLSTOCKEX(nn+'04',vtVOL,6,0,2000);
X[5]:=CALLSTOCKEX(nn+'05',vtVOL,6,0,2000);
X[6]:=CALLSTOCKEX(nn+'06',vtVOL,6,0,2000);
X[7]:=CALLSTOCKEX(nn+'07',vtVOL,6,0,2000);
X[8]:=CALLSTOCKEX(nn+'08',vtVOL,6,0,2000);
X[9]:=CALLSTOCKEX(nn+'09',vtVOL,6,0,2000);
X[10]:=CALLSTOCKEX(nn+'10',vtVOL,6,0,2000);
X[11]:=CALLSTOCKEX(nn+'11',vtVOL,6,0,2000);
X[12]:=CALLSTOCKEX(nn+'12',vtVOL,6,0,2000);
VARIABLE:ZL=0; IF X[1]=CALLSTOCKEX(nn+'00',vtVOL,6,0,2000) THEN ZL:='01'; IF X[2]=CALLSTOCKEX(nn+'00',vtVOL,6,0,2000) THEN ZL:='02'; IF X[3]=CALLSTOCKEX(nn+'00',vtVOL,6,0,2000) THEN ZL:='03'; IF X[4]=CALLSTOCKEX(nn+'00',vtVOL,6,0,2000) THEN ZL:='04'; IF X[5]=CALLSTOCKEX(nn+'00',vtVOL,6,0,2000) THEN ZL:='05'; IF X[6]=CALLSTOCKEX(nn+'00',vtVOL,6,0,2000) THEN ZL:='06'; IF X[7]=CALLSTOCKEX(nn+'00',vtVOL,6,0,2000) THEN ZL:='07'; IF X[8]=CALLSTOCKEX(nn+'00',vtVOL,6,0,2000) THEN ZL:='08'; IF X[9]=CALLSTOCKEX(nn+'00',vtVOL,6,0,2000) THEN ZL:='09'; IF X[10]=CALLSTOCKEX(nn+'00',vtVOL,6,0,2000) THEN ZL:='10'; IF X[11]=CALLSTOCKEX(nn+'00',vtVOL,6,0,2000) THEN ZL:='11'; IF X[12]=CALLSTOCKEX(nn+'00',vtVOL,6,0,2000) THEN ZL:='12';
VARIABLE:CZL=0; IF X[1]=large(X,12,2) THEN CZL:='01'; IF X[2]=large(X,12,2) THEN CZL:='02'; IF X[3]=large(X,12,2) THEN CZL:='03'; IF X[4]=large(X,12,2) THEN CZL:='04'; IF X[5]=large(X,12,2) THEN CZL:='05'; IF X[6]=large(X,12,2) THEN CZL:='06'; IF X[7]=large(X,12,2) THEN CZL:='07'; IF X[8]=large(X,12,2) THEN CZL:='08'; IF X[9]=large(X,12,2) THEN CZL:='09'; IF X[10]=large(X,12,2) THEN CZL:='10'; IF X[11]=large(X,12,2) THEN CZL:='11'; IF X[12]=large(X,12,2) THEN CZL:='12';
VARIABLE:JY=0; IF STRTONUM(ZL)<MONTH() AND STRTONUM(CZL)<MONTH() AND STRTONUM(ZL)<STRTONUM(CZL) THEN JY:=ZL; IF STRTONUM(ZL)<MONTH() AND STRTONUM(CZL)<MONTH() AND STRTONUM(ZL)>STRTONUM(CZL) THEN JY:=CZL; IF STRTONUM(ZL)<MONTH() AND STRTONUM(CZL)>MONTH() THEN JY:=nn+CZL; IF STRTONUM(ZL)>MONTH() AND STRTONUM(CZL)<MONTH() THEN JY:=nn+ZL; IF STRTONUM(ZL)>MONTH() AND STRTONUM(CZL)>MONTH() AND STRTONUM(ZL)<STRTONUM(CZL) THEN JY:=ZL; IF STRTONUM(ZL)>MONTH() AND STRTONUM(CZL)>MONTH() AND STRTONUM(ZL)>STRTONUM(CZL) THEN JY:=CZL;
VARIABLE:YY=0; IF STRTONUM(ZL)<MONTH() AND STRTONUM(CZL)<MONTH() AND STRTONUM(ZL)<STRTONUM(CZL) THEN YY:=CZL; IF STRTONUM(ZL)<MONTH() AND STRTONUM(CZL)<MONTH() AND STRTONUM(ZL)>STRTONUM(CZL) THEN YY:=ZL; IF STRTONUM(ZL)<MONTH() AND STRTONUM(CZL)>MONTH() THEN YY:=ZL; IF STRTONUM(ZL)>MONTH() AND STRTONUM(CZL)<MONTH() THEN YY:=CZL; IF STRTONUM(ZL)>MONTH() AND STRTONUM(CZL)>MONTH() AND STRTONUM(ZL)<STRTONUM(CZL) THEN YY:=CZL; IF STRTONUM(ZL)>MONTH() AND STRTONUM(CZL)>MONTH() AND STRTONUM(ZL)>STRTONUM(CZL) THEN YY:=ZL;
我用以上公式区分品种‘nn’主力与次主力合约中哪个是近月哪个是远月,显示在副图上数据是完整正确的用agjy:STKINDIEX('','ZCJY.JY',0,6,0,2000);在引用时数据显示不完整,问题出在哪里?另外我希望品种‘nn’能够成为一个参数被STKINDIEX引用,这样我可以方便的获取全部商品的主次近远月,但是思路不清晰,请版主指点。来源: WWW.CXH99.COM
-
金字塔客服:
有人吗?
-
用户回复:
自己顶一下
-
网友回复:
稍等,我们测试一下
- 网友回复: 你的数据都补充完整吗?
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 511411198 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容