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


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

   

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


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

主题:[求助]移动止盈问题

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


加好友 发短信
等级:论坛游侠 帖子:227 积分:614 威望:0 精华:0 注册:2013/2/5 16:21:44
[求助]移动止盈问题  发帖心情 Post By:2013/5/13 14:01:41    Post IP:220.161.150.162[只看该作者]

//移动止盈
//多单
variable:win=0;
if 开多条件 and holding=0 then begin
BUY(1,手数,THISCLOSE);;
win:=c-enterprice;
end
 
if c-enterprice>win then win:=c-enterprice;
if win>=10 and c-enterprice<=3 then sell(1,0,THISCLOSE);
if win>=15 and c-enterprice<=6 then sell(1,0,THISCLOSE);
if win>=20 and c-enterprice<=12 then sell(1,0,THISCLOSE);
if win>=25 and c-enterprice<=20 then sell(1,0,THISCLOSE);

//空单
variable:win1=0;
if 开空条件 and holding=0 then begin
BUYSHORT(1,手数,THISCLOSE);
win1:=enterprice-c;
end
 
if enterprice-c>win1 then win1:=enterprice-c;
if win1>=10 and enterprice-c<=5 then sellshort(1,0,THISCLOSE);
if win1>=15 and enterprice-c<=6 then sellshort(1,0,THISCLOSE);
if win1>=20 and enterprice-c<=12 then sellshort(1,0,THISCLOSE);
if win1>=25 and enterprice-c<=20 then sellshort(1,0,THISCLOSE);



为什么没有起作用   怎么修改

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


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

什么合约?10这个是点位?


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

客户服务部

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

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

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


加好友 发短信
等级:论坛游侠 帖子:227 积分:614 威望:0 精华:0 注册:2013/2/5 16:21:44
  发帖心情 Post By:2013/5/13 14:09:52    Post IP:220.161.150.162[只看该作者]

股指   10点是点位 

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


加好友 发短信
等级:超级版主 帖子:3534 积分:10003 威望:0 精华:5 注册:2012/5/25 0:00:01
  发帖心情 Post By:2013/5/13 15:22:27    Post IP:58.246.57.26[只看该作者]

请问哪里不起作用,凭什么说不起作用?

 

手数:1;
ma5:=ma(c,5);
ma20:=ma(c,20);
开多条件:=cross(ma5,ma20);
开空条件:=cross(ma20,ma5);

//移动止盈
//多单
variable:win=0;
if 开多条件 and holding=0 then begin
BUY(1,手数,THISCLOSE);;
win:=c-enterprice;
end
 
if c-enterprice>win then win:=c-enterprice;
if win>=10 and c-enterprice<=3 then 平多1:sell(1,0,THISCLOSE);
if win>=15 and c-enterprice<=6 then 平多2:sell(1,0,THISCLOSE);
if win>=20 and c-enterprice<=12 then 平多3:sell(1,0,THISCLOSE);
if win>=25 and c-enterprice<=20 then 平多4:sell(1,0,THISCLOSE);


//空单
variable:win1=0;
if 开空条件 and holding=0 then begin
BUYSHORT(1,手数,THISCLOSE);
win1:=enterprice-c;
end
 
if enterprice-c>win1 then win1:=enterprice-c;
if win1>=10 and enterprice-c<=5 then 平空1:sellshort(1,0,THISCLOSE);
if win1>=15 and enterprice-c<=6 then 平空2:sellshort(1,0,THISCLOSE);
if win1>=20 and enterprice-c<=12 then 平空3:sellshort(1,0,THISCLOSE);
if win1>=25 and enterprice-c<=20 then 平空4:sellshort(1,0,THISCLOSE);

if time>=145500 then BEGIN
收盘多:sell(1,0,market);
收盘空:sellshort(1,0,market);
end

 

 


图片点击可在新窗口打开查看此主题相关图片如下:搜狗截图13年05月13日1522_1.png
图片点击可在新窗口打开查看

 

 

不起作用,哪来的平1 平2 等等

[此贴子已经被作者于2013-5-13 15:23:09编辑过]


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

产品部

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

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

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com
 回到顶部
帅哥哟,离线,有人找我吗?
rfgvb
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:227 积分:614 威望:0 精华:0 注册:2013/2/5 16:21:44
  发帖心情 Post By:2013/5/13 16:31:15    Post IP:220.161.150.162[只看该作者]

好的  谢谢  我再试试

 回到顶部