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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 帮忙看下这个问题在哪里

   

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


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

主题:帮忙看下这个问题在哪里

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


加好友 发短信 量化投资
等级:论坛游民 帖子:148 积分:653 威望:0 精华:0 注册:2010/9/27 16:08:27
帮忙看下这个问题在哪里  发帖心情 Post By:2011/11/3 16:57:42    Post IP:58.60.218.112[只看该作者]

帮忙看下这个问题在哪里 ,越改问题越多,图上好多小白开仓信号,

 

1:希望再帮忙修改每天正反只能个开一次

2:我写的止损条件好像图中显示的并不正确,本来是当开仓价格回碰当天开盘价止损。

万分感谢
runmode:0;

dayopen:=valuewhen(date<>ref(date,1),o);
 
enterlongcond:=high>=dayopen;
entershortcond:=low<=dayopen;

exittime:=time>=1458;

if holding=0 and time>1015 then begin
   if enterlongcond then
   buy(1,1,limitr,close+mindiff);
   if entershortcond then
   buyshort(1,1,limitr,close-mindiff);
end


if holding>0 and time>1015  then begin
   exitlongcond:=enterprice<=dayopen;
   if exitlongcond  then
   sell(1,holding,limitr,dayopen);
  
   if enterlongcond and enterbars>=1 then
   sell(1,holding,limitr,close-mindiff);
   buyshort(1,1,limitr,close-mindiff);

  
   if exittime then
   sell(1,holding,limitr,o);
   end
  
if holding<0 and time>1015 then begin
   exitshortcond:=enterprice>=dayopen;
   if exitshortcond then
    sellshort(1,holding,limitr,dayopen);
  
   if entershortcond and enterbars>=1  then
   sellshort(1,holding,limitr,closse+mindiff);
   buy(1,1,limitr,close+mindiff);
 
  
   if exittime then
   sellshort(1,holding,limitr,o);
   end
/
资产:asset-500000,noaxis,coloryellow,linethick2;
盈亏:(asset-500000)/500000,linethick0;
胜率:PERCENTWIN,linethick0;


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


加好友 发短信
等级:黑侠 帖子:676 积分:2548 威望:0 精华:3 注册:2011/4/13 16:18:50
  发帖心情 Post By:2011/11/3 17:20:54    Post IP:58.246.57.26[只看该作者]

你在公式里 语法上使用混乱,我不能猜测你的意图,请自行检查或是将意图用文字表达出来发贴。让网友帮助写一个完整的指标。

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


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

设计思路:

 

开仓条件:开盘至10点15之前的高低点作为上下轨,  10点15后如高价突破上轨做多,低价突破下轨做空。   (每天多空开仓只限一次)

止损:开仓价高于当天开盘价,空头止损,  开仓价低于当天开仓价,多头止损。

 

退出: 每天收盘前1分钟平仓。

 

谢谢


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


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

正在写,稍等


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

客户服务部

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

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

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


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

写完了。

 

variable :aa=0,bb=0;

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

sg:valuewhen(time<=101500,hhv(h,nn+1));//上轨

xg:valuewhen(time<=101500,llv(l,nn+1));//下轨

jk:ref(o,nn);//今日开盘

aa1:aa,linethick0;
bb1:bb,linethick0;
//10点15后如高价突破上轨做多,低价突破下轨做空(每天多空开仓只限一次)

if time >101500 and h>sg and aa=0 then begin
 sellshort(holding<0,0,thisclose);
 buy(holding=0,1,thisclose);
 aa:=1;
end

if time >101500 and l<xg and bb=0 then begin
 sell(holding>0,0,thisclose);
 buyshort(holding=0,1,thisclose);
 bb:=1;
end

//止损:开仓价高于当天开盘价,空头止损,  开仓价低于当天开仓价,多头止损。


if enterprice>jk then sellshort(holding<0,0,thisclose);

if enterprice<jk then sell(holding>0,0,thisclose);


//退出: 每天收盘前1分钟平仓。

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

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

if time>=150000 then begin
    aa:=0;
    bb:=0;
end



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

客户服务部

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

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

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


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

哈哈 万分感谢啊 ,不请客都不好意思了


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


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

为啥啊最后  还要写这个?有啥意义?

 

 

if time>=150000 then begin
    aa:=0;
    bb:=0;
end


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


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

 还有平仓手数 为啥不填写?

 

sellshort(holding<0,0,thisclose);
 sell(holding>0,0,thisclose);


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


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

1.您是每天做交易的,收盘前把全局变量赋值为0.才不会影响第2天的开仓.

 

2.sell(holding>0,0,thisclose);//这里的第2个参数可以写成具体手数1,也可写成0,表示全局平仓.

如果还是不懂,去仔细看看函数说明.



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

客户服务部

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

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

service@weistock.com

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

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


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

明白了,但是改好的公式无法使用在1分钟图上,请帮忙查看

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