variable:n=1;
et1:=TAVGENTERPRICEEX2('' , '', 0);//多头持仓均价
et2:=TAVGENTERPRICEEX2('' , '', 1);//空头持仓均价
if THOLDING2>0 then begin
n:=n+1;
end
if mod(open-(et2+1),2)=0 then tsellshort(1,5,lmt,et2+1,0);
if mod(open-(et1+2),2)=0 then tsell(1,5,lmt,et1+2,0);
if mod(open-(et2+n),2)=0 then tsellshort(1,5,lmt,(et2+n),0);
if mod(open-((et1+n)+1),2)=0 then tsell(1,5,lmt,((et1+n)+1),0);
要求这样循环的.
初始第一次平空为et2+1,当第二次平空是(et2+1)+1,继续循环时,以此类推。
初始第一次平多为 et1+2,,当第二次平多是 (et1+2)+1,继续循环时,以此类推。
如何才能做到一个价位不在 重复下单?
用VBA可以不可以?
用vba是肯定可以的,使用ini文件或全局变量来标识没一个价位的交易状态。
后台交易程序:
1)当下持仓为多单100手,空单100手,对锁中。价位3130;
2)若上涨1个点位要求系统减仓5手空单,上涨3个点位要求系统自动减仓5手多单。这样的循环;
3)若下跌1个点位要求系统自动减仓5手多单,下跌3个点位要求系统自动减仓5手空单,这样的循环。
4)一直到减仓完毕。
5)挂单后40秒不成交自动撤单,并且当下价位直接平掉单腿。要求持仓同步。
-----若上涨1个点位要求系统减仓5手空单,上涨3个点位要求系统自动减仓5手多单。这样的循环;
多空点差保持2点的意思;
就是说比如:当下持仓为多单100手,空单100手,对锁中。价位3130;
3231减空单5手,涨到3233减多单5手;
3234减空单5手,涨到3236减多单5手;
3237减空单5手,涨到3239减多单5手;
多空点差保持2点的这样循环
variable:n=1;
if (TIME>=085600 AND TIME<=90000) then begin
tbuy(1,10,lmt,DYNAINFO(54),0);
tbuyshort(1,10,lmt,DYNAINFO(55),0);
end
if THOLDING2<0 and (time<145000) then begin
tbuy(val2>0,10,lmt,o,0);
tbuyshort(val2>0,10,lmt,o,0);
end
et1:=TAVGENTERPRICEEX2('' , '', 0);//多头持仓均价
et2:=TAVGENTERPRICEEX2('' , '', 1);//空头持仓均价
if THOLDING2>0 then begin
n:=n+1;
end
if mod(open-(et2+1),2)=0 then tsellshort(1,1,lmt,et2+1,0);
if mod(open-(et1+2),2)=0 then tsell(1,1,lmt,et1+2,0);
if mod(open-(et2+n),2)=0 then tsellshort(1,1,lmt,(et2+n),0);
if mod(open-((et1+n)+1),2)=0 then tsell(1,1,lmt,((et1+n)+1),0);
if mod((et1-1)-open,2)=0 then tsell(1,1,lmt,et1-1,0);
if mod((et2-2)-open,2)=0 then tsellshort(1,1,lmt,et2-2,0);
if mod((et1-n)-open,2)=0 then tsell(1,1,lmt,(et1-n),0);
if mod(((et2-n)-1)-open,2)=0 then tsellshort(1,1,lmt,(et2-n)-1,0);
//撤单
tm:=50;//撤单时间秒
if tisremain(0)>0 and tsubmit(0)>tm then begin
tcancel(1,0);
end
tsell(1,1,mkt);
tsellshort(1,1,mkt);
//收盘平仓
if CURRENTTIME>=151300 and currenttime<=151400 then begin
tsell(1,0,mkt);
tsellshort(1,0,mkt);
end
要求这样循环的.
初始第一次平空为et2+1,当第二次平空是(et2+1)+1,继续循环时,以此类推。
初始第一次平多为 et1+2,,当第二次平多是 (et1+2)+1,继续循环时,以此类推。
[此贴子已经被作者于2014/5/21 23:30:12编辑过]
您的需求超出了我们客服的能力范围。
建议您尝试自行编写一下,注意一定要学会后台程序的调试,即多使用DEBUGFILE函数调试。
或者您可以考虑一下付费的策略编写服务