以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  写了这样一个策略。后台交易的时候不交易。  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=54510)

--  作者:vermouth
--  发布时间:2013/8/1 9:10:21
--  写了这样一个策略。后台交易的时候不交易。
下面是代码:


//al沪铝
al00:=callstock(\'al00\',vtVOL,6,-1);
al01:=callstock(\'al01\',vtVOL,6,-1);
al02:=callstock(\'al02\',vtVOL,6,-1);
al03:=callstock(\'al03\',vtVOL,6,-1);
al04:=callstock(\'al04\',vtVOL,6,-1);
al05:=callstock(\'al05\',vtVOL,6,-1);
al06:=callstock(\'al06\',vtVOL,6,-1);
al07:=callstock(\'al07\',vtVOL,6,-1);
al08:=callstock(\'al08\',vtVOL,6,-1);
al09:=callstock(\'al09\',vtVOL,6,-1);
al10:=callstock(\'al10\',vtVOL,6,-1);
al11:=callstock(\'al11\',vtVOL,6,-1);
al12:=callstock(\'al12\',vtVOL,6,-1);
if al00=al01 then alcode:=\'al01\';
if al00=al02 then alcode:=\'al02\';
if al00=al03 then alcode:=\'al03\';
if al00=al04 then alcode:=\'al04\';
if al00=al05 then alcode:=\'al05\';
if al00=al06 then alcode:=\'al06\';
if al00=al07 then alcode:=\'al07\';
if al00=al08 then alcode:=\'al08\';
if al00=al09 then alcode:=\'al09\';
if al00=al10 then alcode:=\'al10\';
if al00=al11 then alcode:=\'al11\';
if al00=al12 then alcode:=\'al12\';
alclose:=callstock(alcode,vtCLOSE,6);
alclose1:=callstock(alcode,vtCLOSE,6,-1);
al:=alclose/alclose1-1;

//cu沪铜
cu00:=callstock(\'cu00\',vtVOL,6,-1);
cu01:=callstock(\'cu01\',vtVOL,6,-1);
cu02:=callstock(\'cu02\',vtVOL,6,-1);
cu03:=callstock(\'cu03\',vtVOL,6,-1);
cu04:=callstock(\'cu04\',vtVOL,6,-1);
cu05:=callstock(\'cu05\',vtVOL,6,-1);
cu06:=callstock(\'cu06\',vtVOL,6,-1);
cu07:=callstock(\'cu07\',vtVOL,6,-1);
cu08:=callstock(\'cu08\',vtVOL,6,-1);
cu09:=callstock(\'cu09\',vtVOL,6,-1);
cu10:=callstock(\'cu10\',vtVOL,6,-1);
cu11:=callstock(\'cu11\',vtVOL,6,-1);
cu12:=callstock(\'cu12\',vtVOL,6,-1);
if cu00=cu01 then cucode:=\'cu01\';
if cu00=cu02 then cucode:=\'cu02\';
if cu00=cu03 then cucode:=\'cu03\';
if cu00=cu04 then cucode:=\'cu04\';
if cu00=cu05 then cucode:=\'cu05\';
if cu00=cu06 then cucode:=\'cu06\';
if cu00=cu07 then cucode:=\'cu07\';
if cu00=cu08 then cucode:=\'cu08\';
if cu00=cu09 then cucode:=\'cu09\';
if cu00=cu10 then cucode:=\'cu10\';
if cu00=cu11 then cucode:=\'cu11\';
if cu00=cu12 then cucode:=\'cu12\';
cuclose:=callstock(cucode,vtCLOSE,6);
cuclose1:=callstock(cucode,vtCLOSE,6,-1);
cu:=cuclose/cuclose1-1;
//fu燃油
fu00:=callstock(\'fu00\',vtVOL,6,-1);
fu01:=callstock(\'fu01\',vtVOL,6,-1);
fu02:=callstock(\'fu02\',vtVOL,6,-1);
fu03:=callstock(\'fu03\',vtVOL,6,-1);
fu04:=callstock(\'fu04\',vtVOL,6,-1);
fu05:=callstock(\'fu05\',vtVOL,6,-1);
fu06:=callstock(\'fu06\',vtVOL,6,-1);
fu07:=callstock(\'fu07\',vtVOL,6,-1);
fu08:=callstock(\'fu08\',vtVOL,6,-1);
fu09:=callstock(\'fu09\',vtVOL,6,-1);
fu10:=callstock(\'fu10\',vtVOL,6,-1);
fu11:=callstock(\'fu11\',vtVOL,6,-1);
fu12:=callstock(\'fu12\',vtVOL,6,-1);
if fu00=fu01 then fucode:=\'fu01\';
if fu00=fu02 then fucode:=\'fu02\';
if fu00=fu03 then fucode:=\'fu03\';
if fu00=fu04 then fucode:=\'fu04\';
if fu00=fu05 then fucode:=\'fu05\';
if fu00=fu06 then fucode:=\'fu06\';
if fu00=fu07 then fucode:=\'fu07\';
if fu00=fu08 then fucode:=\'fu08\';
if fu00=fu09 then fucode:=\'fu09\';
if fu00=fu10 then fucode:=\'fu10\';
if fu00=fu11 then fucode:=\'fu11\';
if fu00=fu12 then fucode:=\'fu12\';
fuclose:=callstock(fucode,vtCLOSE,6);
fuclose1:=callstock(fucode,vtCLOSE,6,-1);
fu:=fuclose/fuclose1-1;
//pb沪铅
pb00:=callstock(\'pb00\',vtVOL,6,-1);
pb01:=callstock(\'pb01\',vtVOL,6,-1);
pb02:=callstock(\'pb02\',vtVOL,6,-1);
pb03:=callstock(\'pb03\',vtVOL,6,-1);
pb04:=callstock(\'pb04\',vtVOL,6,-1);
pb05:=callstock(\'pb05\',vtVOL,6,-1);
pb06:=callstock(\'pb06\',vtVOL,6,-1);
pb07:=callstock(\'pb07\',vtVOL,6,-1);
pb08:=callstock(\'pb08\',vtVOL,6,-1);
pb09:=callstock(\'pb09\',vtVOL,6,-1);
pb10:=callstock(\'pb10\',vtVOL,6,-1);
pb11:=callstock(\'pb11\',vtVOL,6,-1);
pb12:=callstock(\'pb12\',vtVOL,6,-1);
if pb00=pb01 then pbcode:=\'pb01\';
if pb00=pb02 then pbcode:=\'pb02\';
if pb00=pb03 then pbcode:=\'pb03\';
if pb00=pb04 then pbcode:=\'pb04\';
if pb00=pb05 then pbcode:=\'pb05\';
if pb00=pb06 then pbcode:=\'pb06\';
if pb00=pb07 then pbcode:=\'pb07\';
if pb00=pb08 then pbcode:=\'pb08\';
if pb00=pb09 then pbcode:=\'pb09\';
if pb00=pb10 then pbcode:=\'pb10\';
if pb00=pb11 then pbcode:=\'pb11\';
if pb00=pb12 then pbcode:=\'pb12\';
pbclose:=callstock(pbcode,vtCLOSE,6);
pbclose1:=callstock(pbcode,vtCLOSE,6,-1);
pb:=pbclose/pbclose1-1;
//螺纹钢
rb00:=callstock(\'rb00\',vtVOL,6,-1);
rb01:=callstock(\'rb01\',vtVOL,6,-1);
rb02:=callstock(\'rb02\',vtVOL,6,-1);
rb03:=callstock(\'rb03\',vtVOL,6,-1);
rb04:=callstock(\'rb04\',vtVOL,6,-1);
rb05:=callstock(\'rb05\',vtVOL,6,-1);
rb06:=callstock(\'rb06\',vtVOL,6,-1);
rb07:=callstock(\'rb07\',vtVOL,6,-1);
rb08:=callstock(\'rb08\',vtVOL,6,-1);
rb09:=callstock(\'rb09\',vtVOL,6,-1);
rb10:=callstock(\'rb10\',vtVOL,6,-1);
rb11:=callstock(\'rb11\',vtVOL,6,-1);
rb12:=callstock(\'rb12\',vtVOL,6,-1);
if rb00=rb01 then rbcode:=\'rb01\';
if rb00=rb02 then rbcode:=\'rb02\';
if rb00=rb03 then rbcode:=\'rb03\';
if rb00=rb04 then rbcode:=\'rb04\';
if rb00=rb05 then rbcode:=\'rb05\';
if rb00=rb06 then rbcode:=\'rb06\';
if rb00=rb07 then rbcode:=\'rb07\';
if rb00=rb08 then rbcode:=\'rb08\';
if rb00=rb09 then rbcode:=\'rb09\';
if rb00=rb10 then rbcode:=\'rb10\';
if rb00=rb11 then rbcode:=\'rb11\';
if rb00=rb12 then rbcode:=\'rb12\';
rbclose:=callstock(rbcode,vtCLOSE,6);
rbclose1:=callstock(rbcode,vtCLOSE,6,-1);
rb:=rbclose/rbclose1-1;
//ru 橡胶
ru00:=callstock(\'ru00\',vtVOL,6,-1);
ru01:=callstock(\'ru01\',vtVOL,6,-1);
ru02:=callstock(\'ru02\',vtVOL,6,-1);
ru03:=callstock(\'ru03\',vtVOL,6,-1);
ru04:=callstock(\'ru04\',vtVOL,6,-1);
ru05:=callstock(\'ru05\',vtVOL,6,-1);
ru06:=callstock(\'ru06\',vtVOL,6,-1);
ru07:=callstock(\'ru07\',vtVOL,6,-1);
ru08:=callstock(\'ru08\',vtVOL,6,-1);
ru09:=callstock(\'ru09\',vtVOL,6,-1);
ru10:=callstock(\'ru10\',vtVOL,6,-1);
ru11:=callstock(\'ru11\',vtVOL,6,-1);
//ru12:=callstock(\'ru12\',vtVOL,6,-1);
if ru00=ru01 then rucode:=\'ru01\';
if ru00=ru02 then rucode:=\'ru02\';
if ru00=ru03 then rucode:=\'ru03\';
if ru00=ru04 then rucode:=\'ru04\';
if ru00=ru05 then rucode:=\'ru05\';
if ru00=ru06 then rucode:=\'ru06\';
if ru00=ru07 then rucode:=\'ru07\';
if ru00=ru08 then rucode:=\'ru08\';
if ru00=ru09 then rucode:=\'ru09\';
if ru00=ru10 then rucode:=\'ru10\';
if ru00=ru11 then rucode:=\'ru11\';
//if ru00=ru12 then rucode:=\'ru12\';
ruclose:=callstock(rucode,vtCLOSE,6);
ruclose1:=callstock(rucode,vtCLOSE,6,-1);
ru:=ruclose/ruclose1-1;
//wr线材
wr00:=callstock(\'wr00\',vtVOL,6,-1);
wr01:=callstock(\'wr01\',vtVOL,6,-1);
wr02:=callstock(\'wr02\',vtVOL,6,-1);
wr03:=callstock(\'wr03\',vtVOL,6,-1);
wr04:=callstock(\'wr04\',vtVOL,6,-1);
wr05:=callstock(\'wr05\',vtVOL,6,-1);
wr06:=callstock(\'wr06\',vtVOL,6,-1);
wr07:=callstock(\'wr07\',vtVOL,6,-1);
wr08:=callstock(\'wr08\',vtVOL,6,-1);
wr09:=callstock(\'wr09\',vtVOL,6,-1);
wr10:=callstock(\'wr10\',vtVOL,6,-1);
wr11:=callstock(\'wr11\',vtVOL,6,-1);
wr12:=callstock(\'wr12\',vtVOL,6,-1);
if wr00=wr01 then wrcode:=\'wr01\';
if wr00=wr02 then wrcode:=\'wr02\';
if wr00=wr03 then wrcode:=\'wr03\';
if wr00=wr04 then wrcode:=\'wr04\';
if wr00=wr05 then wrcode:=\'wr05\';
if wr00=wr06 then wrcode:=\'wr06\';
if wr00=wr07 then wrcode:=\'wr07\';
if wr00=wr08 then wrcode:=\'wr08\';
if wr00=wr09 then wrcode:=\'wr09\';
if wr00=wr10 then wrcode:=\'wr10\';
if wr00=wr11 then wrcode:=\'wr11\';
if wr00=wr12 then wrcode:=\'wr12\';
wrclose:=callstock(wrcode,vtCLOSE,6);
wrclose1:=callstock(wrcode,vtCLOSE,6,-1);
wr:=wrclose/wrclose1-1;
//zn沪锌
zn00:=callstock(\'zn00\',vtVOL,6,-1);
zn01:=callstock(\'zn01\',vtVOL,6,-1);
zn02:=callstock(\'zn02\',vtVOL,6,-1);
zn03:=callstock(\'zn03\',vtVOL,6,-1);
zn04:=callstock(\'zn04\',vtVOL,6,-1);
zn05:=callstock(\'zn05\',vtVOL,6,-1);
zn06:=callstock(\'zn06\',vtVOL,6,-1);
zn07:=callstock(\'zn07\',vtVOL,6,-1);
zn08:=callstock(\'zn08\',vtVOL,6,-1);
zn09:=callstock(\'zn09\',vtVOL,6,-1);
zn10:=callstock(\'zn10\',vtVOL,6,-1);
zn11:=callstock(\'zn11\',vtVOL,6,-1);
zn12:=callstock(\'zn12\',vtVOL,6,-1);
if zn00=zn01 then zncode:=\'zn01\';
if zn00=zn02 then zncode:=\'zn02\';
if zn00=zn03 then zncode:=\'zn03\';
if zn00=zn04 then zncode:=\'zn04\';
if zn00=zn05 then zncode:=\'zn05\';
if zn00=zn06 then zncode:=\'zn06\';
if zn00=zn07 then zncode:=\'zn07\';
if zn00=zn08 then zncode:=\'zn08\';
if zn00=zn09 then zncode:=\'zn09\';
if zn00=zn10 then zncode:=\'zn10\';
if zn00=zn11 then zncode:=\'zn11\';
if zn00=zn12 then zncode:=\'zn12\';
znclose:=callstock(zncode,vtCLOSE,6);
znclose1:=callstock(zncode,vtCLOSE,6,-1);
zn:=znclose/znclose1-1;

//////////////////////////////////
//焦炭
j00:=CALLSTOCK(\'j00\',vtVOL,6,-1);
j01:=CALLSTOCK(\'j01\',vtVOL,6,-1);
j02:=CALLSTOCK(\'j02\',vtVOL,6,-1);
j03:=CALLSTOCK(\'j03\',vtVOL,6,-1);
j04:=CALLSTOCK(\'j04\',vtVOL,6,-1);
j05:=CALLSTOCK(\'j05\',vtVOL,6,-1);
j06:=CALLSTOCK(\'j06\',vtVOL,6,-1);
j07:=CALLSTOCK(\'j07\',vtVOL,6,-1);
j08:=CALLSTOCK(\'j08\',vtVOL,6,-1);
j09:=CALLSTOCK(\'j09\',vtVOL,6,-1);
j10:=CALLSTOCK(\'j10\',vtVOL,6,-1);
j11:=CALLSTOCK(\'j11\',vtVOL,6,-1);
j12:=CALLSTOCK(\'j12\',vtVOL,6,-1);

if j00=j01 then jtcode:=\'j01\';
if j00=j02 then jtcode:=\'j02\';
if j00=j03 then jtcode:=\'j03\';
if j00=j04 then jtcode:=\'j04\';
if j00=j05 then jtcode:=\'j05\';
if j00=j06 then jtcode:=\'j06\';
if j00=j07 then jtcode:=\'j07\';
if j00=j08 then jtcode:=\'j08\';
if j00=j09 then jtcode:=\'j09\';
if j00=j10 then jtcode:=\'j10\';
if j00=j11 then jtcode:=\'j11\';
if j00=j12 then jtcode:=\'j12\';
jtclose:=callstock(jtcode,vtCLOSE,6);
jtclose1:=callstock(jtcode,vtCLOSE,6,-1);
jt:=jtclose/jtclose1-1;
//焦煤
jm00:=CALLSTOCK(\'jm00\',vtVOL,6,-1);
jm01:=CALLSTOCK(\'jm01\',vtVOL,6,-1);
jm02:=CALLSTOCK(\'jm02\',vtVOL,6,-1);
jm03:=CALLSTOCK(\'jm03\',vtVOL,6,-1);
jm04:=CALLSTOCK(\'jm04\',vtVOL,6,-1);
jm05:=CALLSTOCK(\'jm05\',vtVOL,6,-1);
jm06:=CALLSTOCK(\'jm06\',vtVOL,6,-1);
jm07:=CALLSTOCK(\'jm07\',vtVOL,6,-1);
jm08:=CALLSTOCK(\'jm08\',vtVOL,6,-1);
jm09:=CALLSTOCK(\'jm09\',vtVOL,6,-1);
jm10:=CALLSTOCK(\'jm10\',vtVOL,6,-1);
jm11:=CALLSTOCK(\'jm11\',vtVOL,6,-1);
jm12:=CALLSTOCK(\'jm12\',vtVOL,6,-1);

if jm00=jm01 then jmcode:=\'jm01\';
if jm00=jm02 then jmcode:=\'jm02\';
if jm00=jm03 then jmcode:=\'jm03\';
if jm00=jm04 then jmcode:=\'jm04\';
if jm00=jm05 then jmcode:=\'jm05\';
if jm00=jm06 then jmcode:=\'jm06\';
if jm00=jm07 then jmcode:=\'jm07\';
if jm00=jm08 then jmcode:=\'jm08\';
if jm00=jm09 then jmcode:=\'jm09\';
if jm00=jm10 then jmcode:=\'jm10\';
if jm00=jm11 then jmcode:=\'jm11\';
if jm00=jm12 then jmcode:=\'jm12\';

jmclose:=callstock(jmcode,vtCLOSE,6);
jmclose1:=callstock(jmcode,vtCLOSE,6,-1);
jm:=jmclose/jmclose1-1;
//塑料
l00:=CALLSTOCK(\'l00\',vtVOL,6,-1);
l01:=CALLSTOCK(\'l01\',vtVOL,6,-1);
l02:=CALLSTOCK(\'l02\',vtVOL,6,-1);
l03:=CALLSTOCK(\'l03\',vtVOL,6,-1);
l04:=CALLSTOCK(\'l04\',vtVOL,6,-1);
l05:=CALLSTOCK(\'l05\',vtVOL,6,-1);
l06:=CALLSTOCK(\'l06\',vtVOL,6,-1);
l07:=CALLSTOCK(\'l07\',vtVOL,6,-1);
l08:=CALLSTOCK(\'l08\',vtVOL,6,-1);
l09:=CALLSTOCK(\'l09\',vtVOL,6,-1);
l10:=CALLSTOCK(\'l10\',vtVOL,6,-1);
l11:=CALLSTOCK(\'l11\',vtVOL,6,-1);
l12:=CALLSTOCK(\'l12\',vtVOL,6,-1);

if l00=l01 then slcode:=\'l01\';
if l00=l02 then slcode:=\'l02\';
if l00=l03 then slcode:=\'l03\';
if l00=l04 then slcode:=\'l04\';
if l00=l05 then slcode:=\'l05\';
if l00=l06 then slcode:=\'l06\';
if l00=l07 then slcode:=\'l07\';
if l00=l08 then slcode:=\'l08\';
if l00=l09 then slcode:=\'l09\';
if l00=l10 then slcode:=\'l10\';
if l00=l11 then slcode:=\'l11\';
if l00=l12 then slcode:=\'l12\';
slclose:=callstock(slcode,vtCLOSE,6);
slclose1:=callstock(slcode,vtCLOSE,6,-1);
sl:=slclose/slclose1-1;
//豆粨
m00:=CALLSTOCK(\'m00\',vtVOL,6,-1);
m01:=CALLSTOCK(\'m01\',vtVOL,6,-1);
m03:=CALLSTOCK(\'m03\',vtVOL,6,-1);
m05:=CALLSTOCK(\'m05\',vtVOL,6,-1);
m07:=CALLSTOCK(\'m07\',vtVOL,6,-1);
m08:=CALLSTOCK(\'m08\',vtVOL,6,-1);
m09:=CALLSTOCK(\'m09\',vtVOL,6,-1);
m11:=CALLSTOCK(\'m11\',vtVOL,6,-1);
m12:=CALLSTOCK(\'m12\',vtVOL,6,-1);

if m00=m01 then dbcode:=\'m01\';
if m00=m03 then dbcode:=\'m03\';
if m00=m05 then dbcode:=\'m05\';
if m00=m07 then dbcode:=\'m07\';
if m00=m08 then dbcode:=\'m08\';
if m00=m09 then dbcode:=\'m09\';
if m00=m11 then dbcode:=\'m11\';
if m00=m12 then dbcode:=\'m12\';

dbclose:=callstock(dbcode,vtCLOSE,6);
dbclose1:=callstock(dbcode,vtCLOSE,6,-1);
db:=dbclose/dbclose1-1;
//棕榈
p00:=CALLSTOCK(\'p00\',vtVOL,6,-1);
p01:=CALLSTOCK(\'p01\',vtVOL,6,-1);
p02:=CALLSTOCK(\'p02\',vtVOL,6,-1);
p03:=CALLSTOCK(\'p03\',vtVOL,6,-1);
p04:=CALLSTOCK(\'p04\',vtVOL,6,-1);
p05:=CALLSTOCK(\'p05\',vtVOL,6,-1);
p06:=CALLSTOCK(\'p06\',vtVOL,6,-1);
p07:=CALLSTOCK(\'p07\',vtVOL,6,-1);
p08:=CALLSTOCK(\'p08\',vtVOL,6,-1);
p09:=CALLSTOCK(\'p09\',vtVOL,6,-1);
p10:=CALLSTOCK(\'p10\',vtVOL,6,-1);
p11:=CALLSTOCK(\'p11\',vtVOL,6,-1);
p12:=CALLSTOCK(\'p12\',vtVOL,6,-1);

if p00=p01 then zlcode:=\'p01\';
if p00=p02 then zlcode:=\'p02\';
if p00=p03 then zlcode:=\'p03\';
if p00=p04 then zlcode:=\'p04\';
if p00=p05 then zlcode:=\'p05\';
if p00=p06 then zlcode:=\'p06\';
if p00=p07 then zlcode:=\'p07\';
if p00=p08 then zlcode:=\'p08\';
if p00=p09 then zlcode:=\'p09\';
if p00=p10 then zlcode:=\'p10\';
if p00=p11 then zlcode:=\'p11\';
if p00=p12 then zlcode:=\'p12\';
zlclose:=callstock(zlcode,vtCLOSE,6);
zlclose1:=callstock(zlcode,vtCLOSE,6,-1);
zl:=zlclose/zlclose1-1;
//聚氯乙烯
v00:=CALLSTOCK(\'v00\',vtVOL,6,-1);
v01:=CALLSTOCK(\'v01\',vtVOL,6,-1);
v02:=CALLSTOCK(\'v02\',vtVOL,6,-1);
v03:=CALLSTOCK(\'v03\',vtVOL,6,-1);
v04:=CALLSTOCK(\'v04\',vtVOL,6,-1);
v05:=CALLSTOCK(\'v05\',vtVOL,6,-1);
v06:=CALLSTOCK(\'v06\',vtVOL,6,-1);
v07:=CALLSTOCK(\'v07\',vtVOL,6,-1);
v08:=CALLSTOCK(\'v08\',vtVOL,6,-1);
v09:=CALLSTOCK(\'v09\',vtVOL,6,-1);
v10:=CALLSTOCK(\'v10\',vtVOL,6,-1);
v11:=CALLSTOCK(\'v11\',vtVOL,6,-1);
v12:=CALLSTOCK(\'v12\',vtVOL,6,-1);

if v00=v01 then jlyxcode:=\'v01\';
if v00=v02 then jlyxcode:=\'v02\';
if v00=v03 then jlyxcode:=\'v03\';
if v00=v04 then jlyxcode:=\'v04\';
if v00=v05 then jlyxcode:=\'v05\';
if v00=v06 then jlyxcode:=\'v06\';
if v00=v07 then jlyxcode:=\'v07\';
if v00=v08 then jlyxcode:=\'v08\';
if v00=v09 then jlyxcode:=\'v09\';
if v00=v10 then jlyxcode:=\'v10\';
if v00=v11 then jlyxcode:=\'v11\';
if v00=v12 then jlyxcode:=\'v12\';
jlyxclose:=callstock(jlyxcode,vtCLOSE,6);
jlyxclose1:=callstock(jlyxcode,vtCLOSE,6,-1);
jlyx:=jlyxclose/jlyxclose1-1;
//豆油
y00:=CALLSTOCK(\'y00\',vtVOL,6,-1);
y01:=CALLSTOCK(\'y01\',vtVOL,6,-1);
y03:=CALLSTOCK(\'y03\',vtVOL,6,-1);
y05:=CALLSTOCK(\'y05\',vtVOL,6,-1);
y07:=CALLSTOCK(\'y07\',vtVOL,6,-1);
y08:=CALLSTOCK(\'y08\',vtVOL,6,-1);
y09:=CALLSTOCK(\'y09\',vtVOL,6,-1);
y11:=CALLSTOCK(\'y11\',vtVOL,6,-1);
y12:=CALLSTOCK(\'y12\',vtVOL,6,-1);

if y00=y01 then dycode:=\'y01\';
if y00=y03 then dycode:=\'y03\';
if y00=y05 then dycode:=\'y05\';
if y00=y07 then dycode:=\'y07\';
if y00=y08 then dycode:=\'y08\';
if y00=y09 then dycode:=\'y09\';
if y00=y11 then dycode:=\'y11\';
if y00=y12 then dycode:=\'y12\';
dyclose:=callstock(dycode,vtCLOSE,6);
dyclose1:=callstock(dycode,vtCLOSE,6,-1);
dy:=dyclose/dyclose1-1;

//玉米
c00:=CALLSTOCK(\'c00\',vtVOL,6,-1);
c01:=CALLSTOCK(\'c01\',vtVOL,6,-1);
c03:=CALLSTOCK(\'c03\',vtVOL,6,-1);
c05:=CALLSTOCK(\'c05\',vtVOL,6,-1);
c07:=CALLSTOCK(\'c07\',vtVOL,6,-1);
c09:=CALLSTOCK(\'c09\',vtVOL,6,-1);
c11:=CALLSTOCK(\'c11\',vtVOL,6,-1);

if c00=c01 then ymcode:=\'c01\';
if c00=c03 then ymcode:=\'c03\';
if c00=c05 then ymcode:=\'c05\';
if c00=c07 then ymcode:=\'c07\';
if c00=c09 then ymcode:=\'c09\';
if c00=c11 then ymcode:=\'c11\';
ymclose:=callstock(ymcode,vtCLOSE,6);
ymclose1:=callstock(ymcode,vtCLOSE,6,-1);
ym:=ymclose/ymclose1-1;
//豆二
b00:=CALLSTOCK(\'b00\',vtVOL,6,-1);
b01:=CALLSTOCK(\'b01\',vtVOL,6,-1);
b03:=CALLSTOCK(\'b03\',vtVOL,6,-1);
b05:=CALLSTOCK(\'b05\',vtVOL,6,-1);
b07:=CALLSTOCK(\'b07\',vtVOL,6,-1);
b09:=CALLSTOCK(\'b09\',vtVOL,6,-1);
b11:=CALLSTOCK(\'b11\',vtVOL,6,-1);

if b00=b01 then decode:=\'b01\';
if b00=b03 then decode:=\'b03\';
if b00=b05 then decode:=\'b05\';
if b00=b07 then decode:=\'b07\';
if b00=b09 then decode:=\'b09\';
if b00=b11 then decode:=\'b11\';
declose:=callstock(decode,vtCLOSE,6);
declose1:=callstock(decode,vtCLOSE,6,-1);
de:=declose/declose1-1;

//豆一
ax00:=callstock(\'ax00\',vtVOL,6,-1);
ax01:=CALLSTOCK(\'ax01\',vtVOL,6,-1);
ax03:=CALLSTOCK(\'ax03\',vtVOL,6,-1);
ax05:=CALLSTOCK(\'ax05\',vtVOL,6,-1);
ax07:=CALLSTOCK(\'ax07\',vtVOL,6,-1);
ax09:=CALLSTOCK(\'ax09\',vtVOL,6,-1);
ax11:=CALLSTOCK(\'ax11\',vtVOL,6,-1);
ay01:=CALLSTOCK(\'ay01\',vtVOL,6,-1);
ay03:=CALLSTOCK(\'ay03\',vtVOL,6,-1);
ay05:=CALLSTOCK(\'ay05\',vtVOL,6,-1);
ay07:=CALLSTOCK(\'ay07\',vtVOL,6,-1);
ay09:=CALLSTOCK(\'ay09\',vtVOL,6,-1);
ay11:=CALLSTOCK(\'ay11\',vtVOL,6,-1);
{
d1code1:=max(ax01,ax03);
d1code2:=max(d1code1,ax05);
d1code3:=max(d1code2,ax07);
d1code4:=max(d1code3,ax09);
d1code5:=max(d1code4,ax11);
d1code6:=max(d1code5,ay01);
d1code7:=max(d1code6,ay03);
d1code8:=max(d1code7,ay05);
d1code9:=max(d1code8,ay07);
d1code10:=max(d1code9,ay09);
d1code11:=max(d1code10,ay11);
d1code:=d1code11;
}
if ax00=ax01 then d1code:=\'ax01\';
if ax00=ax03 then d1code:=\'ax03\';
if ax00=ax05 then d1code:=\'ax05\';
if ax00=ax07 then d1code:=\'ax07\';
if ax00=ax09 then d1code:=\'ax09\';
if ax00=ax11 then d1code:=\'ax11\';
if ax00=ay01 then d1code:=\'ay01\';
if ax00=ay03 then d1code:=\'ay03\';
if ax00=ay05 then d1code:=\'ay05\';
if ax00=ay07 then d1code:=\'ay07\';
if ax00=ay09 then d1code:=\'ay09\';
if ax00=ay11 then d1code:=\'ay11\';

d1close:=callstock(d1code,vtCLOSE,6);
d1close1:=callstock(d1code,vtCLOSE,6,-1);
d1:=d1close/d1close1-1;

////////////////////////////////////////////
//棉花cf
cf00:=CALLSTOCK(\'cf00\',vtVOL,6,-1);
cf01:=CALLSTOCK(\'cf01\',vtVOL,6,-1);
cf03:=CALLSTOCK(\'cf03\',vtVOL,6,-1);
cf05:=CALLSTOCK(\'cf05\',vtVOL,6,-1);
cf07:=CALLSTOCK(\'cf07\',vtVOL,6,-1);
cf09:=CALLSTOCK(\'cf09\',vtVOL,6,-1);
cf11:=CALLSTOCK(\'cf11\',vtVOL,6,-1);

if cf00=cf01 then cfcode:=\'cf01\';
if cf00=cf03 then cfcode:=\'cf03\';
if cf00=cf05 then cfcode:=\'cf05\';
if cf00=cf07 then cfcode:=\'cf07\';
if cf00=cf09 then cfcode:=\'cf09\';
if cf00=cf11 then cfcode:=\'cf11\';
cfclose:=callstock(cfcode,vtCLOSE,6);
cfclose1:=callstock(cfcode,vtCLOSE,6,-1);
cf:=cfclose/cfclose1-1;
//玻璃
fg00:=callstock(\'fg00\',vtVOL,6,-1);
fg01:=callstock(\'fg01\',vtVOL,6,-1);
fg02:=callstock(\'fg02\',vtVOL,6,-1);
fg03:=callstock(\'fg03\',vtVOL,6,-1);
fg04:=callstock(\'fg04\',vtVOL,6,-1);
fg05:=callstock(\'fg05\',vtVOL,6,-1);
fg06:=callstock(\'fg06\',vtVOL,6,-1);
fg07:=callstock(\'fg07\',vtVOL,6,-1);
fg08:=callstock(\'fg08\',vtVOL,6,-1);
fg09:=callstock(\'fg09\',vtVOL,6,-1);
fg10:=callstock(\'fg10\',vtVOL,6,-1);
fg11:=callstock(\'fg11\',vtVOL,6,-1);
fg12:=callstock(\'fg12\',vtVOL,6,-1);
if fg00=fg01 then fgcode:=\'fg01\';
if fg00=fg02 then fgcode:=\'fg02\';
if fg00=fg03 then fgcode:=\'fg03\';
if fg00=fg04 then fgcode:=\'fg04\';
if fg00=fg05 then fgcode:=\'fg05\';
if fg00=fg06 then fgcode:=\'fg06\';
if fg00=fg07 then fgcode:=\'fg07\';
if fg00=fg08 then fgcode:=\'fg08\';
if fg00=fg09 then fgcode:=\'fg09\';
if fg00=fg10 then fgcode:=\'fg10\';
if fg00=fg11 then fgcode:=\'fg11\';
if fg00=fg12 then fgcode:=\'fg12\';
fgclose:=callstock(fgcode,vtCLOSE,6);
fgclose1:=callstock(fgcode,vtCLOSE,6,-1);
fg:=fgclose/fgclose1-1;
//甲醇
me00:=callstock(\'me00\',vtVOL,6,-1);
me01:=callstock(\'me01\',vtVOL,6,-1);
me02:=callstock(\'me02\',vtVOL,6,-1);
me03:=callstock(\'me03\',vtVOL,6,-1);
me04:=callstock(\'me04\',vtVOL,6,-1);
me05:=callstock(\'me05\',vtVOL,6,-1);
me06:=callstock(\'me06\',vtVOL,6,-1);
me07:=callstock(\'me07\',vtVOL,6,-1);
me08:=callstock(\'me08\',vtVOL,6,-1);
me09:=callstock(\'me09\',vtVOL,6,-1);
me10:=callstock(\'me10\',vtVOL,6,-1);
me11:=callstock(\'me11\',vtVOL,6,-1);
me12:=callstock(\'me12\',vtVOL,6,-1);
if me00=me01 then mecode:=\'me01\';
if me00=me02 then mecode:=\'me02\';
if me00=me03 then mecode:=\'me03\';
if me00=me04 then mecode:=\'me04\';
if me00=me05 then mecode:=\'me05\';
if me00=me06 then mecode:=\'me06\';
if me00=me07 then mecode:=\'me07\';
if me00=me08 then mecode:=\'me08\';
if me00=me09 then mecode:=\'me09\';
if me00=me10 then mecode:=\'me10\';
if me00=me11 then mecode:=\'me11\';
if me00=me12 then mecode:=\'me12\';
meclose:=callstock(mecode,vtCLOSE,6);
meclose1:=callstock(mecode,vtCLOSE,6,-1);
me:=meclose/meclose1-1;
//新菜油
oi00:=CALLSTOCK(\'oi00\',vtVOL,6,-1);
oi01:=CALLSTOCK(\'oi01\',vtVOL,6,-1);
oi03:=CALLSTOCK(\'oi03\',vtVOL,6,-1);
oi05:=CALLSTOCK(\'oi05\',vtVOL,6,-1);
oi07:=CALLSTOCK(\'oi07\',vtVOL,6,-1);
oi09:=CALLSTOCK(\'oi09\',vtVOL,6,-1);
oi11:=CALLSTOCK(\'oi11\',vtVOL,6,-1);

if oi00=oi01 then oicode:=\'oi01\';
if oi00=oi03 then oicode:=\'oi03\';
if oi00=oi05 then oicode:=\'oi05\';
if oi00=oi07 then oicode:=\'oi07\';
if oi00=oi09 then oicode:=\'oi09\';
if oi00=oi11 then oicode:=\'oi11\';
oiclose:=callstock(oicode,vtCLOSE,6);
oiclose1:=callstock(oicode,vtCLOSE,6,-1);
oi:=oiclose/oiclose1-1;
//普麦
pm00:=CALLSTOCK(\'pm00\',vtVOL,6,-1);
pm01:=CALLSTOCK(\'pm01\',vtVOL,6,-1);
pm03:=CALLSTOCK(\'pm03\',vtVOL,6,-1);
pm05:=CALLSTOCK(\'pm05\',vtVOL,6,-1);
pm07:=CALLSTOCK(\'pm07\',vtVOL,6,-1);
pm09:=CALLSTOCK(\'pm09\',vtVOL,6,-1);
pm11:=CALLSTOCK(\'pm11\',vtVOL,6,-1);

if pm00=pm01 then pmcode:=\'pm01\';
if pm00=pm03 then pmcode:=\'pm03\';
if pm00=pm05 then pmcode:=\'pm05\';
if pm00=pm07 then pmcode:=\'pm07\';
if pm00=pm09 then pmcode:=\'pm09\';
if pm00=pm11 then pmcode:=\'pm11\';
pmclose:=callstock(pmcode,vtCLOSE,6);
pmclose1:=callstock(pmcode,vtCLOSE,6,-1);
pm:=pmclose/pmclose1-1;
//新籼稻
ri00:=CALLSTOCK(\'ri00\',vtVOL,6,-1);
ri01:=CALLSTOCK(\'ri01\',vtVOL,6,-1);
ri03:=CALLSTOCK(\'ri03\',vtVOL,6,-1);
ri05:=CALLSTOCK(\'ri05\',vtVOL,6,-1);
ri07:=CALLSTOCK(\'ri07\',vtVOL,6,-1);
ri09:=CALLSTOCK(\'ri09\',vtVOL,6,-1);
ri11:=CALLSTOCK(\'ri11\',vtVOL,6,-1);

if ri00=ri01 then ricode:=\'ri01\';
if ri00=ri03 then ricode:=\'ri03\';
if ri00=ri05 then ricode:=\'ri05\';
if ri00=ri07 then ricode:=\'ri07\';
if ri00=ri09 then ricode:=\'ri09\';
if ri00=ri11 then ricode:=\'ri11\';
riclose:=callstock(ricode,vtCLOSE,6);
riclose1:=callstock(ricode,vtCLOSE,6,-1);
ri:=riclose/riclose1-1;

//菜粕
rm00:=CALLSTOCK(\'rm00\',vtVOL,6,-1);
rm01:=CALLSTOCK(\'rm01\',vtVOL,6,-1);
rm03:=CALLSTOCK(\'rm03\',vtVOL,6,-1);
rm05:=CALLSTOCK(\'rm05\',vtVOL,6,-1);
rm07:=CALLSTOCK(\'rm07\',vtVOL,6,-1);
rm09:=CALLSTOCK(\'rm09\',vtVOL,6,-1);
rm11:=CALLSTOCK(\'rm11\',vtVOL,6,-1);

if rm00=rm01 then rmcode:=\'rm01\';
if rm00=rm03 then rmcode:=\'rm03\';
if rm00=rm05 then rmcode:=\'rm05\';
if rm00=rm07 then rmcode:=\'rm07\';
if rm00=rm09 then rmcode:=\'rm09\';
if rm00=rm11 then rmcode:=\'rm11\';
rmclose:=callstock(rmcode,vtCLOSE,6);
rmclose1:=callstock(rmcode,vtCLOSE,6,-1);
rm:=rmclose/rmclose1-1;
//菜籽
rs00:=CALLSTOCK(\'rs00\',vtVOL,6,-1);
//rs01:=CALLSTOCK(\'rs01\',vtVOL,6,-1);
//rs03:=CALLSTOCK(\'rs03\',vtVOL,6,-1);
//rs05:=CALLSTOCK(\'rs05\',vtVOL,6,-1);

rs07:=CALLSTOCK(\'rs07\',vtVOL,6,-1);
rs08:=CALLSTOCK(\'rs08\',vtVOL,6,-1);
rs09:=CALLSTOCK(\'rs09\',vtVOL,6,-1);
rs11:=CALLSTOCK(\'rs11\',vtVOL,6,-1);

//if rs00=rs01 then rscode:=\'rs01\';
//if rs00=rs03 then rscode:=\'rs03\';
//if rs00=rs05 then rscode:=\'rs05\';
if rs00=rs07 then rscode:=\'rs07\';
if rs00=rs08 then rscode:=\'rs08\';
if rs00=rs09 then rscode:=\'rs09\';
if rs00=rs11 then rscode:=\'rs11\';
rsclose:=callstock(rscode,vtCLOSE,6);
rsclose1:=callstock(rscode,vtCLOSE,6,-1);
rs:=rsclose/rsclose1-1;


//白糖
srx01:=CALLSTOCK(\'srx01\',vtVOL,6,-1);
srx03:=CALLSTOCK(\'srx03\',vtVOL,6,-1);
srx05:=CALLSTOCK(\'srx05\',vtVOL,6,-1);
srx07:=CALLSTOCK(\'srx07\',vtVOL,6,-1);
srx09:=CALLSTOCK(\'srx09\',vtVOL,6,-1);
srx11:=CALLSTOCK(\'srx11\',vtVOL,6,-1);

sry01:=CALLSTOCK(\'srx01\',vtVOL,6,-1);
sry03:=CALLSTOCK(\'srx03\',vtVOL,6,-1);
sry05:=CALLSTOCK(\'srx05\',vtVOL,6,-1);
sry07:=CALLSTOCK(\'srx07\',vtVOL,6,-1);
sry09:=CALLSTOCK(\'srx09\',vtVOL,6,-1);
sry11:=CALLSTOCK(\'srx11\',vtVOL,6,-1);


//srclose:=callstock(srcode,vtCLOSE,6);
//srclose1:=callstock(srcode,vtCLOSE,6,-1);
//sr:=srclose/srclose1-1;


//pta
ta00:=callstock(\'ta00\',vtVOL,6,-1);
ta01:=callstock(\'ta01\',vtVOL,6,-1);
ta02:=callstock(\'ta02\',vtVOL,6,-1);
ta03:=callstock(\'ta03\',vtVOL,6,-1);
ta04:=callstock(\'ta04\',vtVOL,6,-1);
ta05:=callstock(\'ta05\',vtVOL,6,-1);
ta06:=callstock(\'ta06\',vtVOL,6,-1);
ta07:=callstock(\'ta07\',vtVOL,6,-1);
ta08:=callstock(\'ta08\',vtVOL,6,-1);
ta09:=callstock(\'ta09\',vtVOL,6,-1);
ta10:=callstock(\'ta10\',vtVOL,6,-1);
ta11:=callstock(\'ta11\',vtVOL,6,-1);
ta12:=callstock(\'ta12\',vtVOL,6,-1);
if ta00=ta01 then tacode:=\'ta01\';
if ta00=ta02 then tacode:=\'ta02\';
if ta00=ta03 then tacode:=\'ta03\';
if ta00=ta04 then tacode:=\'ta04\';
if ta00=ta05 then tacode:=\'ta05\';
if ta00=ta06 then tacode:=\'ta06\';
if ta00=ta07 then tacode:=\'ta07\';
if ta00=ta08 then tacode:=\'ta08\';
if ta00=ta09 then tacode:=\'ta09\';
if ta00=ta10 then tacode:=\'ta10\';
if ta00=ta11 then tacode:=\'ta11\';
if ta00=ta12 then tacode:=\'ta12\';
taclose:=callstock(tacode,vtCLOSE,6);
taclose1:=callstock(tacode,vtCLOSE,6,-1);
ta:=taclose/taclose1-1;
//新强麦
wh00:=CALLSTOCK(\'wh00\',vtVOL,6,-1);
wh01:=CALLSTOCK(\'wh01\',vtVOL,6,-1);
wh03:=CALLSTOCK(\'wh03\',vtVOL,6,-1);
wh05:=CALLSTOCK(\'wh05\',vtVOL,6,-1);
wh07:=CALLSTOCK(\'wh07\',vtVOL,6,-1);
wh09:=CALLSTOCK(\'wh09\',vtVOL,6,-1);
wh11:=CALLSTOCK(\'wh11\',vtVOL,6,-1);

if wh00=wh01 then whcode:=\'wh01\';
if wh00=wh03 then whcode:=\'wh03\';
if wh00=wh05 then whcode:=\'wh05\';
if wh00=wh07 then whcode:=\'wh07\';
if wh00=wh09 then whcode:=\'wh09\';
if wh00=wh11 then whcode:=\'wh11\';
whclose:=callstock(whcode,vtCLOSE,6);
whclose1:=callstock(whcode,vtCLOSE,6,-1);
wh:=whclose/whclose1-1;

//取出涨幅最大的
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=al 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',alcode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=cu 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',cucode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=fu 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',fucode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=pb 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',pbcode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=rb 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',rbcode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=ru 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',rucode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=wr 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',wrcode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=zn 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',zncode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=jt 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',jtcode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=jm 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',jmcode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=sl 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',slcode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=zl 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',zlcode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=jlyx 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',jlyxcode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=dy 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',dycode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=ym 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',ymcode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=de 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',decode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=d1 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',d1code); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=cf 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',cfcode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=fg 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',fgcode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=me 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',mecode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=oi 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',oicode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=pm 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',pmcode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=ri 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',ricode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=rm 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',rmcode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=rs 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',rscode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=ta 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',tacode); 
if max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(max(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=wh 
 and   time=151000 and holding=0 then    tbuy(1,1,lmt,close,0,\'\',whcode); 

//取出涨幅最小的
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=al 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',alcode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=cu 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',cucode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=fu 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',fucode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=pb 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',pbcode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=rb 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',rbcode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=ru 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',rucode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=wr 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',wrcode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=zn 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',zncode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=jt 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',jtcode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=jm 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',jmcode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=sl 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',slcode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=zl 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',zlcode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=jlyx 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',jlyxcode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=dy 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',dycode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=ym 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',ymcode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=de 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',decode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=d1 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',d1code);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=cf 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',cfcode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=fg 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',fgcode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=me 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',mecode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=oi 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',oicode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=pm 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',pmcode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=ri 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',ricode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=rm 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',rmcode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=rs 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',rscode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=ta 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',tacode);  
if min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(min(al,cu),fu),pb),rb),ru),wr),zn),jt),jm),sl),db),zl),jlyx),dy),ym),de),d1),cf),fg),me),oi),pm),ri),rm),rs),ta),wh)=wh 
 and   time=151000 and holding=0 then    tbuyshort(1,1,lmt,close,0,\'\',whcode);  

if holding<>0 and time=150000 then 
  tsell(1,holding,lmt,close,0,\'\',alcode);
  tsellshort(1,holding,lmt,close,0,\'\',alcode);
    tsell(1,holding,lmt,close,0,\'\',cucode);
  tsellshort(1,holding,lmt,close,0,\'\',cucode);
    tsell(1,holding,lmt,close,0,\'\',fucode);
  tsellshort(1,holding,lmt,close,0,\'\',fucode); 
    tsell(1,holding,lmt,close,0,\'\',pbcode);
  tsellshort(1,holding,lmt,close,0,\'\',pbcode);
    tsell(1,holding,lmt,close,0,\'\',rbcode);
  tsellshort(1,holding,lmt,close,0,\'\',rbcode);
    tsell(1,holding,lmt,close,0,\'\',rucode);
  tsellshort(1,holding,lmt,close,0,\'\',rucode);
    tsell(1,holding,lmt,close,0,\'\',wrcode);
  tsellshort(1,holding,lmt,close,0,\'\',wrcode);
    tsell(1,holding,lmt,close,0,\'\',zncode);
  tsellshort(1,holding,lmt,close,0,\'\',zncode);
    tsell(1,holding,lmt,close,0,\'\',jtcode);
  tsellshort(1,holding,lmt,close,0,\'\',jtcode);
    tsell(1,holding,lmt,close,0,\'\',jmcode);
  tsellshort(1,holding,lmt,close,0,\'\',jmcode);
    tsell(1,holding,lmt,close,0,\'\',slcode);
  tsellshort(1,holding,lmt,close,0,\'\',slcode);
    tsell(1,holding,lmt,close,0,\'\',dbcode);
  tsellshort(1,holding,lmt,close,0,\'\',dbcode);
    tsell(1,holding,lmt,close,0,\'\',zlcode);
  tsellshort(1,holding,lmt,close,0,\'\',zlcode);
    tsell(1,holding,lmt,close,0,\'\',jlyxcode);
  tsellshort(1,holding,lmt,close,0,\'\',jlyxcode);
    tsell(1,holding,lmt,close,0,\'\',dycode);
  tsellshort(1,holding,lmt,close,0,\'\',dycode);
    tsell(1,holding,lmt,close,0,\'\',ymcode);
  tsellshort(1,holding,lmt,close,0,\'\',ymcode);
      tsell(1,holding,lmt,close,0,\'\',decode);
  tsellshort(1,holding,lmt,close,0,\'\',decode);
      tsell(1,holding,lmt,close,0,\'\',d1code);
  tsellshort(1,holding,lmt,close,0,\'\',d1code);
      tsell(1,holding,lmt,close,0,\'\',cfcode);
  tsellshort(1,holding,lmt,close,0,\'\',cfcode);
      tsell(1,holding,lmt,close,0,\'\',fgcode);
  tsellshort(1,holding,lmt,close,0,\'\',fgcode);
      tsell(1,holding,lmt,close,0,\'\',mecode);
  tsellshort(1,holding,lmt,close,0,\'\',mecode);
      tsell(1,holding,lmt,close,0,\'\',oicode);
  tsellshort(1,holding,lmt,close,0,\'\',oicode);
      tsell(1,holding,lmt,close,0,\'\',pmcode);
  tsellshort(1,holding,lmt,close,0,\'\',pmcode);
        tsell(1,holding,lmt,close,0,\'\',ricode);
  tsellshort(1,holding,lmt,close,0,\'\',ricode);
        tsell(1,holding,lmt,close,0,\'\',rmcode);
  tsellshort(1,holding,lmt,close,0,\'\',rmcode);
        tsell(1,holding,lmt,close,0,\'\',rscode);
  tsellshort(1,holding,lmt,close,0,\'\',rscode);
          tsell(1,holding,lmt,close,0,\'\',tacode);
  tsellshort(1,holding,lmt,close,0,\'\',tacode);
tsell(1,holding,lmt,close,0,\'\',whcode);
  tsellshort(1,holding,lmt,close,0,\'\',whcode);
  
  
我的想法就是找出所有商品期货中前一天涨幅最大跟跌幅最大的两只主力股,然后一个开多一个开空。
麻烦看是看下。哪边有错。


--  作者:jinzhe
--  发布时间:2013/8/1 9:22:39
--  
为什么用holding?你这里没有用图表函数,holding是取不到值的
--  作者:vermouth
--  发布时间:2013/8/1 9:40:15
--  
以下是引用jinzhe在2013/8/1 9:22:39的发言:
为什么用holding?你这里没有用图表函数,holding是取不到值的
不用holding怎么确认只买一手。


--  作者:lichenghu
--  发布时间:2013/8/1 9:45:24
--  
您好,您这是后台交易系统,可以用tho1ding取账户真实持仓!holding虚拟持仓只对图表交易系统有效
--  作者:vermouth
--  发布时间:2013/8/1 10:05:39
--  
以下是引用lichenghu在2013/8/1 9:45:24的发言:
您好,您这是后台交易系统,可以用tho1ding取账户真实持仓!holding虚拟持仓只对图表交易系统有效
除了这个基本没有错误了是吧。


--  作者:vermouth
--  发布时间:2013/8/1 10:18:22
--  
顺便问下。这个可以进行公式评测么。涉及到了这么多的商品期货