以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  逐k线计算改序列  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=143196)

--  作者:tanyongde
--  发布时间:2016/11/22 16:54:30
--  逐k线计算改序列

逐k线计算改序列,不知道哪函数通不过?

input:p(10,2,200,1);

input:length(75,10,300,10);

input:zs(4,1,50,1);

input:k1(4,1,50,1);

line:=ma(close,30);

tr1 :=max(max((high-low),abs(ref(close,1)-high)),abs(ref(close,1)-low));

atr:=ma(tr1,length); 

zsx:=ifelse(zs*ref(atr,1)<0.01*ref(c,1),0.01*ref(c,1),zs*ref(atr,1));

enterbars1:=enterbars+1;

dstop:=ref(l,1)-k1*ref(atr,1);//实时进多平仓价

kstop:=ref(h,1)+k1*ref(atr,1);//实时进空平仓价

dstop1:hhv(dstop,enterbars1);//平多价

kstop1:llv(kstop,enterbars1);//平空价


//建立多头的进场条件


    long:=cross(open,line);
 

   if long then begin

   tsellshort(tholding<0,0,mkt);

   //sellshort(holding<0,0,limitr ,open+mindiff);
   //sellshort(holding<0,0,marketr);

   tbuy(tholding=0,p,mkt);
   
   //if entrycond then begin

   //buy(holding=0,p, limitr ,open+mindiff);
   //end
   
   //buy(holding=0,p, marketr);

  end

//建立空头的进场条件

  
   short:= cross(line,open) ;

   if short then begin

   tsell(tholding>0,0,mkt);

   //sell(holding>0,0,limitr,open-mindiff);
   //sell(holding>0,0,marketr);

   tbuyshort(tholding=0,p,mkt);
   //if entrycond then begin

   //buyshort(holding=0,p,limitr,open-mindiff);
   //end
   //buyshort(holding=0,p,marketr);
  end

if tholding>0 and c<=max(enterprice-zsx,dstop1) then tsell(1,0,mkt);

if tholding<0 and c>=min(enterprice+zsx,kstop1) then tsellshort(1,0,mkt);


--  作者:jinzhe
--  发布时间:2016/11/22 17:02:19
--  

系统的提示已经很明显了,说你的后台代码混入了图表交易函数,所以才会自动转逐k的


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

--  作者:tanyongde
--  发布时间:2016/11/23 9:56:40
--  
    你用的金字塔软件什么版本,我的软件信息显示不一样
--  作者:jinzhe
--  发布时间:2016/11/23 10:08:49
--  
4.0的