以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://222.73.7.161/bbs/index.asp)
--  公式模型编写问题提交  (http://222.73.7.161/bbs/list.asp?boardid=4)
----  请斑竹和各位老师帮飞狐指标改成金字塔指标谢谢  (http://222.73.7.161/bbs/dispbbs.asp?boardid=4&id=738)

--  作者:天地我心
--  发布时间:2010/1/23 20:18:25
--  请斑竹和各位老师帮飞狐指标改成金字塔指标谢谢

{公式名称:KMA}

p1:5  p2:10 p3:20  p4:30 p5:55 p6:144
input:P1(5,1,100),P2(10,1,100),P3(20,1,100),P4(30,1,100),P5(55,1,100),P6(144,1,300);
MA1:MA(CLOSE,P1);
MA2:MA(CLOSE,P2);
MA3:MA(CLOSE,P3);
MA4:MA(CLOSE,P4);
MA5:MA(CLOSE,P5);
MA6:MA(CLOSE,P6);
LMA1:=MA1;
LMA2:=MA2;
LMA3:=MA3;
LMA4:=MA4;
LMA5:=MA5;
LMA6:=MA6;
<%
vma1=ffl.vardata("lma1")
vma2=ffl.vardata("lma2")
vma3=ffl.vardata("lma3")
vma4=ffl.vardata("lma4")
vma5=ffl.vardata("lma5")
vma6=ffl.vardata("lma6")
last=ubound(vma1)
for i=0 to last
vma1(i)=vma1(last)
vma2(i)=vma2(last)
vma3(i)=vma3(last)
vma4(i)=vma4(last)
vma5(i)=vma5(last)
vma6(i)=vma6(last)
next
ffl.vardata("lma1")=vma1
ffl.vardata("lma2")=vma2
ffl.vardata("lma3")=vma3
ffl.vardata("lma4")=vma4
ffl.vardata("lma5")=vma5
ffl.vardata("lma6")=vma6
%>
MA1A:=(CLOSE-REF(CLOSE,P1-1))/P1+MA1;
MA2A:=(CLOSE-REF(CLOSE,P2-1))/P2+MA2;
MA3A:=(CLOSE-REF(CLOSE,P3-1))/P3+MA3;
MA4A:=(CLOSE-REF(CLOSE,P4-1))/P4+MA4;
MA5A:=(CLOSE-REF(CLOSE,P5-1))/P5+MA5;
MA6A:=(CLOSE-REF(CLOSE,P6-1))/P6+MA6;
DRAWLINE(BACKSET(ISLASTBAR,2),LMA1,ISLASTBAR,MA1A,0),SHIFT1,LINETHICK0,PRECISION254,colorFFFFFF;
DRAWLINE(BACKSET(ISLASTBAR,2),LMA2,ISLASTBAR,MA2A,0),SHIFT1,LINETHICK0,PRECISION254,colorFFFF;
DRAWLINE(BACKSET(ISLASTBAR,2),LMA3,ISLASTBAR,MA3A,0),SHIFT1,LINETHICK0,PRECISION254,colorFF00FF;
DRAWLINE(BACKSET(ISLASTBAR,2),LMA4,ISLASTBAR,MA4A,0),SHIFT1,LINETHICK0,PRECISION254,colorFF00;
DRAWLINE(BACKSET(ISLASTBAR,2),LMA5,ISLASTBAR,MA5A,0),SHIFT1,LINETHICK0,PRECISION254,colorFF8080;
DRAWLINE(BACKSET(ISLASTBAR,2),LMA6,ISLASTBAR,MA6A,0),SHIFT1,LINETHICK0,PRECISION254,colorCC88FF;
LMA1A:=MA1A;
LMA2A:=MA2A;
LMA3A:=MA3A;
LMA4A:=MA4A;
LMA5A:=MA5A;
LMA6A:=MA6A;
<%
vma1a=ffl.vardata("lma1a")
vma2a=ffl.vardata("lma2a")
vma3a=ffl.vardata("lma3a")
vma4a=ffl.vardata("lma4a")
vma5a=ffl.vardata("lma5a")
vma6a=ffl.vardata("lma6a")
last=ubound(vma1a)
for i=0 to last
vma1a(i)=vma1a(last)
vma2a(i)=vma2a(last)
vma3a(i)=vma3a(last)
vma4a(i)=vma4a(last)
vma5a(i)=vma5a(last)
vma6a(i)=vma6a(last)
next
ffl.vardata("lma1a")=vma1a
ffl.vardata("lma2a")=vma2a
ffl.vardata("lma3a")=vma3a
ffl.vardata("lma4a")=vma4a
ffl.vardata("lma5a")=vma5a
ffl.vardata("lma6a")=vma6a
%>
MA1B:=(CLOSE-REF(CLOSE,P1-2))/(P1-1)+MA1A;
MA2B:=(CLOSE-REF(CLOSE,P2-2))/(P2-1)+MA2A;
MA3B:=(CLOSE-REF(CLOSE,P3-2))/(P3-1)+MA3A;
MA4B:=(CLOSE-REF(CLOSE,P4-2))/(P4-1)+MA4A;
MA5B:=(CLOSE-REF(CLOSE,P5-2))/(P5-1)+MA5A;
MA6B:=(CLOSE-REF(CLOSE,P6-2))/(P6-1)+MA6A;
DRAWLINE(BACKSET(ISLASTBAR,2),LMA1A,ISLASTBAR,MA1B,0),SHIFT2,colorFFFFFF;
DRAWLINE(BACKSET(ISLASTBAR,2),LMA2A,ISLASTBAR,MA2B,0),SHIFT2,colorFFFF;
DRAWLINE(BACKSET(ISLASTBAR,2),LMA3A,ISLASTBAR,MA3B,0),SHIFT2,colorFF00FF;
DRAWLINE(BACKSET(ISLASTBAR,2),LMA4A,ISLASTBAR,MA4B,0),SHIFT2,colorFF00;
DRAWLINE(BACKSET(ISLASTBAR,2),LMA5A,ISLASTBAR,MA5B,0),SHIFT2,colorFF8080;
DRAWLINE(BACKSET(ISLASTBAR,2),LMA6A,ISLASTBAR,MA6B,0),SHIFT2,colorCC88FF;
LMA1B:=MA1B;
<%
vma1b=ffl.vardata("lma1b")
last=ubound(vma1b)
for i=0 to last
vma1b(i)=vma1b(last)
next
ffl.vardata("lma1b")=vma1b
%>
MA1C:=(CLOSE-REF(CLOSE,P1-3))/(P1-2)+MA1B;
DRAWLINE(BACKSET(ISLASTBAR,2),LMA1B,ISLASTBAR AND MA1C>0,MA1C,0),SHIFT3,colorFFFFFF;
LMA1C:=MA1C;
<%
vma1c=ffl.vardata("lma1c")
last=ubound(vma1c)
for i=0 to last
vma1c(i)=vma1c(last)
next
ffl.vardata("lma1c")=vma1c
%>
MA1D:=(CLOSE-REF(CLOSE,P1-4))/(P1-3)+MA1C;
DRAWLINE(BACKSET(ISLASTBAR,2),LMA1C,ISLASTBAR AND MA1D>0,MA1D,0),SHIFT4,colorFFFFFF;
LMA1D:=MA1D;
<%
vma1d=ffl.vardata("lma1d")
last=ubound(vma1d)
for i=0 to last
vma1d(i)=vma1d(last)
next
ffl.vardata("lma1d")=vma1d
%>
MA1E:=(CLOSE-REF(CLOSE,P1-5))/(P1-4)+MA1D;
DRAWLINE(BACKSET(ISLASTBAR,2),LMA1D,ISLASTBAR AND MA1E>0,MA1E,0),SHIFT5,colorFFFFFF;

 

 

 

 

 

谢谢斑竹和各位老师  谢谢



--  作者:rjyl
--  发布时间:2010/1/23 20:20:37
--  
图片点击可在新窗口打开查看开头我还看得懂,越往后面越看不懂了!我是菜鸟级,刚刚开始学!帮你顶一下帖子
--  作者:admin
--  发布时间:2010/1/23 21:01:53
--  
金字塔目前暂时不支持公式内嵌VBS脚本
--  作者:天地我心
--  发布时间:2010/1/24 11:20:12
--  
老师以后金字塔版本会支持公式内嵌VBS脚本 吗?谢谢
--  作者:admin
--  发布时间:2010/1/24 13:38:22
--  

以后会支持的