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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 求改写金字塔模型

   

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


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

主题:求改写金字塔模型

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2015/12/28 9:44:28    Post IP:101.90.255.170[只看该作者]

“若连续4根K线收于白线之下或者当价格低于白线之下4跳时对手价平仓”的意思是:
       1、当连续4根K线收于白线之下对手价平仓;
        2、当价格低于白线之下4跳时对手价平仓。
     当出现这两种情况都平仓,

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


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

在原来的代码之后加上这两句话:

if ((all(close<h1,4)) or (l<h1-4*MINDIFF)) and holding>0 then sell(1,0,thisclose);
if ((all(close>h1,4)) or (h>h1+4*mindiff)) and holding<0 then sellshort(1,0,THISCLOSE);



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

客户服务部

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

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

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/1/10 22:11:08    Post IP:183.193.182.187[只看该作者]

止损止盈的要求是:现在想最大亏损12跳;盈利4跳至9跳,如果回调至盈利1跳时平仓;盈利10跳至14跳,如果回调至盈利3跳时平仓;盈利15跳至19跳,如果回调至盈利8跳时平仓;盈利20跳至22跳,如果回调至盈利18跳时平仓;23跳以上跟踪止盈,则最新价从上一次高点回撤3跳,止赢.目前的有关程序是:

if openprofit<=-12*mindiff*multiplier  and enterbars>0 then begin
   sellshort(1,0,thisclose);
   sell(1,0,thisclose);
end
if c>=enterprice+4*mindiff and c<=enterprice+9*mindiff and c<=hhv(h,enterbars+1)-mindiff  and enterbars>0 then sell(1,0,thisclose);
if c>=enterprice+10*mindiff and c<=enterprice+14*mindiff and c<=hhv(h,enterbars+1)-3*mindiff  and enterbars>0 then sell(1,0,thisclose);
if c>=enterprice+15*mindiff and c<=enterprice+19*mindiff and c<=hhv(h,enterbars+1)-8*mindiff and enterbars>0 then sell(1,0,thisclose);
if c>=enterprice+20*mindiff and c<=enterprice+22*mindiff and c<=hhv(h,enterbars+1)-18*mindiff  and enterbars>0 then sell(1,0,thisclose);
if c<=enterprice-4*mindiff and c>=enterprice-9*mindiff and c>=llv(l,enterbars+1)+mindiff  and enterbars>0 then sellshort(1,0,thisclose);
if c<=enterprice-10*mindiff and c>=enterprice-14*mindiff and c>=llv(l,enterbars+1)+3*mindiff and enterbars>0 then sellshort(1,0,thisclose);
if c<=enterprice-15*mindiff and c>=enterprice-19*mindiff and c>=llv(l,enterbars+1)+8*mindiff  and enterbars>0 then sellshort(1,0,thisclose);
if c<=enterprice-20*mindiff and c>=enterprice-22*mindiff and c>=llv(l,enterbars+1)+18*mindiff  and enterbars>0 then sellshort(1,0,thisclose);
if hhv(h,enterbars+1)>=enterprice+23*mindiff and close<=hhv(h,enterbars+1)-3*mindiff  and enterbars>0 then sell(1,0,thisclose);
if llv(l,enterbars+1)<=enterprice-23*mindiff and close>=llv(l,enterbars+1)+3*mindiff  and enterbars>0 then sellshort(1,0,thisclose);
此主题相关图片如下:qq图片20160110212635.jpg
按此在新窗口浏览图片

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


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

微调参数请用户自行修改,


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

客户服务部

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

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

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/1/11 9:34:17    Post IP:101.90.255.181[只看该作者]

63楼的图片中的第二个平仓、第三个平仓与其他平仓的点位不一致,怪怪的。这个太难了,实在做不了。请老师帮帮忙吧,谢谢!
特别关注:63楼的图片中的第二个平仓、第三个平仓是否与其他平仓的点位一致。

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


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

用户自行修改了我前面写的代码,是吗?

 

我前面的代码

if hhv(h,enterbars+1)>=enterprice+4 and hhv(h,enterbars+1)<=enterprice+9 and c<=enterprice+1 then sell(1,0,market);

if hhv(h,enterbars+1)>=enterprice+10 and hhv(h,enterbars+1)<=enterprice+14 and c<=enterprice+3 then sell(1,0,market);

if hhv(h,enterbars+1)>=enterprice+15 and hhv(h,enterbars+1)<=enterprice+19 and c<=enterprice+8 then sell(1,0,market);

if hhv(h,enterbars+1)>=enterprice+20 and hhv(h,enterbars+1)<=enterprice+22 and c<=enterprice+18 then sell(1,0,market);
if llv(l,enterbars+1)<=enterprice-4 and llv(l,enterbars+1)>=enterprice-9 and c>=enterprice-1 then sellshort(1,0,market);

if llv(l,enterbars+1)<=enterprice-10 and llv(l,enterbars+1)>=enterprice-14 and c>=enterprice-3 then sellshort(1,0,market);

if llv(l,enterbars+1)<=enterprice-15 and llv(l,enterbars+1)>=enterprice-19 and c>=enterprice-8 then sellshort(1,0,market);

if llv(l,enterbars+1)<=enterprice-20 and llv(l,enterbars+1)>=enterprice-22 and c>=enterprice-18 then sellshort(1,0,market);

[此贴子已经被作者于2016/1/11 9:55:27编辑过]


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

客户服务部

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

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

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/1/11 9:57:23    Post IP:101.90.255.181[只看该作者]

我没有修改哦。刚刚又发现与其他平仓的点位不一致,怪怪的。
图片点击可在新窗口打开查看此主题相关图片如下:qq图片20160111095604.png
图片点击可在新窗口打开查看

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/1/11 9:58:37    Post IP:101.90.255.181[只看该作者]

67楼的图片中的第二个平仓出现问题。

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


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

以下是引用jinzhe在2016/1/11 9:54:58的发言:

用户自行修改了我前面写的代码,是吗?

 

我前面的代码

if hhv(h,enterbars+1)>=enterprice+4 and hhv(h,enterbars+1)<=enterprice+9 and c<=enterprice+1 then sell(1,0,market);

if hhv(h,enterbars+1)>=enterprice+10 and hhv(h,enterbars+1)<=enterprice+14 and c<=enterprice+3 then sell(1,0,market);

if hhv(h,enterbars+1)>=enterprice+15 and hhv(h,enterbars+1)<=enterprice+19 and c<=enterprice+8 then sell(1,0,market);

if hhv(h,enterbars+1)>=enterprice+20 and hhv(h,enterbars+1)<=enterprice+22 and c<=enterprice+18 then sell(1,0,market);
if llv(l,enterbars+1)<=enterprice-4 and llv(l,enterbars+1)>=enterprice-9 and c>=enterprice-1 then sellshort(1,0,market);

if llv(l,enterbars+1)<=enterprice-10 and llv(l,enterbars+1)>=enterprice-14 and c>=enterprice-3 then sellshort(1,0,market);

if llv(l,enterbars+1)<=enterprice-15 and llv(l,enterbars+1)>=enterprice-19 and c>=enterprice-8 then sellshort(1,0,market);

if llv(l,enterbars+1)<=enterprice-20 and llv(l,enterbars+1)>=enterprice-22 and c>=enterprice-18 then sellshort(1,0,market);

[此贴子已经被作者于2016/1/11 9:55:27编辑过]

那就按照这样的代码修改



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

客户服务部

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

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

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


加好友 发短信
等级:论坛游民 帖子:122 积分:0 威望:0 精华:0 注册:2015/12/9 12:32:38
  发帖心情 Post By:2016/1/11 10:54:59    Post IP:101.90.255.181[只看该作者]

仅仅执行开仓、平仓信号,不执行止盈止损信号。目前有关程序如下:
sell(C<ENTERPRICE-12*MINDIFF,holding,marketr);
sellshort(C>ENTERPRICE+12*MINDIFF,holding,marketr);

if hhv(h,enterbars+1)>=enterprice+4 and hhv(h,enterbars+1)<=enterprice+9 and c<=enterprice+1 then sell(1,0,market);
if hhv(h,enterbars+1)>=enterprice+10 and hhv(h,enterbars+1)<=enterprice+14 and c<=enterprice+3 then sell(1,0,market);
if hhv(h,enterbars+1)>=enterprice+15 and hhv(h,enterbars+1)<=enterprice+19 and c<=enterprice+8 then sell(1,0,market);
if hhv(h,enterbars+1)>=enterprice+20 and hhv(h,enterbars+1)<=enterprice+22 and c<=enterprice+18 then sell(1,0,market);
if llv(l,enterbars+1)<=enterprice-4 and llv(l,enterbars+1)>=enterprice-9 and c>=enterprice-1 then sellshort(1,0,market);
if llv(l,enterbars+1)<=enterprice-10 and llv(l,enterbars+1)>=enterprice-14 and c>=enterprice-3 then sellshort(1,0,market);
if llv(l,enterbars+1)<=enterprice-15 and llv(l,enterbars+1)>=enterprice-19 and c>=enterprice-8 then sellshort(1,0,market);
if llv(l,enterbars+1)<=enterprice-20 and llv(l,enterbars+1)>=enterprice-22 and c>=enterprice-18 then sellshort(1,0,market);
if hhv(h,enterbars+1)>enterprice+20 and hhv(h,enterbars+1)+23 and cross(enterprice-2,close) then sell(1,0,market);
if llv(l,enterbars+1)<enterprice-20 and llv(l,enterbars+1)-23 and cross(c,enterprice+2) then sellshort(1,0,market);
if openprofit>=0 and time0>=timetot0(closetime(0))-60*2 then begin
    sell(1,0,market);
    sellshort(1,0,market);
end

图片点击可在新窗口打开查看此主题相关图片如下:qq图片20160111105222.png
图片点击可在新窗口打开查看



 回到顶部
总数 84 上一页 1 2 3 4 5 6 7 8 9 下一页