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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件金字塔软件问题提交 → 调试有执行到语句却没显示

   

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


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

主题:调试有执行到语句却没显示

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


加好友 发短信
等级:新手上路 帖子:23 积分:0 威望:0 精华:0 注册:2013/12/10 17:30:43
调试有执行到语句却没显示  发帖心情 Post By:2013/12/13 11:13:07 [显示全部帖子]

开仓价3583,止盈价3613,第二根k线最高价3621(大于止盈价应该止盈),却没止盈操作,调试时有进入止盈卖出函数啊


源码如下:

图片点击可在新窗口打开查看此主题相关图片如下:f.jpg
图片点击可在新窗口打开查看

input : length(10,10,30,10),lots(1,1,10,1);
input : stoplos(20,20,100,10),stopwin(30,10,100,10);
uppband : ref(hhv(high,length),1);
lowband : ref(llv(low,length),1);
if high > uppband && holding = 0 then
buy(1,lots,limitr,open),ignorecheckprice;//开多仓
else if low < lowband && holding = 0 then
buyshort(1,lots,limitr,open); //开空仓
if holding = 1 && enterbars >= 0 then
 begin
    stoploslin := enterprice - stoplos * mindiff; //止损线
    if low < stoploslin then  
     begin
       myexitprice := stoploslin;
       if open < stoploslin then
       myexitprice  := open;
       sell(1,0,limitr,myexitprice);  //平多仓
     end 
     
     stopwinlin := enterprice + stopwin * mindiff; //止盈线
     if high > stopwinlin then
      begin
      myexitprice := stopwinlin;
      if open > stopwinlin then
      myexitprice := open;
      sell(1,0,limitr,myexitprice);
      end  
 end 
   
else if holding = -1 && enterbars >= 0 then
begin
stoploslin := enterprice + stoplos * mindiff;  //止损线
if high > stoploslin then
begin
  myexitprice := stoploslin; 
  if open > stoploslin then
  myexitprice := open; 
  sellshort(1,0,limitr,myexitprice);
end
 
    stopwinlin := enterprice - stopwin * mindiff;  //止盈线
if low < stopwinlin then
begin
  myexitprice := stopwinlin;
  if open < stopwinlin  then
  myexitprice := open;
  sellshort(1,0,limitr,myexitprice);
end  
end



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


加好友 发短信
等级:新手上路 帖子:23 积分:0 威望:0 精华:0 注册:2013/12/10 17:30:43
  发帖心情 Post By:2013/12/13 11:26:08 [显示全部帖子]

我把  sellshort(1,0,limitr,myexitprice);l改成sellshort(1,0,market);就可以,这什么原因啊

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


加好友 发短信
等级:新手上路 帖子:23 积分:0 威望:0 精华:0 注册:2013/12/10 17:30:43
  发帖心情 Post By:2013/12/13 11:31:09 [显示全部帖子]


图片点击可在新窗口打开查看此主题相关图片如下:f.jpg
图片点击可在新窗口打开查看
你看下与之前图区别,第二张有平仓,第一张没平仓,只是把limit改成market
[此贴子已经被作者于2013/12/13 11:32:15编辑过]

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


加好友 发短信
等级:新手上路 帖子:23 积分:0 威望:0 精华:0 注册:2013/12/10 17:30:43
  发帖心情 Post By:2013/12/13 13:33:01 [显示全部帖子]

可以,但怎么不能成交呢,最高价为3600,而限价为3574

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


加好友 发短信
等级:新手上路 帖子:23 积分:0 威望:0 精华:0 注册:2013/12/10 17:30:43
  发帖心情 Post By:2013/12/13 13:39:01 [显示全部帖子]

最低价3550,在范围内啊

 回到顶部