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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 时空黄金分割公式源代码(不是我写的)

   

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


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

主题:时空黄金分割公式源代码(不是我写的)

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


加好友 发短信
等级:新手上路 帖子:24 积分:112 威望:0 精华:0 注册:2011/2/15 21:08:00
时空黄金分割公式源代码(不是我写的)  发帖心情 Post By:2011/2/21 16:55:28    Post IP:112.65.20.240[只看该作者]

 

 

{时间黄金分割}
{☆§提示:1计算机画线不能代替手工作图。
          2确定历史数据完整。}
{精确的黄金分割是二分之根号五减一,即0.618=(SQRT(5)-1)/2}
{注释里有黄金分割的解释}

 

input:左侧右移(0),右侧左移(0),开关(1,1,2),N(30,1,1000),M(5,1,365);
t1:=barpos=sysparam(2)+左侧右移;
t2:=barpos=sysparam(3)-右侧左移;
t11:=sysparam(2)+左侧右移;
t21:=sysparam(3)-右侧左移;
ymd:=date;
D1:ymd[t11],linethick0;
D2:ymd[t21],linethick0;
{D2:hhv(if(t2,date,0),0),linethick0;}
VERTLINE(t1),color00ffff,LINEDOT;
VERTLINE(t2),color00ffff,LINEDOT;
{d1:=if(t1 or t2,barpos,0);
dd:=d1;
x835:=SORTPOS(dd,1,1,datacount);
间隔:abs(d1[dd[1]]-d1[dd[2]]),linethick0;}
间隔:t21-t11,linethick0;
{ccc:ref(BARSTATUS=2,右侧左移);}
x1:=间隔*(0.191);
x8:=间隔*(0.382);
x05:=间隔*(0.5);
x3:=间隔*(0.618);
x5:=间隔*(0.809);


x1831:=sysparam(2)+左侧右移+ROUND(x1);
tx1:=BARPOS=x1831;
VERTLINE(tx1),colorffff33,LINEDOT;
D191:ymd[x1831],linethick0;

x1838:=t11+ROUND(x8);
tx8:=BARPOS=x1838;
VERTLINE(tx8),color00aaaa,LINEDOT;
D382:ymd[x1838],linethick0;


x18305:=t11+ROUND(x05);
tx05:=BARPOS=x18305;
VERTLINE(tx05),color0000ff,LINEDOT;
D05:ymd[x18305],linethick0;

x1833:=t11+ROUND(x3);
tx3:=BARPOS=x1833;
VERTLINE(tx3),color00aaaa,LINEDOT;
D618:ymd[x1833],linethick0;

x1835:=t11+ROUND(x5);
tx5:=BARPOS=x1835;
VERTLINE(tx5),colorffff33,LINEDOT;
D809:ymd[x1835],linethick0;

 

ph:=SYSPARAM(4);
pl:=SYSPARAM(5);
drawtext(t1,pl,STRLEFT(NUMTOSTR(d1+19000000,0),4)+STRRIGHT(NUMTOSTR(d1,0),4)),color00ffff;
drawtext(t2,pl,STRLEFT(NUMTOSTR(d2+19000000,0),4)+STRRIGHT(NUMTOSTR(d2,0),4)),color00ffff,align2;
drawtext(tx1,pl,STRLEFT(NUMTOSTR(d191+19000000,0),4)+STRRIGHT(NUMTOSTR(d191,0),4)),colorffff33;
drawtext(tx8,pl,STRLEFT(NUMTOSTR(d382+19000000,0),4)+STRRIGHT(NUMTOSTR(D382,0),4)),color00aaaa;
drawtext(tx05,pl,STRLEFT(NUMTOSTR(d05+19000000,0),4)+STRRIGHT(NUMTOSTR(D05,0),4)),color0000ff;
drawtext(tx3,pl,STRLEFT(NUMTOSTR(d618+19000000,0),4)+STRRIGHT(NUMTOSTR(D618,0),4)),color00aaaa;
drawtext(tx5,pl,STRLEFT(NUMTOSTR(d809+19000000,0),4)+STRRIGHT(NUMTOSTR(d809,0),4)),colorffff33;


drawtext(t1,ph*0.99,'0点'),color00ffff;
drawtext(t2,ph*0.99,'100%'),color00ffff,align2;
drawtext(tx1,ph*0.99,'0.191'),colorffff33;
drawtext(tx8,ph*0.99,'0.382'),color00aaaa;
drawtext(tx05,ph*0.99,'0.5'),color0000ff;
drawtext(tx3,ph*0.99,'0.618'),color00aaaa;
drawtext(tx5,ph*0.99,'0.809'),colorffff33;


if 开关=2 then
begin

x236:=间隔*(0.236);
x764:=间隔*(0.764);
x236:=sysparam(2)+左侧右移+ROUND(x236);
tx236:=BARPOS=x236;
VERTLINE(tx236),coloraaaaaa,LINEDOT;
D236:ymd[x236],linethick0;

x764:=t11+ROUND(x764);
tx764:=BARPOS=x764;
VERTLINE(tx764),coloraaaaaa,LINEDOT;
D764:ymd[x764],linethick0;
pllh:=(pl*4+ph)/5;
phhl:=(pl+ph*4)/5;
drawtext(tx236,pllh,STRLEFT(NUMTOSTR(d236+19000000,0),4)+STRRIGHT(NUMTOSTR(d236,0),4)),coloraaaaaa;
drawtext(tx764,pllh,STRLEFT(NUMTOSTR(d764+19000000,0),4)+STRRIGHT(NUMTOSTR(d764,0),4)),coloraaaaaa;
drawtext(tx236,phhl,'0.236'),coloraaaaaa;
drawtext(tx764,phhl,'0.764'),coloraaaaaa;

end;

         {§历史影响现在,现在影响未来。§}

input:n(30,1,1000);
HH:HHV(H,N);
LL:LLV(L,N);

<%

VH=FFL.VARDATA("HH")

VL=FFL.VARDATA("LL")

VN=FFL.VARDATA("N")

LAST=UBOUND(VH)

IF VN>LAST THEN VN=LAST+1

FOR I=LAST TO LAST-VN+1 STEP-1

    VH(I)=VH(LAST)

    VL(I)=VL(LAST)

NEXT

FFL.VARDATA("HH")=VH

FFL.VARDATA("LL")=VL

FFL.VARSTARTINDEX("HH")=LAST-VN+1

FFL.VARSTARTINDEX("LL")=LAST-VN+1

%>

HH,color009999;
DRAWTEXT(c>0  and ISLASTBAR=1,HH,'【黄金分割】↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),HH,HH,2),align2,color009999;
LL+((HH-LL)*0.809),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.809),' 0.809↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.809),LL+((HH-LL)*0.809),2),align2,color009999;
LL+((HH-LL)*0.764),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.764),' 0.764↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.764),LL+((HH-LL)*0.764),2),align2,color009999;
LL+((HH-LL)*0.618),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.618),' 0.618↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.618),LL+((HH-LL)*0.618),2),align2,color009999;
LL+((HH-LL)*0.500),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.500),' 0.500↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.500),LL+((HH-LL)*0.500),2),align2,color009999;
LL+((HH-LL)*0.382),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.382),' 0.382↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.382),LL+((HH-LL)*0.382),2),align2,color009999;
LL+((HH-LL)*0.333),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.333),' 0.333↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.333),LL+((HH-LL)*0.333),2),align2,color009999;
LL+((HH-LL)*0.236),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.236),' 0.236↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.236),LL+((HH-LL)*0.236),2),align2,color009999;
LL+((HH-LL)*0.191),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.191),' 0.191↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.191),LL+((HH-LL)*0.191),2),align2,color009999;
LL,color009999;
DRAWTEXT(c>0  and ISLASTBAR=1,LL,'〖底部起点〗↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL,LL,2),align2,coloryellow;

fbars:=SYSPARAM(0);
f5:=barssince(c)=fbars-1;
VERTLINE(f5),pointdot,color996666,linethick1,shift5;
DRAWNUMBER(f5,SYSPARAM(4),5,0),shift5;
ff5:=barssince(c)=fbars-5;
VERTLINE(ff5),pointdot,color996666,linethick1;
DRAWNUMBER(ff5,SYSPARAM(4),5,0);
f8:=barssince(c)=fbars-1;
ff8:=barssince(c)=fbars-8;
VERTLINE(f8),pointdot,color996666,linethick1,shift8;
DRAWNUMBER(f8,SYSPARAM(4),8,0),shift8;
VERTLINE(ff8),pointdot,color996666,linethick1;
DRAWNUMBER(ff8,SYSPARAM(4),8,0);
f13:=barssince(c)=fbars-1;
ff13:=barssince(c)=fbars-13;
vertline(f13),pointdot,color996666,linethick1,shift13;
DRAWNUMBER(f13,SYSPARAM(4),13,0),shift13;
vertline(ff13),pointdot,color996666,linethick1;
DRAWNUMBER(ff13,SYSPARAM(4),13,0);
f21:=barssince(c)=fbars-1;
ff21:=barssince(c)=fbars-21;
vertline(f21),pointdot,color996666,linethick1,shift21;
DRAWNUMBER(f21,SYSPARAM(4),21,0),shift21;
vertline(ff21),pointdot,color996666,linethick1;
DRAWNUMBER(ff21,SYSPARAM(4),21,0);
f34:=barssince(c)=fbars-1;
ff34:=barssince(c)=fbars-34;
vertline(f34),pointdot,color996666,linethick1,shift34;
DRAWNUMBER(f34,SYSPARAM(4),34,0),shift34;
vertline(ff34),pointdot,color996666,linethick1;
DRAWNUMBER(ff34,SYSPARAM(4),34,0);
f55:=barssince(c)=fbars-1;
ff55:=barssince(c)=fbars-54;
vertline(f55),pointdot,color996666,linethick1,shift55;
DRAWNUMBER(f55,SYSPARAM(4),55,0)shift55;
vertline(ff55),pointdot,color996666,linethick1;
DRAWNUMBER(ff55,SYSPARAM(4),55,0);
f89:=barssince(c)=fbars-1;
ff89:=barssince(c)=fbars-88;
vertline(f89),pointdot,color996666,linethick1,shift89;
DRAWNUMBER(f89,SYSPARAM(4),89,0),shift89;
vertline(ff89),pointdot,color996666,linethick1;
DRAWNUMBER(ff89,SYSPARAM(4),89,0);
f134:=barssince(c)=fbars+20;
ff134:=barssince(c)=fbars-144;
vertline(f134),pointdot,color996666,linethick1,shift124;
DRAWNUMBER(f134,SYSPARAM(4),144,0),shift124;
vertline(ff134),pointdot,color996666,linethick1;
DRAWNUMBER(ff134,SYSPARAM(4),144,0);


{}
{m 5}
V1:=MA(HIGH,30)*1.15;
V2:=MA(HIGH,3)*1.03;
V3:=MA(LOW,3)*0.97;
V4:=MA(LOW,30)*0.85;
{}
GET:ZIG(3,m),COLORYELLOW;
PL5:=ZIG(3,5);
EN1:=ZIG(3,5)>REF(ZIG(3,5),1) AND REF(ZIG(3,5),1)<=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)<=REF(ZIG(3,5),3);
EX1:=ZIG(3,5)<REF(ZIG(3,5),1) AND REF(ZIG(3,5),1)>=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)>=REF(ZIG(3,5),3);
PL10:=ZIG(3,10);
EN2:=ZIG(3,10)>REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)<=REF(ZIG(3,10),2) AND REF(ZIG(3,10),2)<=REF(ZIG(3,10),3);
EX2:=ZIG(3,10)<REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)>=REF(ZIG(3,10),2) AND REF(ZIG(3,10),2)>=REF(ZIG(3,10),3);
PL20:=ZIG(3,20);
EN3:=ZIG(3,20)>REF(ZIG(3,20),1) AND REF(ZIG(3,20),1)<=REF(ZIG(3,20),2) AND REF(ZIG(3,20),2)<=REF(ZIG(3,20),3);
EX3:=ZIG(3,20)<REF(ZIG(3,20),1) AND REF(ZIG(3,20),1)>=REF(ZIG(3,20),2) AND REF(ZIG(3,20),2)>=REF(ZIG(3,20),3);
PL40:=ZIG(3,40);
走强1:=BARSLAST(PL5<REF(PL5,1));
走弱1:=BARSLAST(PL5>REF(PL5,1));
走强2:=BARSLAST(PL10<REF(PL10,1));
走弱2:=BARSLAST(PL10>REF(PL10,1));
走强3:=BARSLAST(PL20<REF(PL20,1));
走弱3:=BARSLAST(PL20>REF(PL20,1));
ZTJZ5:=IF(PL10>REF(PL10,1),COUNT(EN1,走强2),0);
ZTJD5:=IF(PL10>REF(PL10,1),COUNT(EX1,走强2),0);
DTJZ5:=IF(PL10<REF(PL10,1),COUNT(EN1,走弱2),0);
DTJD5:=IF(PL10<REF(PL10,1),COUNT(EX1,走弱2),0);
ZTJZ10:=IF(PL20>REF(PL20,1),COUNT(EN2,走强3),0);
ZTJD10:=IF(PL20>REF(PL20,1),COUNT(EX2,走强3),0);
DTJZ10:=IF(PL20<REF(PL20,1),COUNT(EN2,走弱3),0);
DTJD10:=IF(PL20<REF(PL20,1),COUNT(EX2,走弱3),0);
DRAWTEXT(EN1 AND DTJZ5=1,L*0.98,'㈠'),COLORFFFF00;
DRAWTEXT(EX1 AND DTJD5=2,H*1.02,'㈡'),COLORFFFF00;
DRAWTEXT(EN2 AND ZTJZ5=1,L*0.98,'㈢'),COLORFFFF00;
DRAWTEXT(EX1 AND PL10>REF(PL10,1) AND ZTJD5=1,H*1.02,'⑴'),COLOR0000FF;
DRAWTEXT(EN1 AND PL10>REF(PL10,1) AND ZTJZ5=2,L*0.98,'⑵'),COLOR0000FF;
DRAWTEXT(EX1 AND PL10>REF(PL10,1) AND ZTJZ5=2,H*1.02,'⑶'),COLOR0000FF;
DRAWTEXT(EN1 AND PL10>REF(PL10,1) AND ZTJZ5=3,L*0.98,'⑷'),COLOR0000FF;
DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=1,H*1.02,'⑸'),COLOR0000FF;
DRAWTEXT(EN2 AND DTJZ10=1,L*0.94,'Ⅰ'),COLORFF6000;
DRAWTEXT(EX2 AND DTJD10=2,H*1.06,'Ⅱ'),COLORFF6000;
DRAWTEXT(EN3 AND ZTJZ10=1,L*0.94,'Ⅲ'),COLORFF6000;
DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=1,H*1.06,'①'),LINETHICK3,COLOR00FFFF;
DRAWTEXT(EN2 AND PL20>REF(PL20,1) AND ZTJZ10=2,L*0.94,'②'),LINETHICK3,COLOR00FFFF;
DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=2 OR (ZTJD10=0 OR ZTJD10=2) AND EX2,H*1.06,'③'),LINETHICK3,COLOR00FFFF;
DRAWTEXT(EN2 AND PL20>REF(PL20,1) AND ZTJZ10=3,L*0.94,'④'),LINETHICK3,COLOR00FFFF;

[此贴子已经被作者于2011-2-21 17:06:40编辑过]

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


加好友 发短信
等级:小飞侠 帖子:1882 积分:3310 威望:0 精华:15 注册:2010/3/15 13:11:56
  发帖心情 Post By:2011/2/21 18:55:27    Post IP:114.243.115.151[只看该作者]

thanks 4 sharing!

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


加好友 发短信
等级:新手上路 帖子:99 积分:309 威望:0 精华:0 注册:2011/3/23 20:52:24
  发帖心情 Post By:2011/3/28 14:34:07    Post IP:58.54.176.211[只看该作者]

以下是引用KKSH在2011-2-21 16:55:28的发言:

 

 

{时间黄金分割}
{☆§提示:1计算机画线不能代替手工作图。
          2确定历史数据完整。}
{精确的黄金分割是二分之根号五减一,即0.618=(SQRT(5)-1)/2}
{注释里有黄金分割的解释}

 

input:左侧右移(0),右侧左移(0),开关(1,1,2),N(30,1,1000),M(5,1,365);
t1:=barpos=sysparam(2)+左侧右移;
t2:=barpos=sysparam(3)-右侧左移;
t11:=sysparam(2)+左侧右移;
t21:=sysparam(3)-右侧左移;
ymd:=date;
D1:ymd[t11],linethick0;
D2:ymd[t21],linethick0;
{D2:hhv(if(t2,date,0),0),linethick0;}
VERTLINE(t1),color00ffff,LINEDOT;
VERTLINE(t2),color00ffff,LINEDOT;
{d1:=if(t1 or t2,barpos,0);
dd:=d1;
x835:=SORTPOS(dd,1,1,datacount);
间隔:abs(d1[dd[1]]-d1[dd[2]]),linethick0;}
间隔:t21-t11,linethick0;
{ccc:ref(BARSTATUS=2,右侧左移);}
x1:=间隔*(0.191);
x8:=间隔*(0.382);
x05:=间隔*(0.5);
x3:=间隔*(0.618);
x5:=间隔*(0.809);


x1831:=sysparam(2)+左侧右移+ROUND(x1);
tx1:=BARPOS=x1831;
VERTLINE(tx1),colorffff33,LINEDOT;
D191:ymd[x1831],linethick0;

x1838:=t11+ROUND(x8);
tx8:=BARPOS=x1838;
VERTLINE(tx8),color00aaaa,LINEDOT;
D382:ymd[x1838],linethick0;


x18305:=t11+ROUND(x05);
tx05:=BARPOS=x18305;
VERTLINE(tx05),color0000ff,LINEDOT;
D05:ymd[x18305],linethick0;

x1833:=t11+ROUND(x3);
tx3:=BARPOS=x1833;
VERTLINE(tx3),color00aaaa,LINEDOT;
D618:ymd[x1833],linethick0;

x1835:=t11+ROUND(x5);
tx5:=BARPOS=x1835;
VERTLINE(tx5),colorffff33,LINEDOT;
D809:ymd[x1835],linethick0;

 

ph:=SYSPARAM(4);
pl:=SYSPARAM(5);
drawtext(t1,pl,STRLEFT(NUMTOSTR(d1+19000000,0),4)+STRRIGHT(NUMTOSTR(d1,0),4)),color00ffff;
drawtext(t2,pl,STRLEFT(NUMTOSTR(d2+19000000,0),4)+STRRIGHT(NUMTOSTR(d2,0),4)),color00ffff,align2;
drawtext(tx1,pl,STRLEFT(NUMTOSTR(d191+19000000,0),4)+STRRIGHT(NUMTOSTR(d191,0),4)),colorffff33;
drawtext(tx8,pl,STRLEFT(NUMTOSTR(d382+19000000,0),4)+STRRIGHT(NUMTOSTR(D382,0),4)),color00aaaa;
drawtext(tx05,pl,STRLEFT(NUMTOSTR(d05+19000000,0),4)+STRRIGHT(NUMTOSTR(D05,0),4)),color0000ff;
drawtext(tx3,pl,STRLEFT(NUMTOSTR(d618+19000000,0),4)+STRRIGHT(NUMTOSTR(D618,0),4)),color00aaaa;
drawtext(tx5,pl,STRLEFT(NUMTOSTR(d809+19000000,0),4)+STRRIGHT(NUMTOSTR(d809,0),4)),colorffff33;


drawtext(t1,ph*0.99,'0点'),color00ffff;
drawtext(t2,ph*0.99,'100%'),color00ffff,align2;
drawtext(tx1,ph*0.99,'0.191'),colorffff33;
drawtext(tx8,ph*0.99,'0.382'),color00aaaa;
drawtext(tx05,ph*0.99,'0.5'),color0000ff;
drawtext(tx3,ph*0.99,'0.618'),color00aaaa;
drawtext(tx5,ph*0.99,'0.809'),colorffff33;


if 开关=2 then
begin

x236:=间隔*(0.236);
x764:=间隔*(0.764);
x236:=sysparam(2)+左侧右移+ROUND(x236);
tx236:=BARPOS=x236;
VERTLINE(tx236),coloraaaaaa,LINEDOT;
D236:ymd[x236],linethick0;

x764:=t11+ROUND(x764);
tx764:=BARPOS=x764;
VERTLINE(tx764),coloraaaaaa,LINEDOT;
D764:ymd[x764],linethick0;
pllh:=(pl*4+ph)/5;
phhl:=(pl+ph*4)/5;
drawtext(tx236,pllh,STRLEFT(NUMTOSTR(d236+19000000,0),4)+STRRIGHT(NUMTOSTR(d236,0),4)),coloraaaaaa;
drawtext(tx764,pllh,STRLEFT(NUMTOSTR(d764+19000000,0),4)+STRRIGHT(NUMTOSTR(d764,0),4)),coloraaaaaa;
drawtext(tx236,phhl,'0.236'),coloraaaaaa;
drawtext(tx764,phhl,'0.764'),coloraaaaaa;

end;

         {§历史影响现在,现在影响未来。§}

input:n(30,1,1000);
HH:HHV(H,N);
LL:LLV(L,N);

<%

VH=FFL.VARDATA("HH")

VL=FFL.VARDATA("LL")

VN=FFL.VARDATA("N")

LAST=UBOUND(VH)

IF VN>LAST THEN VN=LAST+1

FOR I=LAST TO LAST-VN+1 STEP-1

    VH(I)=VH(LAST)

    VL(I)=VL(LAST)

NEXT

FFL.VARDATA("HH")=VH

FFL.VARDATA("LL")=VL

FFL.VARSTARTINDEX("HH")=LAST-VN+1

FFL.VARSTARTINDEX("LL")=LAST-VN+1

%>

HH,color009999;
DRAWTEXT(c>0  and ISLASTBAR=1,HH,'【黄金分割】↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),HH,HH,2),align2,color009999;
LL+((HH-LL)*0.809),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.809),' 0.809↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.809),LL+((HH-LL)*0.809),2),align2,color009999;
LL+((HH-LL)*0.764),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.764),' 0.764↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.764),LL+((HH-LL)*0.764),2),align2,color009999;
LL+((HH-LL)*0.618),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.618),' 0.618↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.618),LL+((HH-LL)*0.618),2),align2,color009999;
LL+((HH-LL)*0.500),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.500),' 0.500↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.500),LL+((HH-LL)*0.500),2),align2,color009999;
LL+((HH-LL)*0.382),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.382),' 0.382↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.382),LL+((HH-LL)*0.382),2),align2,color009999;
LL+((HH-LL)*0.333),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.333),' 0.333↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.333),LL+((HH-LL)*0.333),2),align2,color009999;
LL+((HH-LL)*0.236),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.236),' 0.236↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.236),LL+((HH-LL)*0.236),2),align2,color009999;
LL+((HH-LL)*0.191),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.191),' 0.191↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.191),LL+((HH-LL)*0.191),2),align2,color009999;
LL,color009999;
DRAWTEXT(c>0  and ISLASTBAR=1,LL,'〖底部起点〗↑'),color009999;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL,LL,2),align2,coloryellow;

fbars:=SYSPARAM(0);
f5:=barssince(c)=fbars-1;
VERTLINE(f5),pointdot,color996666,linethick1,shift5;
DRAWNUMBER(f5,SYSPARAM(4),5,0),shift5;
ff5:=barssince(c)=fbars-5;
VERTLINE(ff5),pointdot,color996666,linethick1;
DRAWNUMBER(ff5,SYSPARAM(4),5,0);
f8:=barssince(c)=fbars-1;
ff8:=barssince(c)=fbars-8;
VERTLINE(f8),pointdot,color996666,linethick1,shift8;
DRAWNUMBER(f8,SYSPARAM(4),8,0),shift8;
VERTLINE(ff8),pointdot,color996666,linethick1;
DRAWNUMBER(ff8,SYSPARAM(4),8,0);
f13:=barssince(c)=fbars-1;
ff13:=barssince(c)=fbars-13;
vertline(f13),pointdot,color996666,linethick1,shift13;
DRAWNUMBER(f13,SYSPARAM(4),13,0),shift13;
vertline(ff13),pointdot,color996666,linethick1;
DRAWNUMBER(ff13,SYSPARAM(4),13,0);
f21:=barssince(c)=fbars-1;
ff21:=barssince(c)=fbars-21;
vertline(f21),pointdot,color996666,linethick1,shift21;
DRAWNUMBER(f21,SYSPARAM(4),21,0),shift21;
vertline(ff21),pointdot,color996666,linethick1;
DRAWNUMBER(ff21,SYSPARAM(4),21,0);
f34:=barssince(c)=fbars-1;
ff34:=barssince(c)=fbars-34;
vertline(f34),pointdot,color996666,linethick1,shift34;
DRAWNUMBER(f34,SYSPARAM(4),34,0),shift34;
vertline(ff34),pointdot,color996666,linethick1;
DRAWNUMBER(ff34,SYSPARAM(4),34,0);
f55:=barssince(c)=fbars-1;
ff55:=barssince(c)=fbars-54;
vertline(f55),pointdot,color996666,linethick1,shift55;
DRAWNUMBER(f55,SYSPARAM(4),55,0)shift55;
vertline(ff55),pointdot,color996666,linethick1;
DRAWNUMBER(ff55,SYSPARAM(4),55,0);
f89:=barssince(c)=fbars-1;
ff89:=barssince(c)=fbars-88;
vertline(f89),pointdot,color996666,linethick1,shift89;
DRAWNUMBER(f89,SYSPARAM(4),89,0),shift89;
vertline(ff89),pointdot,color996666,linethick1;
DRAWNUMBER(ff89,SYSPARAM(4),89,0);
f134:=barssince(c)=fbars+20;
ff134:=barssince(c)=fbars-144;
vertline(f134),pointdot,color996666,linethick1,shift124;
DRAWNUMBER(f134,SYSPARAM(4),144,0),shift124;
vertline(ff134),pointdot,color996666,linethick1;
DRAWNUMBER(ff134,SYSPARAM(4),144,0);


{}
{m 5}
V1:=MA(HIGH,30)*1.15;
V2:=MA(HIGH,3)*1.03;
V3:=MA(LOW,3)*0.97;
V4:=MA(LOW,30)*0.85;
{}
GET:ZIG(3,m),COLORYELLOW;
PL5:=ZIG(3,5);
EN1:=ZIG(3,5)>REF(ZIG(3,5),1) AND REF(ZIG(3,5),1)<=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)<=REF(ZIG(3,5),3);
EX1:=ZIG(3,5)<REF(ZIG(3,5),1) AND REF(ZIG(3,5),1)>=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)>=REF(ZIG(3,5),3);
PL10:=ZIG(3,10);
EN2:=ZIG(3,10)>REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)<=REF(ZIG(3,10),2) AND REF(ZIG(3,10),2)<=REF(ZIG(3,10),3);
EX2:=ZIG(3,10)<REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)>=REF(ZIG(3,10),2) AND REF(ZIG(3,10),2)>=REF(ZIG(3,10),3);
PL20:=ZIG(3,20);
EN3:=ZIG(3,20)>REF(ZIG(3,20),1) AND REF(ZIG(3,20),1)<=REF(ZIG(3,20),2) AND REF(ZIG(3,20),2)<=REF(ZIG(3,20),3);
EX3:=ZIG(3,20)<REF(ZIG(3,20),1) AND REF(ZIG(3,20),1)>=REF(ZIG(3,20),2) AND REF(ZIG(3,20),2)>=REF(ZIG(3,20),3);
PL40:=ZIG(3,40);
走强1:=BARSLAST(PL5<REF(PL5,1));
走弱1:=BARSLAST(PL5>REF(PL5,1));
走强2:=BARSLAST(PL10<REF(PL10,1));
走弱2:=BARSLAST(PL10>REF(PL10,1));
走强3:=BARSLAST(PL20<REF(PL20,1));
走弱3:=BARSLAST(PL20>REF(PL20,1));
ZTJZ5:=IF(PL10>REF(PL10,1),COUNT(EN1,走强2),0);
ZTJD5:=IF(PL10>REF(PL10,1),COUNT(EX1,走强2),0);
DTJZ5:=IF(PL10<REF(PL10,1),COUNT(EN1,走弱2),0);
DTJD5:=IF(PL10<REF(PL10,1),COUNT(EX1,走弱2),0);
ZTJZ10:=IF(PL20>REF(PL20,1),COUNT(EN2,走强3),0);
ZTJD10:=IF(PL20>REF(PL20,1),COUNT(EX2,走强3),0);
DTJZ10:=IF(PL20<REF(PL20,1),COUNT(EN2,走弱3),0);
DTJD10:=IF(PL20<REF(PL20,1),COUNT(EX2,走弱3),0);
DRAWTEXT(EN1 AND DTJZ5=1,L*0.98,'㈠'),COLORFFFF00;
DRAWTEXT(EX1 AND DTJD5=2,H*1.02,'㈡'),COLORFFFF00;
DRAWTEXT(EN2 AND ZTJZ5=1,L*0.98,'㈢'),COLORFFFF00;
DRAWTEXT(EX1 AND PL10>REF(PL10,1) AND ZTJD5=1,H*1.02,'⑴'),COLOR0000FF;
DRAWTEXT(EN1 AND PL10>REF(PL10,1) AND ZTJZ5=2,L*0.98,'⑵'),COLOR0000FF;
DRAWTEXT(EX1 AND PL10>REF(PL10,1) AND ZTJZ5=2,H*1.02,'⑶'),COLOR0000FF;
DRAWTEXT(EN1 AND PL10>REF(PL10,1) AND ZTJZ5=3,L*0.98,'⑷'),COLOR0000FF;
DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=1,H*1.02,'⑸'),COLOR0000FF;
DRAWTEXT(EN2 AND DTJZ10=1,L*0.94,'Ⅰ'),COLORFF6000;
DRAWTEXT(EX2 AND DTJD10=2,H*1.06,'Ⅱ'),COLORFF6000;
DRAWTEXT(EN3 AND ZTJZ10=1,L*0.94,'Ⅲ'),COLORFF6000;
DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=1,H*1.06,'①'),LINETHICK3,COLOR00FFFF;
DRAWTEXT(EN2 AND PL20>REF(PL20,1) AND ZTJZ10=2,L*0.94,'②'),LINETHICK3,COLOR00FFFF;
DRAWTEXT(EX2 AND PL20>REF(PL20,1) AND ZTJD10=2 OR (ZTJD10=0 OR ZTJD10=2) AND EX2,H*1.06,'③'),LINETHICK3,COLOR00FFFF;
DRAWTEXT(EN2 AND PL20>REF(PL20,1) AND ZTJZ10=3,L*0.94,'④'),LINETHICK3,COLOR00FFFF;

[此贴子已经被作者于2011-2-21 17:06:40编辑过]

             请教这个时间黄金分割如何转成金字塔


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


加好友 发短信
等级:小飞侠 帖子:1882 积分:3310 威望:0 精华:15 注册:2010/3/15 13:11:56
  发帖心情 Post By:2011/3/28 14:51:29    Post IP:123.118.80.114[只看该作者]

以下是引用天狼出击在2011-3-28 14:34:07的发言:

             请教这个时间黄金分割如何转成金字塔

直接就可以用。


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


加好友 发短信
等级:新手上路 帖子:99 积分:309 威望:0 精华:0 注册:2011/3/23 20:52:24
  发帖心情 Post By:2011/3/28 15:03:45    Post IP:58.54.176.211[只看该作者]

        谢谢回复:  好象不能用 ,我再试试
[此贴子已经被作者于2011-3-28 15:08:34编辑过]

 回到顶部