龙听期货论坛's Archiver

龙听 发表于 2018-9-30 13:24

大豆-豆粕的套利(大豆只做空,豆粕只做多)

[color=#212121][font=宋体, Arial, Helvetica, sans-serif][size=14px]一个大豆-豆粕的套利(大豆只做空,豆粕只做多),代码如下:[/size][/font][/color]

[color=#212121][font=宋体, Arial, Helvetica, sans-serif][size=14px][code]
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
[/code]
[/size][/font][/color]

页: [1]