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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 加入止盈止损后 出现问题

   

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


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

主题:加入止盈止损后 出现问题

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


加好友 发短信 量化投资
等级:论坛游民 帖子:148 积分:653 威望:0 精华:0 注册:2010/9/27 16:08:27
加入止盈止损后 出现问题  发帖心情 Post By:2011/11/8 17:12:58    Post IP:116.25.200.174[只看该作者]

加入止盈止损后  出现问题

runmode:0;

dayopen:=valuewhen(date>ref(date,1),o);

upperband:dayopen+dayopen*0.005;
dnband:dayopen-dayopen*0.005;
centre:(upperband+dnband)/2;
enterlongcond:=high>=upperband;
entershortcond:=low<=dnband;

atr:=ref(ma(tr,10),1);

exittime:=time>1458;


   if enterlongcond and time<=145800 then begin
   sellshort(holding<0 and enterbars>=1,1,limitr,upperband);
   buy(holding=0,1,limitr,upperband);
   end
  
   if entershortcond and time<=145800 then begin
   sell(holding>0 and enterbars>=1,1,limitr,dnband);
   buyshort(holding=0,1,limitr,dnband);
   end

//止损
if ref(c,1)>centre then sellshort(holding<0,holding,limitr,centre+mindiff);
if ref(c,1)<centre then sell(holding>0,holding,limitr,centre-mindiff);

//止盈
if ref(c,1)>enterprice+atr then sell(holding>0,holding,limitr,thisclose);
if ref(c,1)<enterprice-atr then sellshort(holding<0,holding,limitr,thisclose);


if exittime then begin
   sell(holding>0,1,thisclose);
   sellshort(holding<0,1,thisclose);
end


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


加好友 发短信
等级:管理员 帖子:5082 积分:17642 威望:0 精华:6 注册:2010/7/15 9:05:58
  发帖心情 Post By:2011/11/8 17:19:05    Post IP:58.246.57.26[只看该作者]

1.金字塔的时间,都是6位数

 

2.直接用centre+mindiff去发委托单,centre是最小变动价位的整数倍吗?



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

客户服务部

-----------------------------------------------------------

欢迎您参加我公司的技术培训,具体培训需求请发邮件到

service@weistock.com

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

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


加好友 发短信
等级:黑侠 帖子:676 积分:2548 威望:0 精华:3 注册:2011/4/13 16:18:50
  发帖心情 Post By:2011/11/8 17:20:18    Post IP:58.246.57.26[只看该作者]

什么问题 说明一下.

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


加好友 发短信 量化投资
等级:论坛游民 帖子:148 积分:653 威望:0 精华:0 注册:2010/9/27 16:08:27
  发帖心情 Post By:2011/11/8 17:36:10    Post IP:116.25.200.174[只看该作者]

我换成close发委托  ,依然很多  白色无效信号, 所有问题都是加入止盈控制语句后出现
[此贴子已经被作者于2011-11-8 17:37:45编辑过]

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


加好友 发短信 量化投资
等级:论坛游民 帖子:148 积分:653 威望:0 精华:0 注册:2010/9/27 16:08:27
  发帖心情 Post By:2011/11/9 9:20:25    Post IP:58.60.218.95[只看该作者]

顶一下 请高手们回复


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


加好友 发短信
等级:管理员 帖子:5082 积分:17642 威望:0 精华:6 注册:2010/7/15 9:05:58
  发帖心情 Post By:2011/11/9 9:32:38    Post IP:58.246.57.26[只看该作者]

1.金字塔的时间,都是6位数

2.直接去发委托单的价格,一定要是最小变动价位的整数倍.

   你可以用小数位为奇数的去手工下个个IF的单子,看看效果如果

3.注意看BUY等下单函数及其各个参数.

 

runmode:0;

dayopen:=valuewhen(date>ref(date,1),o);

upperband:dayopen+dayopen*0.005;
dnband:dayopen-dayopen*0.005;
centre:(upperband+dnband)/2;
enterlongcond:=high>=upperband;
entershortcond:=low<=dnband;

atr:=ref(ma(tr,10),1);


   if enterlongcond and time<=145800 then begin
   sellshort(holding<0 and enterbars>=1,1,limitr,c+2*mindiff);
   buy(holding=0,1,limitr,c+2*mindiff);
   end
  
   if entershortcond and time<=145800 then begin
   sell(holding>0 and enterbars>=1,1,limitr,c-2*mindiff);
   buyshort(holding=0,1,limitr,c-2*mindiff);
   end

//止损
if ref(c,1)>centre then sellshort(holding<0,holding,limitr,c+2*mindiff);
if ref(c,1)<centre then sell(holding>0,holding,limitr,c-2*mindiff);

//止盈
if ref(c,1)>enterprice+atr then sell(holding>0,holding,market);
if ref(c,1)<enterprice-atr then sellshort(holding<0,holding,market);


if time>=145800 then begin
   sell(holding>0,1,thisclose);
   sellshort(holding<0,1,thisclose);
end



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

客户服务部

-----------------------------------------------------------

欢迎您参加我公司的技术培训,具体培训需求请发邮件到

service@weistock.com

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

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


加好友 发短信 量化投资
等级:论坛游民 帖子:148 积分:653 威望:0 精华:0 注册:2010/9/27 16:08:27
  发帖心情 Post By:2011/11/9 14:58:06    Post IP:58.60.218.95[只看该作者]

我想确认一下我的模型逻辑是没问题的?     先是两个正反手指令,然后加入止损,再加入入止盈指令。     是否止盈止损指令可以加入到正反手的指令里?

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


加好友 发短信
等级:管理员 帖子:5082 积分:17642 威望:0 精华:6 注册:2010/7/15 9:05:58
  发帖心情 Post By:2011/11/9 15:24:18    Post IP:58.246.57.26[只看该作者]

模型逻辑是没问题的.

 

 是否止盈止损指令可以加入到正反手的指令里?

 加入进去干什么,难道你的止盈止损指令也要满足你正反手指令的条件.

 



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

客户服务部

-----------------------------------------------------------

欢迎您参加我公司的技术培训,具体培训需求请发邮件到

service@weistock.com

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

 回到顶部