大豆-豆粕的套利(大豆只做空,豆粕只做多),
作者:未知 來源:本站原創(chuàng) 發(fā)布時間:2017年08月19日
: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">一個大豆-豆粕的套利(大豆只做空,豆粕只做多),代碼如下:: none; color: rgb(85,85,85); font-style: normal; widows: 1; letter-spacing: normal; line-height: 18px; background-color: rgb(246,249,251); text-indent: 0px; -webkit-text-stroke-width: 0px">DD:="AX09$CLOSE";
DP:="M09$CLOSE";
diff:=DD-DP;
if?strcmp(stklabel,\'M09\')?=?0?then?
begin
buy(diff>1200?and?holding=0,1,limitr,C);
sell(diff<=600,1,limitr,C);
end
if?strcmp(stklabel,\'AX09\')?=?0?then
begin
buyshort(diff>1200?and?holding=0,1,limitr,C);
sellshort(diff<=600,1,limitr,C);
end