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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 前2段写好,请老师把第三段给写一下,附截图

   

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


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

主题:前2段写好,请老师把第三段给写一下,附截图

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2014/10/29 15:56:09    Post IP:58.246.57.26[显示全部帖子]

空单持有到红绿线,直到oo线下来,平空单,反手开多单;
多单到红绿线平仓,等待;

 

请阐述一下红绿线和oo线的关系,以及是否和当前k线的行情有关



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

客户服务部

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

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

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2014/10/29 16:41:31    Post IP:58.246.57.26[显示全部帖子]

oo线直行是什么情况?


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

客户服务部

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

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

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2014/10/29 17:18:59    Post IP:58.246.57.26[显示全部帖子]

空单持有到红绿线,直到oo线下来

指的是oo线突破红绿线,降到红绿线之下?



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

客户服务部

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

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

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2014/10/30 9:12:54    Post IP:58.246.57.26[显示全部帖子]

input:grid(45,1,60,1);//申明并设置参数
variable:level=0;//为全局变量申明语句
dist:=barslast(date<>ref(date,1));
oo:ref(open,dist),COLOR0080FF,LINETHICK2;
zx:=c,COLORC080FF,LINETHICK1;

if holding=0 then begin
 dnprice:=oo-grid*mindiff;
 if low<=dnprice then begin
  buy(1,1,limitr,dnprice);
  level:=-1;
 end
end
if holding=0 then begin
 upprice:=oo+grid*mindiff;
 if high>=upprice then begin
  buyshort(1,1,limitr,upprice);
  level:=1;
 end
end

if holding>0 then begin
 upprice:=oo+(level+1)*grid*mindiff;
 dnprice:=oo+(level-1)*grid*mindiff;
 
 if high>=upprice then begin
  sell(1,1,limitr,upprice);
  level:=level+1;
 end
 
 if low<=dnprice then begin
  buy(1,1,limitr,dnprice);
  level:=level-1;
 end
 
 if time=closetime(0) then
  sell(1,holding,limitr,close);
end

if holding<0 then begin
 upprice:=oo+(level+1)*grid*mindiff;
 dnprice:=oo+(level-1)*grid*mindiff;
 
 if low<=dnprice then begin
  sellshort(1,1,limitr,dnprice);
  level:=level-1;
 end
 
 if high>=upprice then begin
  buyshort(1,1,limitr,upprice);
  level:=level+1;
 end
 
 if time=closetime(0) then
  sellshort(1,holding,limitr,close);
end

//第二段是红绿变色线的运行
VARIABLE: aspect=0; //初始化假定做多头
VARIABLE: stopprice=0;//止损价格变量
VARIABLE: stopnum = 10; //止损价差
RUNMODE:0;            //工作于逐周期模式
if barpos = 0 then
   stopprice := l - stopnum;
if aspect = 0 then
 begin
  //多头处理 
  if l <= stopprice then
  begin
   //多反空
  aspect:= 1;
   stopprice := h+stopnum;
  end
 
  //处理移动的底部
 if l - stopnum > stopprice then
   stopprice := l-stopnum;
 end

if aspect = 1 then
 begin
  //空头处理 
  if h >= stopprice then
  begin
   //空反多
  aspect:= 0;
   stopprice := l-stopnum;
  end
 
  //处理移动的底部
 if h + stopnum < stopprice then
   stopprice := h+stopnum;
 end
//画线
PARTLINE(aspect = 0, stopprice , colorrgb(255,0,0)),LINETHICK2;
PARTLINE(aspect = 1, stopprice , colorrgb(0,255,0)),LINETHICK2;
{1、最新价C<=OO线,并且,oo线直行;开空(这时价格运行在oo线和红线之间);

2、红线变绿,最新价C与红绿线“死叉”,继续持有空单(这时价格运行在oo线和绿线之下);

3、oo线和红绿线“死叉”,oo线在最新价之下,平空翻多(这时价格运行在oo线之上红绿线之下);
 }
if l<=oo and date=ref(date,1) then buyshort(holding=0,1,market);

if oo<l and cross(stopprice,oo) then begin
 sellshort(1,0,market);
 buy(holding=0,1,market);
end



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

客户服务部

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

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

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


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
  发帖心情 Post By:2014/10/30 14:52:49    Post IP:58.246.57.26[显示全部帖子]

不再添加,请用户根据上面的写的代码自行处理


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

客户服务部

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

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

 回到顶部