吴千福

成功方法:其实就是把简单知识深刻理解加灵活运用。

博文 字体:

缠论公式集

  [2013-12-22 13:37:25] 
缠论公式集
段成选股
var1:="chzhshch@kxian";{处理K线}
var2:="chzhshch@bi";{处理笔关系}
var3:="chzhshch@duan";{处理段关系}
var4:="chzhshch@duan2";{处理更高级别段关系}
bi1:=if(c>0,BARSLAST(var20));{已完成笔向上}
bi2:=if(c>0,BARSLAST(var2>0),BARSLAST(var2
bidi:=ref(l,SUMBARS(bi1=0,1)-1);{当前之前(如果在点上算自身1次)第n个笔低点的值}
bigao:=ref(h,SUMBARS(bi2=0,1)-1);{当前之前(如果在点上算自身1次)第n个笔高点的值}
duan1:=if(c>0,BARSLAST(var30));{已完成段向上}
duan2:=if(c>0,BARSLAST(var3>0),BARSLAST(var3
duanA:=if(c>0,BARSLAST(var40));{已完成更高级段向上}
duanB:=if(c>0,BARSLAST(var4>0),BARSLAST(var4
未完成笔往下:BARSLAST(var2>0)
未完成段往下:BARSLAST(var3>0)
未完成笔向上:BARSLAST(var2>0)>BARSLAST(var2
未完成段向上:BARSLAST(var3BARSLAST(var3>0);
TYP:=(HIGH+LOW+CLOSE)/3;
CCI:=(TYP-MA(TYP,18))/(0.015*AVEDEV(TYP,18));
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
f30段上选股:未完成段向上=1 and CCI
F30段下二买:未完成段往下=1 and dea>0 AND CCI
MACD底背离选股公式——、同花顺
底背离,版、同花顺版}
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
QZQ:=BARSLAST(REF(MACD,1)0);
QM:=LLVBARS(MACD,QZQ+20);
MQDZ:=IF(QM>QZQ,REF(MACD,QM),0);
XG1:=MACDMQDZ
AND CLOSE=LLV(CLOSE,QZQ+20) AND MQDZ
XG:REF(XG1,1)=1 AND MACD>REF(MACD,1);
 
{双底背离,版、同花顺版}
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
QZQ:=BARSLAST(REF(MACD,1)0);
QM:=LLVBARS(MACD,QZQ+20);
MQDZ:=IF(QM>QZQ,REF(MACD,QM),0);
QF:=LLVBARS(DIFF,QZQ+20);
DQDZ:=IF(QF>QZQ,REF(DIFF,QF),0);
XG1:=MACDMQDZ AND DIFFDQDZ
 AND CLOSE=LLV(CLOSE,QZQ+20) AND MQDZ
XG:REF(XG1,1)=1 AND MACD>REF(MACD,1);
 
注:底双背离是指MACD(绿柱)和DIFF(黄白线)都底背离。
 
飞狐5/10均线面积主图公式源码
这是在飞狐交易师主图上的5日和10日均线面积公式,有趋势平均力度,希望对大家有帮助。
    注意:这是主图技术指标,建公式时一定要把“主图叠加”勾选上!
{5/10均线面积}
MA5:MA(C,5);
MA10:MA(C,10);
均线差:=MA5-MA10;
JC:=MA10-MA5;
绿柱面积:=IF (均线差
红柱面积:=IF (均线差>0,SUM(均线差*0.1,BARSLAST(JC>0)),0);
均线面积:IF(均线差>0,红柱面积,绿柱面积),color0000ff,LINETHICK0;
A1:=IF(均线差>0,1,-1);
A2:=REF(A1,1);
A3:=A1*A2;
A4:=BARSLAST(A3
A5:=A4+1;
趋势平均力度:(SUM(均线差,0)-REF(SUM(均线差,0),A5))/A5,colorFF00FF,LINETHICK0;
drawnumber(ref(均线差,1)>0 and 均线差
drawnumber(ref(均线差,1)>0 and 均线差
drawnumber(ref(均线差,1)=0 ,LLV(L,8),ref(abs(绿柱面积),1),3),ALIGN2,pxdn5,Color004A00;
drawnumber(ref(均线差,1)=0 ,LLV(L,8),ref(abs(趋势平均力度),1),3),ALIGN2,pxdn30,colorff00ff;
drawnumber(islastbar and 均线差
drawnumber(islastbar and 均线差
drawnumber(islastbar and 均线差>0,HHV(H,5),abs(红柱面积),3),align2,pxup20,colorred;
drawnumber(islastbar and 均线差>0,HHV(H,5),abs(趋势平均力度),3),align2,pxup45,colorff00ff;
 
MACD底背离选股公式——飞狐、大智慧L2
{底背离,飞狐版、大智慧L2版、大智慧经典(免费)版}
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
QZQ:=BARSLAST(REF(MACD,1)0);
QM:=LLVBARS(MACD,QZQ+20);
MQDZ:=IF(QM>QZQ,REF(MACD,QM),0);
XG1:=MACDMQDZ
 AND CLOSE=LLV(CLOSE,QZQ+20) AND MQDZ
XG:REF(XG1,1)<>0 AND MACD>REF(MACD,1);
 
{双底背离,飞狐版、大智慧L2版}
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
QZQ:=BARSLAST(REF(MACD,1)0);
QM:=LLVBARS(MACD,QZQ+20);
MQDZ:=IF(QM>QZQ,REF(MACD,QM),0);
QF:=LLVBARS(DIFF,QZQ+20);
DQDZ:=IF(QF>QZQ,REF(DIFF,QF),0);
XG1:=MACDMQDZ AND DIFFDQDZ
 AND CLOSE=LLV(CLOSE,QZQ+20) AND MQDZ
XG:REF(XG1,1)<>0 AND MACD>REF(MACD,1);
 
注:底双背离是指MACD(绿柱)和DIFF(黄白线)都底背离。
 
红绿柱面积公式——飞狐和大智慧L2版
 
 
{MACD红绿柱面积(飞狐版副图)参数默认值:p=26;s=12;m=9}
DIFF1:=EMA(CLOSE,s) - EMA(CLOSE,p);
DEA1:=EMA(DIFF1,m);
MACD:2*(DIFF1-DEA1){,COLORSTICK},LINETHICK0;
MACDhs:=IF(MACD>0 AND MACD>=REF(MACD,1),MACD,0);
MACDhx:=IF(MACD>0 AND MACD
MACDlx:=IF(MACD
MACDls:=IF(MACDREF(MACD,1),MACD,0);
STICKLINE(MACDhs>0,0,MACD,9,0),Color0000BB;
STICKLINE(MACDhs>0,0,MACD,8,0),Color0000CC;
STICKLINE(MACDhs>0,0,MACD,7,0),Color0011CC;
STICKLINE(MACDhs>0,0,MACD,6,0),Color1122DD;
STICKLINE(MACDhs>0,0,MACD,5,0),Color2233DD;
STICKLINE(MACDhs>0,0,MACD,4,0),Color3344EE;
STICKLINE(MACDhs>0,0,MACD,3,0),Color4455EE;
STICKLINE(MACDhs>0,0,MACD,2,0),Color5566FF;
STICKLINE(MACDhs>0,0,MACD,1,0),Color6677FF;
STICKLINE(MACDhx>0,0,MACD,9,0),Color0077BB;
STICKLINE(MACDhx>0,0,MACD,8,0),Color0088CC;
STICKLINE(MACDhx>0,0,MACD,7,0),Color0099CC;
STICKLINE(MACDhx>0,0,MACD,6,0),Color00AADD;
STICKLINE(MACDhx>0,0,MACD,5,0),Color00BBDD;
STICKLINE(MACDhx>0,0,MACD,4,0),Color00CCEE;
STICKLINE(MACDhx>0,0,MACD,3,0),Color00DDEE;
STICKLINE(MACDhx>0,0,MACD,2,0),Color00EEFF;
STICKLINE(MACDhx>0,0,MACD,1,0),Color00FFFF;
STICKLINE(MACDlx
STICKLINE(MACDlx
STICKLINE(MACDlx
STICKLINE(MACDlx
STICKLINE(MACDlx
STICKLINE(MACDlx
STICKLINE(MACDlx
STICKLINE(MACDlx
STICKLINE(MACDlx
STICKLINE(MACDls
STICKLINE(MACDls
STICKLINE(MACDls
STICKLINE(MACDls
STICKLINE(MACDls
STICKLINE(MACDls
STICKLINE(MACDls
STICKLINE(MACDls
STICKLINE(MACDls
DIFF:DIFF1,Color0000FF;
DEA:DEA1,ColorFF0000;
红柱面积:IF(MACD>0,SUM(MACD,BARSLAST(MACD
绿柱面积:IF(MACD0)),0),LINETHICK0,Color006000;
{平均面积: IF(MACD>0,10*红柱面积/BARSLAST(MACD0)),LINETHICK0,ColorFF00FF;}
DRAWNUMBER(ref(MACD,1)>0 and MACD
{DRAWNUMBER(ref(MACD,1)>0 and MACD
DRAWNUMBER(ref(MACD,1)=0 ,LLV(MACD,4),ref(abs(绿柱面积),1),2),ALIGN1,pxdn5,Color006000;
{DRAWNUMBER(ref(MACD,1)=0 ,LLV(MACD,4),ref(abs(平均面积),1),2),ALIGN1,pxdn30,ColorFF00FF;}
DRAWNUMBER(BARSTATUS=2 AND MACD
{DRAWNUMBER(BARSTATUS=2 AND MACD
DRAWNUMBER(BARSTATUS=2 AND MACD>0,HHV(MACD,4),abs(红柱面积),2),align2,pxup10,colorred;
{DRAWNUMBER(BARSTATUS=2 AND MACD>0,HHV(MACD,4),abs(平均面积),2),align2,pxup35,ColorFF00FF;}
DRAWNUMBER(MACD>0 AND MACD=HHV(MACD,BARSLAST(MACD=REFX(MACD,1) AND MACD>=REFX(MACD,2),MACD,MACD,2),align0,pxup20,ColorFF0000;
DRAWNUMBER(MACD0)) AND MACD
0,Color000000;
 
 
 
{MACD红绿柱面积(大智慧L2版副图)参数默认值:p=26;s=12;m=9}
DIFF:EMA(CLOSE,s) - EMA(CLOSE,p);
DEA:EMA(DIFF,m);
MACD:2*(DIFF-DEA){,COLORSTICK},LINETHICK0;
MACDhs:=IF(MACD>0 AND MACD>REF(MACD,1),MACD,0);
MACDhx:=IF(MACD>0 AND MACD
MACDlx:=IF(MACD
MACDls:=IF(MACDREF(MACD,1),MACD,0);
STICKLINE(MACDhs>0,0,MACD,9,0),Color0000BB;
STICKLINE(MACDhs>0,0,MACD,8,0),Color0000CC;
STICKLINE(MACDhs>0,0,MACD,7,0),Color0000CC;
STICKLINE(MACDhs>0,0,MACD,6,0),Color0000DD;
STICKLINE(MACDhs>0,0,MACD,5,0),Color0033DD;
STICKLINE(MACDhs>0,0,MACD,4,0),Color3355EE;
STICKLINE(MACDhs>0,0,MACD,3,0),Color6677EE;
STICKLINE(MACDhs>0,0,MACD,2,0),Color8888FF;
STICKLINE(MACDhs>0,0,MACD,1,0),Color9999FF;
STICKLINE(MACDhx>0,0,MACD,9,0),Color0077BB;
STICKLINE(MACDhx>0,0,MACD,8,0),Color0088CC;
STICKLINE(MACDhx>0,0,MACD,7,0),Color0099CC;
STICKLINE(MACDhx>0,0,MACD,6,0),Color00AADD;
STICKLINE(MACDhx>0,0,MACD,5,0),Color11BBDD;
STICKLINE(MACDhx>0,0,MACD,4,0),Color22CCEE;
STICKLINE(MACDhx>0,0,MACD,3,0),Color33DDEE;
STICKLINE(MACDhx>0,0,MACD,2,0),Color44EEFF;
STICKLINE(MACDhx>0,0,MACD,1,0),Color55FFFF;
STICKLINE(MACDlx
STICKLINE(MACDlx
STICKLINE(MACDlx
STICKLINE(MACDlx
STICKLINE(MACDlx
STICKLINE(MACDlx
STICKLINE(MACDlx
STICKLINE(MACDlx
STICKLINE(MACDlx
STICKLINE(MACDls
STICKLINE(MACDls
STICKLINE(MACDls
STICKLINE(MACDls
STICKLINE(MACDls
STICKLINE(MACDls
STICKLINE(MACDls
STICKLINE(MACDls
STICKLINE(MACDls
绿柱面积:10*IF (MACD0)),0),LINETHICK0,Color00ff00;
红柱面积:10*IF (MACD>0,SUM(MACD,BARSLAST(MACD
DRAWTEXT(ref(MACD,1)>0 and MACD
DRAWTEXT(ref(MACD,1)=0 ,LLV(MACD,4),''+ref(abs(绿柱面积),1)),ALIGN1,Color00ff00;
DRAWTEXT(BARSTATUS=2 AND MACD
DRAWTEXT(BARSTATUS=2 AND MACD>0,HHV(MACD,4),''+abs(红柱面积)),align2,VALIGN1,colorred;
注:底双背离是指MACD(绿柱)和DIFF(黄白线)都底背离。
 
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
QZQ:=BARSLAST(REF(MACD,1)0);
QM:=LLVBARS(MACD,QZQ+20);
MQDZ:=IF(QM>QZQ,REF(MACD,QM),0);
QF:=LLVBARS(DIFF,QZQ+20);
DQDZ:=IF(QF>QZQ,REF(DIFF,QF),0);
XG1:=MACDMQDZ AND DIFFDQDZ
 AND CLOSE=LLV(CLOSE,QZQ+20) AND MQDZ
XG:REF(XG1,1)<>0 AND MACD>REF(MACD,1);


  《缠浪公式源码》

微信朋友圈 生成长微博
阅读(628)收藏(0)
网友评论 已有0条评论
500/500

个人资料

博客等级:6

博客积分:8455

总访问量:84520

文章总数:207

实盘直播

网站导航| 关于金融界| 广告服务| 产品与服务| 合作伙伴| 法律声明| 人员招聘| 征稿启事| 意见征集| 联系我们| About Us

Copyright © JRJ.COM Inc. All Rights Reserved. 版权声明