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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 平仓信号出现白箭头

   

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


  共有2983人关注过本帖树形打印复制链接

主题:平仓信号出现白箭头

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


加好友 发短信
等级:论坛游民 帖子:169 积分:0 威望:0 精华:0 注册:2016/8/28 16:11:16
平仓信号出现白箭头  发帖心情 Post By:2016/11/16 9:31:28    Post IP:116.29.227.163[只看该作者]



平仓信号出现白箭头,是什么原因?
平仓逻辑清晰:1,持仓enterbars>1 ,持仓周期大于3周期收盘价平仓;
                    2,止盈h>=enterprice+p2/1000*enterprice 
                              l>=enterprice-p2/1000*enterprice 
                             最高价或最低价达到指定价平仓
                    3,止损l<=enterprice-p1/1000*enterprice 
                              h>=enterprice+p1/1000*enterprice 
                               最低价或最高价达到指定价平仓
if holding>0 then begin 
        if enterbars>1 then begin 
           sell(1,holding,limitr,close);
           //sell(1,holding,marketr);
           myexitprice:=0; 
          end
     if h>=enterprice+p2/1000*enterprice then begin
        myexitprice:=enterprice+p2/1000*enterprice;
        //sell(1,holding,marketr); 
        sell(1,holding,limitr,myexitprice); 
         myexitprice:=0;
       end
    
      if l<=enterprice-p1/1000*enterprice then begin
         myexitprice:=enterprice-p1/1000*enterprice;
         //sell(1,holding,marketr); 
        sell(1,holding,limitr,myexitprice); 
         myexitprice:=0;
       end 
    end
 

//盈亏计算 
     if holding<0 then begin
       if enterbars>1 then begin 
          sellshort(1,holding,limitr,close);
          //sellshort(1,holding,marketr);
          myexitprice:=0;
         end
      if l>=enterprice-p2/1000*enterprice then begin
         myexitprice:=enterprice-p2/1000*enterprice;
         //sellshort(1,holding,marketr); 
         sellshort(1,holding,limitr,myexitprice); 
         myexitprice:=0;
       end
   
      if h>=enterprice+p1/1000*enterprice then begin
         myexitprice:=enterprice+p1/1000*enterprice;
         //sellshort(1,holding,marketr); 
         sellshort(1,holding,limitr,myexitprice); 
         myexitprice:=0;
       end 
    end

 回到顶部
帅哥哟,离线,有人找我吗?
jinzhe
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2016/11/16 9:36:17    Post IP:101.88.239.241[只看该作者]

平仓有白色箭头说明平仓时的价格超过了k线范围,不易成交

IGNORECHECKPRICE来处理,使用方法看函数说明



金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

 回到顶部
帅哥哟,离线,有人找我吗?
风度翩翩
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:194 积分:0 威望:0 精华:0 注册:2012/12/28 17:19:34
  发帖心情 Post By:2016/11/16 10:30:25    Post IP:119.78.5.78[只看该作者]

楼主 跳空 导致 价格 不在你想的价格,成交不了啊,要考虑实际些 跳空 

 回到顶部
帅哥哟,离线,有人找我吗?
tanyongde
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游民 帖子:169 积分:0 威望:0 精华:0 注册:2016/8/28 16:11:16
  发帖心情 Post By:2016/11/16 11:09:02    Post IP:183.43.148.64[只看该作者]

      1,很奇怪回测多头没有白箭头,只有空头止盈才会有!!!
     
       2,止盈指令没有用,不管参数多少结果一样
       
       3,止盈编写有问题?

 回到顶部
帅哥哟,离线,有人找我吗?
jinzhe
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2016/11/16 11:31:22    Post IP:180.169.30.6[只看该作者]

以下是引用jinzhe在2016-11-16 9:36:17的发言:

平仓有白色箭头说明平仓时的价格超过了k线范围,不易成交

IGNORECHECKPRICE来处理,使用方法看函数说明

首先白色箭头的机制是这样的。

然后就回去检查下为什么空价格却超过了k线范围

 l>=enterprice-p2/1000*enterprice

h>=enterprice+p1/1000*enterprice

 

平空条件是这两个,其中第一个,除非L恰好等于enterprice-p2/1000*enterprice ,不然enterprice-p2/1000*enterprice 的价格必然是比L低的,所以,白色箭头这个不合理的价格出现的

所以这一段这样改:

if l>=enterprice-p2/1000*enterprice then begin

         myexitprice:=enterprice-p2/1000*enterprice;
         //sellshort(1,holding,marketr); 
         sellshort(1,holding,limitr,L); 
         myexitprice:=0;
end
 
 


金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

 回到顶部