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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件策略编写求助区 → 求我的日内止损策略编程

   

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


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

主题:求我的日内止损策略编程

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


加好友 发短信
等级:金字塔养老院 帖子:1323 积分:6764 威望:0 精华:0 注册:2011/6/14 17:27:11
  发帖心情 Post By:2011/11/7 10:08:17 [显示全部帖子]

在写,稍后回复



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

客户服务部

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

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

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


加好友 发短信
等级:金字塔养老院 帖子:1323 积分:6764 威望:0 精华:0 注册:2011/6/14 17:27:11
  发帖心情 Post By:2011/11/7 16:42:35 [显示全部帖子]

variable:aa=0,bb=0,kd=0,kk=0;
long:=c>o and time>090100 and time<145000;
short:=o>c and time>090100 and time<145000;

//开多
if long and aa=0 then
begin
buy(holding=0,1,thisclose);
aa:=1;
kd:=open;
end

//平多反手
if aa=1 and c<kd then
 begin
    sell(holding>0,1,market);
 aa:=0;
 buyshort(holding=0,1,thisclose);
 end

//开空
if short and bb=0 then
 begin
 buyshort(holding=0,1,thisclose);
 bb:=1;
 kk:=close;
 end

//平空反手
if bb and c>kk then
 begin
 sellshort(holding<0,0,market);
 bb:=0;
 buy(holding=0,1,thisclose);
 end
//多仓止损
if holding>0 and enterbars>1 and c<enterprice-20*mindiff then
止损:sell(1,0,market);
//多仓止盈
if holding>0 and enterbars>1 and c>enterprice+10*mindiff then
止盈:sell(1,0,market);


//空仓止损
if holding<0 and enterbars>1 and c>enterprice+20*mindiff then
空损:sellshort(1,0,market);
//空仓止盈
if holding<0 and enterbars>1 and c<enterprice-10*mindiff then
空盈:sellshort(1,0,market);

if time>=145500 then
begin
sell(holding>0,0,market);
sellshort(holding<0,0,market);
end

if time>=150000 then
begin
aa:=0;
bb:=0;
kd:=0;
kk:=0;
end

 

由于不知道楼主的平仓反手后的平仓条件,所以自行添加了 平仓条件。



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

客户服务部

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

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

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