以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://www.weistock.com/bbs/index.asp)
--  金字塔软件问题提交  (http://www.weistock.com/bbs/list.asp?boardid=2)
----  有哪位大侠能提供等价K线公式  (http://www.weistock.com/bbs/dispbbs.asp?boardid=2&id=154711)

--  作者:ccaudc
--  发布时间:2017/6/4 18:44:10
--  有哪位大侠能提供等价K线公式
有哪位大侠能提供等价K线公式?
我需要用它变公式。

万分感谢!

--  作者:gxx978
--  发布时间:2017/6/5 8:49:14
--  

程序化只能在主图类型为蜡烛线上运行交易,所有的策略也是基于蜡烛线进行编写的。


--  作者:yukizzc
--  发布时间:2017/6/5 9:05:28
--  
高级区精华帖,您可以看下有等价的vba源码
--  作者:ccaudc
--  发布时间:2017/6/5 15:56:27
--  
我只需要显示指标就行,不用编简易程序。
有原公式吗?
谢谢

--  作者:ccaudc
--  发布时间:2017/6/13 15:53:45
--  
等价K线源代码如下,但是显示“数组越界操作”。能帮忙改正一下吗?

fc:=c;fo:=o;cc:o*c,LINETHICK0;oo:0*c,LINETHICK0;t1:=0*c;t2:=0*c;
for i=1 to datacount do begin
  if i=1 and fc>fo then
    cc:=fc;
    oo:=fc;
  if i=1 and fc<fo then
    cc:=fc;
    oo:=fc;
  if i>1 then
    cc:=cc[i-1];
    oo:=oo[i-1];
  if i>1 and fc>cc*(1+n/100) then begin
    cc:=cc[i-1]*(1+n/100);
    oo:=cc[i-1];
end;
  if i>1 and fc<oo/(1+n/100) then begin
    oo:=oo[i-1]/(1+n/100);
    cc:=oo[i-1];
end;
  if oo=oo[i-1] then
     t1:=t1[i-1]+1;
  if cc=cc[i-1] then
     t2:=t2[i-1]+1;
end;
o1:=ref(oo,t1+1);
c1:=ref(cc,t2+1);
STICKLINE(c1=oo,cc,oo,8,1)COLORRED;
STICKLINE(o1=cc,cc,oo,8,1)COLORCYAN;