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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 平仓反手出现白色箭头

   

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


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

主题:平仓反手出现白色箭头

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


加好友 发短信
等级:论坛游侠 帖子:503 积分:1033 威望:0 精华:0 注册:2011/11/18 10:56:56
平仓反手出现白色箭头  发帖心情 Post By:2012/6/12 17:04:28    Post IP:180.159.16.127[只看该作者]

平仓反手出现白色箭头,已在开仓前平仓,并且发送价格在信号bar的high,low之间。请问是什么原因?(请看12/5/8这天)

 

runmode:0;

input:notbef(090000);
input:notaft(145500);
input:f1(0.35);
input:f2(0.07);
input:f3(0.25);
input:myreverse(1);
input:rangemin(0.2);
input:xdiv(3);

variable:ssetup=0;
variable:bsetup=0;
variable:senter=0;
variable:benter=0;
variable:bbreak=0;
variable:sbreak=0;
variable:ltoday=0;
variable:hitoday=999999;
variable:startnow=0;
variable:div=0;
variable:rfilter=false;

i_reverse:=myreverse*(callstock(stklabel,vtopen,6,0)/100);
i_rangemin:=rangemin*(callstock(stklabel,vtopen,6,0)/100);

if barpos=1 then begin
 startnow:=0;
 div:=max(xdiv,1);
end

hh:=ref(hitoday,1);
cc:=ref(close,1);
ll:=ref(ltoday,1);

if date>ref(date,1) then begin
 startnow:=startnow+1;
 
 ssetup:=hh+f1*(cc-ll);
 senter:=((1+f2)/2)*(hh+cc)-f2*ll;
 benter:=((1+f2)/2)*(ll+cc)-f2*hh;
 bsetup:=ll-f1*(hh-cc);
 bbreak:=ssetup+f3*(ssetup-bsetup);
 sbreak:=bsetup-f3*(ssetup-bsetup);
 
 hitoday:=high;
 ltoday:=low;
 
 rfilter:=hh-cc>=rangemin;
end

if high>hitoday then hitoday:=high;
if low<ltoday then ltoday:=low;

if time>=notbef and time<notaft and startnow>=2 and rfilter then begin
 if hitoday>=ssetup and holding>=0 then begin
  if low<=senter+(hitoday-ssetup)/div then begin
   sell(1,holding,limitr,senter+(hitoday-ssetup)/div);
   sellshort(1,1,limitr,senter+(hitoday-ssetup)/div);
  end
 end
 
 if ltoday<=bsetup and holding<=0 then begin
  if high>=benter-(bsetup-ltoday)/div then begin
   if high>=benter-(bsetup-ltoday)/div then begin
    sellshort(1,holding,limitr,benter-(bsetup-ltoday)/div);
    buy(1,1,limitr,benter-(bsetup-ltoday)/div);
   end
  end
 end
 
 if holding<0 then begin
  if high-enterprice>=i_reverse then
   sellshort(1,enterprice+i_reverse);
 end
 
 if holding>0 then begin
  if enterprice-low>=i_reverse then
   sell(1,enterprice-i_reverse);
 end
 
 if holding=0 then begin
  if high>=bbreak then
   buy(1,bbreak);
 end
 
 if holding=0 then begin
  if low<=sbreak then
   sellshort(1,sbreak);
 end
end

if time>=notaft then begin
 if holding<0 then
  sellshort(1,holding,limitr,open);
 
 if holding>0 then
  sell(1,holding,limitr,open);
end

盈亏:=asset-500000,noaxis,coloryellow,linethick2;

 A:ssetup,COLORGRAY,LINEDOT;
 A1:senter,COLORWHITE;
 A3:benter,COLORWHITE;
 A4:bsetup,COLORGRAY,LINEDOT;
 A5:bbreak,COLORRED;
 A6:sbreak,COLORRED;


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


加好友 发短信 czt
等级:蜘蛛侠 帖子:1445 积分:6114 威望:0 精华:3 注册:2012/1/16 10:31:19
  发帖心情 Post By:2012/6/12 17:08:14    Post IP:58.246.57.26[只看该作者]

这个是价格的问题  未成交

你换市价测试下 应该就没这问题了吧


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


加好友 发短信
等级:论坛游侠 帖子:503 积分:1033 威望:0 精华:0 注册:2011/11/18 10:56:56
  发帖心情 Post By:2012/6/12 17:31:43    Post IP:180.159.16.127[只看该作者]

把价格换成market, 白色箭头更多了


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


加好友 发短信
等级:论坛游侠 帖子:503 积分:1033 威望:0 精华:0 注册:2011/11/18 10:56:56
  发帖心情 Post By:2012/6/13 9:50:24    Post IP:218.79.142.191[只看该作者]

昨晚搞了半夜,还是没能解决这个问题。把价格+-5点,白色箭头都还在,应该不是成交价格的问题。望大侠们尽早帮忙。


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


加好友 发短信
等级:金字塔养老院 帖子:1323 积分:6764 威望:0 精华:0 注册:2011/6/14 17:27:11
  发帖心情 Post By:2012/6/14 10:42:45    Post IP:58.246.57.26[只看该作者]

楼主代码问题很多啊,红色部分写的有问题啊。

sellshort(1,enterprice+i_reverse);
 end
 
 if holding>0 then begin
  if enterprice-low>=i_reverse then
   sell(1,enterprice-i_reverse);
 end
 
 if holding=0 then begin
  if high>=bbreak then
   buy(1,bbreak);
 end
 
 if holding=0 then begin
  if low<=sbreak then
   sellshort(1,sbreak);
 end


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

客户服务部

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

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

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com
 回到顶部
帅哥哟,离线,有人找我吗?
yin8jun
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:503 积分:1033 威望:0 精华:0 注册:2011/11/18 10:56:56
  发帖心情 Post By:2012/6/14 16:32:00    Post IP:218.79.142.191[只看该作者]

以下是引用just在2012-6-14 10:42:45的发言:

楼主代码问题很多啊,红色部分写的有问题啊。

sellshort(1,enterprice+i_reverse);
 end
 
 if holding>0 then begin
  if enterprice-low>=i_reverse then
   sell(1,enterprice-i_reverse);
 end
 
 if holding=0 then begin
  if high>=bbreak then
   buy(1,bbreak);
 end
 
 if holding=0 then begin
  if low<=sbreak then
   sellshort(1,sbreak);
 end

谢谢了


 回到顶部