以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  帮忙改一个飞狐的宝塔线公式  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=4785)

--  作者:relon
--  发布时间:2011/1/11 15:47:59
--  帮忙改一个飞狐的宝塔线公式
 金字塔的宝塔线(鬼变脸)不正确找到飞狐的,但是金字塔通不过,请教高手改一下。

INPUT:n(5,1,999),k(1,0,1);//n为均线参数;k=0取消画图标和均线
sensitivy:=o; towero:=o; towerc:=c; fc:=c;
i:=2;
while i<=datacount do begin
  towero[i]:=towerc[i-1];
  towerc[i]:=fc[i];
  sensitivy[i]:=towero[i-1];
  if (towerc[i-1]-towero[i-1])*(towerc[i-1]-sensitivy[i-1])<=0 then
    begin
      towero[i]:=towero[i-1];
      sensitivy[i]:=towerc[i-1];
    end
  else if between(sensitivy[i-1],towero[i-1],towerc[i-1]) then sensitivy[i]:=sensitivy[i-1];
  i:=i+1;
end;
 
tj:=(sensitivy-towero)*(sensitivy-towerc)<=0 and sensitivy<>towerc;
stickline(tj,max(towero,towerc),sensitivy,7,1), colorred;
stickline(tj,min(towero,towerc),sensitivy,7,0), color006600;
stickline(sensitivy<=min(towero,towerc) and not(tj),towero,towerc,7,1), colorred;
stickline(sensitivy>=max(towero,towerc) and not(tj),towero,towerc,7,0), color006600;

今开盘:TOWERO,LINETHICK0;
今收盘:TOWERC,LINETHICK0;
今敏感:sensitivy,LINETHICK0;

三平底翻红: min(towero,towerc)=ref(min(towero,towerc),1) and min(towero,towerc)=ref(min(towero,towerc),2) and max(towero,towerc)>sensitivy,LINETHICK,COLORRED;
三平顶翻绿: max(towero,towerc)=ref(max(towero,towerc),1) and max(towero,towerc)=ref(max(towero,towerc),2) and min(towero,towerc)<sensitivy,LINETHICK,COLOR006600;
if k=0 then exit;
DRAWICON(三平底翻红,min(towero,towerc)*0.98,4);DRAWICON(三平顶翻绿,max(towero,towerc)*1.02,5);

--  作者:admin
--  发布时间:2011/1/13 18:46:31
--  
已经在下周的升级版中序列模式完全支持该公式