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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 开平仓问题

   

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


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

主题:开平仓问题

帅哥哟,离线,有人找我吗?
系统使用者
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:黑侠 帖子:808 积分:667 威望:0 精华:0 注册:2011/4/9 16:17:57
开平仓问题  发帖心情 Post By:2017/3/30 10:50:52    Post IP:110.184.34.153[只看该作者]

VARIABLE:bj=0; 

if aspect=0 and holding=0 and bj=0 then begin
     bj:=1;
     buy(1,1,thisclose);
end
if H>=PBUY and C>=MAX(O,PBUY) AND MA1>REF(MA1,1) and holding=0  and bj=0 then begin
     bj:=2;
     buy(1,1,thisclose);
end
  
if aspect=1 and holding>0 and bj=1 then begin
    sell(1,0,thisclose);
    bj:=0;
end 
if C<stopprice and holding>0 and bj=2 then begin
    sell(1,0,thisclose);
    bj:=0;
end

if aspect=1 and holding=0 and bj=0 then begin
     bj:=1;
     BUYSHORT(1,1,thisclose);
end
if L<=PSELL and C<=MIN(O,PSELL) AND MA1<REF(MA1,1) and bj=0 then begin
     bj:=2;
     BUYSHORT(1,1,thisclose);
end
  
if aspect=1 and holding>0 and bj=1 then begin
    SELLSHORT(1,0,thisclose);
    bj:=0;
end 
if C<stopprice and holding>0 and bj=2 then begin
    SELLSHORT(1,0,thisclose);
    bj:=0;
end

k1的多单子用p1平仓
k2的多单子用p2平仓

Q1的空单子用D1平仓
Q2的空单子用D2平仓
开空同理。

 回到顶部