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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件策略编写求助区 → 求助阿火版主帮写个日内系统

   

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


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

主题:求助阿火版主帮写个日内系统

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


加好友 发短信
等级:新手上路 帖子:7 积分:15 威望:0 精华:0 注册:2010/12/20 13:00:22
求助阿火版主帮写个日内系统  发帖心情 Post By:2011/11/6 18:47:34 [只看该作者]

条件如下:

1,9点35分后才开仓,当价格高于前面30根的最高价时开多单,开仓后如果创出当日新高则持有到价格低于前30根最低价;开仓后不创新高,则持仓到价格跌破当日最低点;平仓后马上反手;反手后平仓条件一样;
2,空单条件和多单相反;
3,2点58分平仓;

4,1分钟周期就可

谢谢版主好人一个,找时间请你吃饭喝酒泡MM


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


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

不知道对否 ,可参考一下我写的


if not(time>=093500) then exit;

exittime:=time>=025800;

n:=barslast(date<>ref(date,1));

dayhigh:=ref(hhv(h,n),1);

daylow:=ref(llv(l,n),1);

h30:=ref(hhv(h,30),1);

l30:=ref(llv(l,30),1);

 

if time>093500 and h>=h30 then buy(holding=0,1,market);

if time>093500 and l<=l30 then buyshort(holding=0,1,market);

if holding>0 then begin

   if enterprice>dayhigh and close<=l30 or enterprice<daylow   then sell(1,holding,market);

   if enterprice<daylow  then buyshort(1,1,market);

end;

 

if holding<0 then begin

   if enterprice<daylow and close>=h30 or enterprice>dayhigh   then sellshort(1,holding,market);

   if enterprice<dayhigh  then buy(1,1,market);

end

 

if time>=145800 and time<=150000 then begin

 sellshort(holding<0,0,close);
 sell(holding>0,0,close);
 
end

 

[此贴子已经被作者于2011-11-7 10:05:32编辑过]

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


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

不知哪里有问题,还是很多白色错误信号

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


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

我来试试


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

客户服务部

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

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

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


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

jinzhe 哥,您帮我修改的我实在是找不出问题,但是就是不能用, 请您再看下 http://www.weistock.com/bbs/dispbbs.asp?boardid=4&Id=8786
[此贴子已经被作者于2011-11-7 10:29:44编辑过]

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


加好友 发短信
等级:新手上路 帖子:7 积分:15 威望:0 精华:0 注册:2010/12/20 13:00:22
  发帖心情 Post By:2011/11/7 10:59:32 [只看该作者]

tonybig哥 你帮我写的问题怎么那么多啊 还有白点

不过还是谢谢你了,赞一个


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


加好友 发短信 原leevolvo
等级:版主 帖子:2160 积分:10563 威望:0 精华:11 注册:2010/11/3 11:21:19
  发帖心情 Post By:2011/11/7 11:50:48 [只看该作者]

汗。今天忙

上面的的第一句不能这样用,会导致hhv(h,nn)出错

其他部分不符合逻辑,是开仓后最高价触及日内最高点,才把离场位置为30周期低点,否则,是以日内最低点离场并反手

 

晚点写

 


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


加好友 发短信 原leevolvo
等级:版主 帖子:2160 积分:10563 威望:0 精华:11 注册:2010/11/3 11:21:19
  发帖心情 Post By:2011/11/7 14:39:14 [只看该作者]

variable:hl=0;
cond:=date<>ref(date,1);
nn:=barslast(cond)+1;
hi:=ref(hhv(h,nn),1);
lo:=ref(llv(l,nn),1);
hi30:=ref(hhv(h,30),1);
lo30:=ref(llv(l,30),1);
entertime:=time>093500 and time<145800;

if holding>0 and (l<lo or (l<lo30 and hl<0)) then begin//hl<0代表的开仓后的最高价达到日内最高点
 sell(1,1,market);
 buyshort(entertime,1,market);
 hl:=l;
 goto skip@; //这里要跳转一下,防止当根K线开空立即被下面的平仓语句平了
end

if holding<0 and (h>hi or (h>hi30 and hl<0)) then begin
 sellshort(1,1,market);
 buy(entertime,1,market);
 hl:=h;
end

if holding=0 and entertime and h>hi30 then begin
 buy(1,1,market);
 hl:=h;//记录开仓后的最高价
end

if holding=0 and entertime and l<lo30 then begin
 buyshort(1,1,market);
 hl:=l;
end

skip@;
if holding>0 and h>=abs(hl) then begin//因为用了hl的正负号来记录信息,所以需用abs(hl)
 hl:=h;//记录抬升的最高价
 if hl>hi then hl:=-hl;//如果触碰日内最高点,则把hl赋值为负值
end
if holding<0 and l<=abs(hl) then begin
 hl:=l;
 if hl<lo then hl:=-hl;
end

if time>=145800 then begin
 sell(1,1,market);
 sellshort(1,1,market);
end

[此贴子已经被作者于2011-11-7 16:26:02编辑过]

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


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

if holding>0 and h>=abs(hl) then begin//因为用了hl的正负号来记录信息,所以需用abs(hl)
 hl:=h;//记录抬升的最高价
 if hl>hi then hl:=-hl;//如果触碰日内最高点,则把hl赋值为负值
end
if holding<0 and l<=abs(hl) then begin
 hl:=l;
 if hl<lo then hl:=-hl;
end

 

 

这两句话不是太理解, 为什么要变成-hl, 则把hl赋值为负值
麻烦讲一下。

[此贴子已经被作者于2011-11-7 16:59:51编辑过]

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


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

只是为了用一个全局变量既:记录新高,

又标识:开仓后是否创出当日新高



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

客户服务部

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

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

service@weistock.com

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

 回到顶部
总数 14 1 2 下一页