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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件策略编写求助区 → 请来看看!~~

   

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


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

主题:请来看看!~~

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


加好友 发短信
等级:管理员 帖子:5082 积分:17642 威望:0 精华:6 注册:2010/7/15 9:05:58
  发帖心情 Post By:2011/11/8 17:10:04 [显示全部帖子]

sellshort(holding<0 and enterbars>1,holding,limitr,thisclose);

请您看看函数参数,不能这么用

对应错误位置,改成以下

sellshort(holding<0 and enterbars>1,holding,limitr,c-2*mindiff);

 

其它错误,不在一一举例.

也请注意参考ignorecheckprice函数



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

客户服务部

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

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

service@weistock.com

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

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


加好友 发短信
等级:管理员 帖子:5082 积分:17642 威望:0 精华:6 注册:2010/7/15 9:05:58
  发帖心情 Post By:2011/11/9 15:35:43 [显示全部帖子]

按你策略描述和编写,连蒙带猜,修改如下:

 

runmode:0;
m:=barslast(date<>ref(date,1))+1;
predayhigh:=valuewhen(date<>ref(date,1),ref(hhv(h,m),1));
predaylow:=valuewhen(date<>ref(date,1),ref(llv(l,m),1));
predayclose:=valuewhen(date<>ref(date,1),ref(c,1));
dayopen:=valuewhen(date<>ref(date,1),o);

 

h10:valuewhen(time<=100000,hhv(h,m));//上轨
l10:valuewhen(time<=100000,llv(l,m));//下轨

 

//建立多头进场条件
//开盘价大于昨天收盘价,那么最高价大于该10点前的的最高价多头开仓
long:=h>h10 AND dayopen>predayclose and time>=100000 and time<=145800;
if long then buy(holding=0, 1, limitr, h10);

 

//开盘价低于昨天收盘价,最高价大于昨天最高反手做多
long2:=h>=predayhigh and dayopen<predayclose and time>=100000 and time<=145800;
if long then
 begin
 sellshort(holding<0, 0,limitr,c+2*mindiff);
 buy(holding=0, 1,limitr,max(predayhigh,o));
 end


//建立空头进场条件
//开盘价低于昨天收盘价,那么最低价小于该10点前的最低价空头开仓
short:=l<l10 AND dayopen<predayclose and time>=100000 and time<=145800;
if short then buyshort(holding=0, 1, limitr, l10);

 

//开盘价大于昨天收盘价,最低价跌破昨天最低价反手开空。
short2:=l<=predaylow and dayopen>predayclose and time>=100000 and time<=145800;
if short2 then
     begin
     sell(holding>0 and enterbars>1,0,limitr,c-2*mindiff);
     buyshort(holding=0,1,limitr,min(predaylow,o)); 
     end



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

客户服务部

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

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

service@weistock.com

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

 回到顶部