大智慧公式源码2.docx
《大智慧公式源码2.docx》由会员分享,可在线阅读,更多相关《大智慧公式源码2.docx(26页珍藏版)》请在冰豆网上搜索。
大智慧公式源码2
SELECT:
OPENANDOPENANDCLOSE>MA(CLOSE,13)-0.01ANDCLOSE>MA(CLOSE,34)-0.01
ANDCLOSE>MA(CLOSE,55)-0.01
1.缠中说禅:
笔
MA5:
MA(C,5),colorwhite;
MA13:
MA(C,13),coloryellow;
MA21:
MA(C,21),colormagenta;
MA34:
MA(C,34),colorgreen;
MA55:
MA(C,55),colorf00ff0,linethick2;
MA89:
MA(C,89),colorgray;
MA144:
MA(C,144),colorblue;
MA233:
MA(C,233),colorf0f000,linethick2;
{布林曲线}
MID:
MA(CLOSE,26),pointdot,colorwhite;
UPPER:
MID+2*STD(CLOSE,26),linethick0,coloryellow,dotline;
LOWER:
MID-2*STD(CLOSE,26),linethick0,colorgreen,dotline;
收口:
=UPPER-LOWER;
partline(MID,MID>=ref(MID,1),rgb(255,255,0),MIDpartline(UPPER,UPPER>=ref(UPPER,1),rgb(255,255,0),UPPERpartline(LOWER,LOWER>ref(LOWER,1),rgb(255,255,0),LOWER<=ref(LOWER,1),rgb(0,255,0)),linethick1,dotline;
{
partline(UPPER,收口>=ref(收口,1),rgb(255,255,0),收口partline(LOWER,收口>=ref(收口,1),rgb(255,255,0),收口}
{缠中说禅}
分型:
="chanlun@kxian";{这个放第一个要不会出问题滴-_-\\\~~}
笔:
="chanlun@bi";
bilast:
="chanlun@bilast";
段:
="chanlun@duan";
duanlast:
="chanlun@duanlast";
jxyl:
="chanlun@JXYL2";
jxzc:
="chanlun@JXZC2";
drawline(笔=1,h,笔=-1,l,0),coloryellow,linethick2;
drawline(笔=-1,l,笔=1,h,0),coloryellow,linethick2;
drawline(段=1,h,段=-1,l,0),colorblue,linethick2;
drawline(段=-1,l,段=1,h,0),colorblue,linethick2;
DRAWTEXT(笔=1,h,''+h+'/T'+bilast+'/MA:
'+jxyl),coloryellow,align1,valign2;
DRAWTEXT(笔=-1,l,''+l+'/T'+bilast+'/MA:
'+jxzc),colorCyan,align1;
2.macd面积
DIF:
EMA(CLOSE,short)-EMA(CLOSE,long);
DEA:
EMA(DIF,mid);
MACD:
2*(DIF-DEA),COLORSTICK;
{面积计算}
绿面积:
IF(MACD<0,SUM(MACD,BARSLAST(MACD>0))*100,0),linethick0,colorblue;
红面积:
IF(MACD>0,SUM(MACD,BARSLAST(MACD<0))*100,0),linethick0,colorred;
红显示:
=CROSS(DEA,DIF);
绿显示:
=CROSS(DIF,DEA);
DRAWTEXT(红显示,DEA*1.03,NUMTOSTRN(REF(红面积,1),0)),colorred,valign2;
DRAWTEXT(绿显示,DEA*0.97,NUMTOSTRN(REF(绿面积,1),0)),colorgreen;
{当前面积}
DRAWTEXT(BARSTATUS=2andmacd>0,-macd*0.03,NUMTOSTRN(红面积,0)),coloryellow,valign0,align2;
DRAWTEXT(BARSTATUS=2andmacd<=0,-macd*0.03,NUMTOSTRN(绿面积,0)),COLORFFCC66,valign2,align2;
多空线:
0,colorwhite,dotline;
stickline(MACD<0andMACD>=REF(MACD,1),0,macd,0,0),COLORFFCC66;
stickline(MACD<0andMACDstickline(MACD>=0andMACD>REF(MACD,1),0,macd,0,0),COLORRed;
stickline(MACD>=0andMACD<=REF(MACD,1),0,macd,0,0),COLORYellow;
partline(dif,dif>=ref(dif,1),rgb(255,0,0),dif
3.中:
MA(CLOSE,N),colorgray,dotline;
上:
中+P*STD(CLOSE,N),colorgray,dotline;
下:
中-P*STD(CLOSE,N),colorgray,dotline;
MA1:
MA(CLOSE,P1),colorwhite;
MA2:
MA(CLOSE,P2),coloryellow;
MA3:
MA(CLOSE,P3),colorred;
MA4:
MA(CLOSE,P4),colorgreen;
MA5:
MA(CLOSE,P5),colorf00ff0;
MA6:
MA(CLOSE,P6),colorblue;
分型:
="chanlun@kxian";
笔:
="chanlun@bi";
bilast:
="chanlun@bilast";
段:
="chanlun@duan";
duanlast:
="chanlun@duanlast";
jxyl:
="chanlun@JXYL2";
jxzc:
="chanlun@JXZC2";
DRAWTEXT(笔=1,h,''+h+'/T'+bilast),colorCyan,align1,valign2;
DRAWTEXT(笔=-1,l,''+l+'/T'+bilast),colorCyan,align1;
4.上证_开:
"SH000001$OPEN",LINETHICK0,colorwhite;
上证_高:
"SH000001$HIGH",LINETHICK0,colorwhite;
上证_低:
"SH000001$LOW",LINETHICK0,colorwhite;
上证_收:
"SH000001$CLOSE",LINETHICK0,colorred;
STICKLINE(上证_收>=上证_开,上证_开,上证_收,7,0),COLORRED;
STICKLINE(上证_收>=上证_开,上证_高,上证_低,0.1,0),COLORRED;
STICKLINE(上证_收<=上证_开,上证_开,上证_收,7,0),COLORGREEN;
STICKLINE(上证_收<=上证_开,上证_高,上证_低,0.1,0),COLORGREEN;
五:
MA(上证_收,5),colorwhite;
十:
MA(上证_收,10),coloryellow;
三十:
MA(上证_收,20),colorred;
六十:
MA(上证_收,60),colorgreen;
一百二十:
MA(上证_收,120),colorf00ff0;
二百五十:
MA(上证_收,250),colorblue;
5、主图公式:
kx:
="chanlun@kxian";{这个放第一个要不会出问题滴-_-\\\~~}
kxg:
="chanlun@kxg";
kxd:
="chanlun@kxd";
kxfx:
="chanlun@kxfx";
kxno:
"chanlun@kxno",linethick0,coloryellow;
kxnobh:
"chanlun@kxnobh",linethick0,coloryellow;
笔:
="chanlun@bi";
bilast:
"chanlun@bilast",linethick0,coloryellow;
段:
="chanlun@duan";
duanlast:
"chanlun@duanlast",linethick0,coloryellow;
bifx:
=-REF(笔,bilast);
duanfx:
=-REF(段,duanlast);
{笔高低点周期力度提示}
DRAWTEXT(笔=1,h,''+h+'/T'+bilast+'/+'+(h-REF(l,bilast))),colorgreen,align1,valign2;
DRAWTEXT(笔=-1,l,''+l+'/T'+bilast+'/'+(l-REF(h,bilast))),colorred,align1;
{当下提示周期}
DRAWTEXT(BARSTATUS=2ANDbifx=1ANDbilast>4,h*1.008,'T'+bilast+'/+'+(c-REF(l,bilast))),colorMagenta,align0,valign2;
DRAWTEXT(BARSTATUS=2ANDbifx=-1ANDbilast>4,l*0.992,'T'+bilast+'/'+(c-REF(h,bilast))),colorGreen,align0;
主图公式:
NPP1
中:
MA(CLOSE,N),colorgray,dotline;
压:
中+P*STD(CLOSE,N),colorgray,dotline;
支:
中-P*STD(CLOSE,N),colorgray,dotline;
MA1:
MA(CLOSE,5),colorwhite;
MA2:
MA(CLOSE,10),coloryellow;
MA3:
MA(CLOSE,30),colorgreen;
MA4:
MA(CLOSE,60),colorred;
MA5:
MA(CLOSE,120),colorf00ff0;
MA6:
MA(CLOSE,250),colorblue;
kx:
="chanlun@kxian";{这个放第一个要不会出问题滴-_-\\\~~}
kxg:
="chanlun@kxg";
kxd:
="chanlun@kxd";
kxfx:
="chanlun@kxfx";
kxno:
"chanlun@kxno",linethick0,coloryellow;
kxnobh:
"chanlun@kxnobh",linethick0,coloryellow;
笔:
="chanlun@bi";
bilast:
"chanlun@bilast",linethick0,coloryellow;
段:
="chanlun@duan";
duanlast:
"chanlun@duanlast",linethick0,coloryellow;
bifx:
=-REF(笔,bilast);
duanfx:
=-REF(段,duanlast);
{笔高低点周期力度提示}
DRAWTEXT(笔=1,h,''+h+'/T'+bilast+'/+'+(h-REF(l,bilast))),colorred,align1,valign2;
DRAWTEXT(笔=-1,l,''+l+'/T'+bilast+'/'+(l-REF(h,bilast))),colorgreen,align1;
{当下提示周期}
DRAWTEXT(BARSTATUS=2ANDbifx=1ANDbilast>4,h*1.008,'T'+bilast+'/+'+(c-REF(l,bilast))),colorMagenta,align0,valign2;
DRAWTEXT(BARSTATUS=2ANDbifx=-1ANDbilast>4,l*0.992,'T'+bilast+'/'+(c-REF(h,bilast))),colorGreen,align0;
主图公式:
kx:
="chanlun@kxian";{这个放第一个要不会出问题滴-_-\\\~~}
kxg:
="chanlun@kxg";
kxd:
="chanlun@kxd";
kxfx:
="chanlun@kxfx";
kxno:
"chanlun@kxno",linethick0,coloryellow;
kxnobh:
"chanlun@kxnobh",linethick0,coloryellow;
笔:
="chanlun@bi";
bilast:
"chanlun@bilast",linethick0,coloryellow;
段:
="chanlun@duan";
duanlast:
"chanlun@duanlast",linethick0,coloryellow;
bifx:
=-REF(笔,bilast);
duanfx:
=-REF(段,duanlast);
{笔高低点周期力度提示}
DRAWTEXT(笔=1,h,''+h+'/T'+bilast+'/+'+(h-REF(l,bilast))),colorred,align1,valign2;
DRAWTEXT(笔=-1,l,''+l+'/T'+bilast+'/'+(l-REF(h,bilast))),colorgreen,align1;
主图公式:
kxian:
="chanlun@kxian";{初始化}
kxg:
="chanlun@kxg";
kxd:
="chanlun@kxd";
bi:
="chanlun@bi";
duan:
="chanlun@duan";
duanfx:
="chanlun@duanfx";
{当下提示周期}
DRAWTEXT(BARSTATUS=2ANDbifx=1ANDbilast>4,h*1.008,'T'+bilast+'/+'+(c-REF(l,bilast))),colorMagenta,align0,valign2;
DRAWTEXT(BARSTATUS=2ANDbifx=-1ANDbilast>4,l*0.992,'T'+bilast+'/'+(c-REF(h,bilast))),colorGreen,align0;
MA60:
MA(CLOSE,60);
partline(MA60,MA60>=ref(MA60,1),rgb(255,0,0),MA60MACDMJ:
DIF:
EMA(CLOSE,short)-EMA(CLOSE,long);
DEA:
EMA(DIF,mid);
MACD:
2*(DIF-DEA),COLORSTICK;
{面积计算}
绿面积:
IF(MACD<0,SUM(MACD,BARSLAST(MACD>0))*100,0),linethick0,colorblue;
红面积:
IF(MACD>0,SUM(MACD,BARSLAST(MACD<0))*100,0),linethick0,colorred;
红显示:
=CROSS(DEA,DIF);
绿显示:
=CROSS(DIF,DEA);
DRAWTEXT(红显示,DEA*1.03,NUMTOSTRN(REF(红面积,1),0)),colorgreen,valign2;
DRAWTEXT(绿显示,DEA*0.97,NUMTOSTRN(REF(绿面积,1),0)),colorred;
{当前面积}
DRAWTEXT(BARSTATUS=2andmacd>0,-macd*0.03,NUMTOSTRN(红面积,0)),coloryellow,valign0,align2;
DRAWTEXT(BARSTATUS=2andmacd<=0,-macd*0.03,NUMTOSTRN(绿面积,0)),COLORFFCC66,valign2,align2;
多空线:
0,colorwhite,dotline;
stickline(MACD<0andMACD>=REF(MACD,1),0,macd,0,0),COLORFFCC66;
stickline(MACD<0andMACDstickline(MACD>=0andMACD>REF(MACD,1),0,macd,0,0),COLORRed;
stickline(MACD>=0andMACD<=REF(MACD,1),0,macd,0,0),COLORYellow;
partline(dif,dif>=ref(dif,1),rgb(255,0,0),dif
gamo:
AMOUNT,VOLSTICK;
{
MA1:
MA(AMOUNT,N1);
MA2:
MA(AMOUNT,N2)
MA3:
MA(AMOUNT,N3)
};
DRAWTEXTABS(0,3,'换手率:
'),colorgray,LINETHICK1;
当日换手率:
=sum(100*v/capital,1);
DRAWTEXTABS(80,3,'今日换手率:
'+NUMTOSTRN(当日换手率,2)+'%'),colorgray,LINETHICK1;
五日换手率:
=sum(100*v/capital,5);
DRAWTEXTABS(210,3,'5日换手率:
'+NUMTOSTRN(五日换手率,2)+'%'),colorgray,LINETHICK1;
十日换手率:
=SUM(VOL,10)*100/CAPITAL;
DRAWTEXTABS(330,3,'10日换手率:
'+NUMTOSTRN(十日换手率,2)+'%'),colorgray,LINETHICK1;
DRAWTEXTABS(0,20,'所属板块:
'+''+BKNAME),colorgray,LINETHICK1;
主图公式:
kx:
="chanlun@kxian";{这个放第一个要不会出问题滴-_-\\\~~}
kxg:
="chanlun@kxg";
kxd:
="chanlun@kxd";
kxfx:
="chanlun@kxfx";
kxno:
"chanlun@kxno",linethick0,coloryellow;
kxnobh:
"chanlun@kxnobh",linethick0,coloryellow;
笔:
="chanlun@bi";
bilast:
"chanlun@bilast",linethick0,coloryellow;
段:
="chanlun@duan";
duanlast:
"chanlun@duanlast",linethick0,coloryellow;
bifx:
=-REF(笔,bilast);
duanfx:
=-REF(段,duanlast);
{笔高低点周期力度提示}
DRAWTEXT(笔=1,h,''+h+'/T'+bilast+'/+'+(h-REF(l,bilast))),colorgreen,align1,valign2;
DRAWTEXT(笔=-1,l,''+l+'/T'+bilast+'/'+(l-REF(h,bilast))),colorred,align1;
{当下提示周期}
DRAWTEXT(BARSTATUS=2ANDbifx=1ANDbilast>4,h*1.008,'T'+bilast+'/+'+(c-REF(l,bilast))),colorMagenta,align0,valign2;
DRAWTEXT(BARSTATUS=2ANDbifx=-1ANDbilast>4,l*0.992,'T'+bilast+'/'+(c-REF(h,bilast))),colorGreen,align0;
主图公式:
底分型
V00:
=HIGHV01:
=HIGH[REF(LOW,1);]
V02:
=HIGH>REF(HIGH,1)ANDLOWV03:
=HIGH>REF(HIGH,1)ANDLOW>REF(LOW,1);
V04:
=REF(HIGH,2)ANDREF(HIGH,2)>REF(HIGH,1)ANDREF(LOW,2)V1:
=COUNT(V00,6)>=3ANDCOUNT(V01ORV02,5)=0ANDLLVBARS(LOW,6)=1ANDHHVBARS(HIGH,6)>=5ANDV03;
V2:
=COUNT(V00,7)>=3ANDCOUNT(V01ORV02,6)=1ANDLLVBARS(LOW,7)=2ANDHHVBARS(HIGH,7)>=6ANDV04;
V3:
=COUNT(V00,7)>=3ANDCOUNT(V01ORV02,6)=1ANDLLVBARS(LOW,7)=1ANDHHVBARS(HIGH,7)>=6ANDV03;
V4:
=COUNT