多空单是手工下的?
if 开多条件 and 持仓判断 then BEGIN
tbuy(1,1,mkt);
extgbdataset('b1',dynainfo(7));
end
if 开空条件 and 持仓判断 then begin
tbuyshort(1,1,mkt);
extgbdataset('s1',dynainfo(7));
end
if dynainfo(7)=(extgbdata('s1')+1) and 持仓判断 then begin
tsellshort(1,0,mkt);
extgbdataset('s1',extgbdata('s1')+2);
end
if dynainfo(7)=(extgbdata('b1')+1) and 持仓判断 then BEGIN
tsell(1,0,mkt);
extgbdatset('b1',extgbdata('b1'+2));
end
if dynainfo(7)=(extgbdata('s1')-1) and 持仓判断 then begin
tsellshort(1,0,mkt);
extgbdataset('s1',extgbdata('s1')-2);
end
if dynainfo(7)=(extgbdata('b1')-1) and 持仓判断 then BEGIN
tsell(1,0,mkt);
extgbdatset('b1',extgbdata('b1'-2));
end
40秒撤单用系统自带的功能实现
if 开多条件 and 持仓判断 then BEGIN if dynainfo(7)=(extgbdata('s1')+1) and 持仓判断 then begin if dynainfo(7)=(extgbdata('b1')+2) and 持仓判断 then BEGIN //这里是+2,不是+1 |
后台交易: / 假设多单空单对锁同样的数量单子,多单买价为B1,空单卖价为S1。 // 1)如果最新价= S1 +1,报S1+1平空; // 2)如果成交,平仓价变成报:空单平仓价 +2,依次把上次平仓价变成+2,…+n; / // 4)如果最新价= B1 +2,报B1+2平多; // 5)如果成交, 平仓价 变成报 :多单平仓价 +2,依次把上次平仓价变成+2,…+n;// // 6) 相反, 7)如果最新价= S1 -2,报S1-2平空; 8)如果成交,平仓价变成报:空单平仓价 -2,依次把上次平仓价变成-2,…-n; 9)如果最新价= B1 -1,报B1-1平多; 10)如果成交, 平仓价 变成报 :多单平仓价 -2,依次把上次平仓价变成-2,…-n;// 是这样的,上面的笔误。对不起。 |