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


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

   

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


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

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

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


加好友 发短信
等级:新手上路 帖子:3 积分:12 威望:0 精华:0 注册:2011/11/4 23:15:21
求我的日内止损策略编程  发帖心情 Post By:2011/11/5 21:47:29 [只看该作者]

如果阳线开多,跌破开仓时阳线的开盘价则止损反手做空;

如果阴线开空,涨过开仓时阴线的收盘价则止损反手做多;

谢谢!


 回到顶部
帅哥哟,离线,有人找我吗?
just
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | 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
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | 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
 回到顶部
帅哥哟,离线,有人找我吗?
fly
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


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

本模块有很多不错的策略,推荐楼主可以多看看.

比方新近的这个帖子写的就很不错.推荐给您http://www.weistock.com/bbs/dispbbs.asp?boardid=11&Id=8840



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

客户服务部

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

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

service@weistock.com

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

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


加好友 发短信
等级:新手上路 帖子:3 积分:12 威望:0 精华:0 注册:2011/11/4 23:15:21
  发帖心情 Post By:2011/11/7 18:35:18 [只看该作者]

以下是我的日内交易策略,就缺止损条件了

 

//中间变量

ZDX:=EMA((EMA(CLOSE,3)+EMA(CLOSE,5)+EMA(CLOSE,8)+EMA(CLOSE,13))/4,2);
JIE:=MA(CLOSE,25);
BRT:=(2*CLOSE+HIGH+LOW)/4;
BRT2:=LLV(LOW,34);
BRT3:=HHV(HIGH,34);
BRTK:=EMA((BRT-BRT2)/(BRT3-BRT2)*100,13);
BRTD:=EMA(0.667*REF(BRTK,1)+0.333*BRTK,2);
MACD:="MACD"(26,12,9);
m5:"ma.ma1";
m10:"ma.ma2";
m20:"ma.ma3";
m30:"ma.ma4";
m60:"ma.ma5";
macddy:=MACD>REF(MACD,1);
macdxy:=MACD<REF(MACD,1);
zf:=C/REF(C,1);
df:=C/REF(C,1);

 

//开多条件
BU:=(OPEN<ZDX OR REF(CLOSE,1)<ZDX) AND (OPEN<JIE OR REF(CLOSE,1)<JIE) AND CLOSE>JIE AND CLOSE>ZDX AND ZDX>REF(ZDX,1);
BB:=O<M5 AND O<M10 AND O<M20 AND C>M5 AND C>M10 AND C>M20 AND zf>1.00125 AND (M20<(O+C)/2 OR C>M60 or zf>1.003);
LONG:=BU AND macddy AND BB and time>090100 and time<145500;
if long then
    begin
    sellshort(holding<0,0,limitr,c);
    buy(holding=0,limitr,c);
    end;

 

//开空条件

SS:=O>M5 AND O>M10 AND O>M20 AND C<M5 AND C<M10 AND C<M20 AND df<0.99875 AND (M20>(O+C)/2 OR C<M60 or df<0.997);
SE:=OPEN>ZDX AND OPEN>JIE AND C<ZDX AND C<JIE AND macdxy;
SHORT:=SE AND SS and brtd>35 and time>090100 and time<144500;
if short then
    begin
    sell(holding>0,0,limitr,c);
    buyshort(holding=0,limitr,c);
    end;
 
//当日平仓

if TIME>145800 then
    begin
    sell(holding>0,0,market);
    sellshort(holding<0,0,market);
    end

 


 回到顶部