欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → [求助]后台交易

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有2009人关注过本帖平板打印复制链接

主题:[求助]后台交易

帅哥哟,离线,有人找我吗?
qwer123
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小飞侠 帖子:1966 积分:0 威望:0 精华:1 注册:2013/6/15 21:56:35
[求助]后台交易  发帖心情 Post By:2018/4/13 9:59:27    Post IP:61.173.250.231[只看该作者]

后台用的不很多,下面的编程能否满足我的要求?这是一种挂单交易方法。

有4种信号:1平空开多AA;2平多开空BB;3止损平空开多CC;4止损平多开空DD;

1.当出现AA时,实际持仓>0,如果有平多开空挂单,撤掉挂单;
    实际持仓<=0,平空开多;
2.当出现BB时,实际持仓<0,如果有平空开多的挂单,撤单;
   实际持仓>=0 平多开空;
出现CC,DD,同AA,BB处理;

//********************************
if AA then
begin
if tisremain(2)>0.5 then tcancel(1,2);
if tisremain(3)>0.5 then tcancel(1,3);
end

if BB  then
begin
if tisremain(4)>0.5 then tcancel(1,4);
if tisremain(1)>0.5 then tcancel(1,1);
end
//********************************
if tholding2<=0 and AA then
begin
tsellshort(1,0,lmt,C-nn2),NOATTACK;
tbuy(1,tn,lmt,C-nn2),NOATTACK;
end

if tholding2>=0 and BB then
begin
tsell(1,0,lmt,C+nn2),NOATTACK;
tbuyshort(1,tn,C+nn2),NOATTACK;
end

//****************************
if tholding2<0 and CC then
begin
if tisremain(4)>0.5 then tcancel(1,4);
if tisremain(1)>0.5 then tcancel(1,1);
tsellshort(1,0,mkt);
tbuy(1,tn,mkt);
end

if tholding2>0 and DD then
begin
if tisremain(2)>0.5 then tcancel(1,2);
if tisremain(3)>0.5 then tcancel(1,3);
tsell(1,0,mkt);
tbuyshort(1,tn,mkt);
end

//***************************** 

如果我手工挂单,tisremain能识别吗?


 回到顶部