分享

【图】★求公式高手您一定帮忙(飞狐转分析家)!

 海天云骞 2017-05-16
本人太笨,搞定不了。飞狐转分析家。
共俩公式,一是自动扣减指数公式。二是自动趋势线公式。我自认为这绝对称的上是好公式,在飞狐里用的很好,但我更喜欢用分析家软件。请您帮忙!
                                    
                                         拜谢!

第一个公式:

p1:=5
p2;=10
p3:=30
p4:=60
p5:=120;
p6:=250;
MA1:MA(CLOSE,P1),COLORcyan;
MA2:MA(CLOSE,P2),COLORgreen;
MA3:MA(CLOSE,P3),COLORMAGENTA,linethick2;
MA4:MA(CLOSE,P4),COLORblue,linethick2;
MA5:MA(CLOSE,P5),COLORgray;
MA6:MA(CLOSE,P6),COLORbrown;
KDB1:=filter(backset(BARSCOUNT(C)=SYSPARAM(1) ,P1),P1);
KDB2:=filter(backset(BARSCOUNT(C)=SYSPARAM(1) ,P2),P2);
KDB3:=filter(backset(BARSCOUNT(C)=SYSPARAM(1) ,P3),P3);
KDB4:=filter(backset(BARSCOUNT(C)=SYSPARAM(1) ,P4),P4);
KDB5:=filter(backset(BARSCOUNT(C)=SYSPARAM(1) ,P5),P5);
KDB6:=filter(backset(BARSCOUNT(C)=SYSPARAM(1) ,P6),P6);
vertline(KDB1),colorCYAN,POINTDOT;
vertline(KDB2),colorCYAN,POINTDOT;
vertline(KDB3),colorCYAN,POINTDOT;
vertline(KDB4),colorCYAN,POINTDOT;
vertline(KDB5),colorCYAN,POINTDOT;
vertline(KDB6),colorCYAN,POINTDOT;
DRAWNUMBER(BARSCOUNT(C)=SYSPARAM(1),L*0.98,C,0),colorcyan;
DRAWICON(KDB1,L,8),colorcyan,align5;
DRAWNUMBER(KDB1,L*0.98,C,0),colorcyan;
DRAWICON(KDB2,L,8),colorcyan,align5;
DRAWNUMBER(KDB2,L*0.98,C,0),colorcyan;
DRAWICON(KDB3,L,8),colorcyan,align5;
DRAWNUMBER(KDB3,L*0.98,C,0),colorcyan;
DRAWICON(KDB4,L,8),colorcyan,align5;
DRAWNUMBER(KDB4,L*0.98,C,0),colorcyan;
DRAWICON(KDB5,L,8),colorcyan,align5;
DRAWNUMBER(KDB5,L*0.98,C,0),colorcyan;
DRAWICON(KDB6,L,8),colorcyan,align5;

STICKLINE(open>=close ,close ,open,9,0 ),COLORaaaaaa;
STICKLINE(open>=close ,close ,open,6,0 ),COLORbbbbbb;
STICKLINE(open>=close ,close ,open,2.4,0 ),COLORcccccc;
STICKLINE(open>=close ,close ,open,1.1,0 ),COLORdddddd;

STICKLINE(close>open,close,open,9,0 ),COLOr6666cc;
STICKLINE(close>open,close,open,6 ,0 ),COLOR7777dd;
STICKLINE(close>open,close,open,2.4 ,0 ),COLOR8888ee;
STICKLINE(close>open,close,open,1.1 ,0 ),COLOR9999ff;

STICKLINE(close>open,open,low,0.5,0 ),COLOR1199ff;
STICKLINE(close>open,close,HIGH,0.5 ,0 ),COLOR1199ff;
STICKLINE(open>=close,close,low,0.5 ,0 ),COLORcccccc;
STICKLINE(open>=close,open,HIGH,0.5 ,0 ),COLORcccccc;


第二个公式:

MA1:MA(CLOSE,P1);
MA2:MA(CLOSE,P2);
MA3:MA(CLOSE,P3);
MA4:MA(CLOSE,P4);
DRAWTEXT(sysparam(2)=BARSCOUNT(CLOSE),c,'
所属板块:'+BLKNAME),COLOR33CC33,ALIGN4;

d1:=ref(h,N);
d2:=d1=hhv(h,2*N+1);
d3:=FILTER(d2,N);
d4:=BACKSET(d3,N+1);
HD:=FILTER(d4,N);

d5:=ref(l,N);
d6:=d5=llv(l,2*N+1);
d7:=FILTER(d6,N);
d8:=BACKSET(d7,N+1);
LD:=filter(d8,n);


D:=BACKSET(ISLASTBAR,BARSLAST(HD)+1);
E:=D>REF(D,1);
F:=BACKSET(E,REF(BARSLAST(HD),1)+2);
G:=F>REF(F,1);
DRAWLINE(G,h,E,h,1),pointdot,linethick1,coloryellow;

I:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);
J:=I>REF(I,1);
K:=BACKSET(J,REF(BARSLAST(LD),1)+2);
M:=K>REF(K,1);
DRAWLINE(M,l,J,l,1),pointdot,linethick1,COLORFFB97A;

{求压力线方程}
M1:=BARSLAST(e);
M2:=barslast(g);
M3:=ref(h,m1);
m4:=ref(h,m2);
M5:=m4-m2*(m4-m3)/(m2-M1);
DRAWICON(REF(c,1)<=ref(m5,1) and c>m5,M5,4),ALIGN2;

{求阻力线方程}
n1:=barslast(j);
n2:=barslast(m);
n3:=ref(l,n1);
n4:=ref(l,n2);
n5:=n4-n2*(n4-n3)/(n2-n1);
DRAWICON(REF(c,1)>=ref(n5,1) and c<n5,n5,5),ALIGN1;

买点:if(REF(c,1)<=ref(m5,1) and c>m5,1,0), LINETHICK0 ;
卖点:if(REF(c,1)>=ref(n5,1) and c<n5,1,0), LINETHICK0 ;

[ Last edited by 有缘人 on 2005-1-14 at 23:35 ]股票论坛 www.55188.com

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约