股票的公式有哪些?飞狐江恩主图公式源码
2016-6-12 10:46:03 股票入门 http://rumen.southmoney.com
股票的公式有哪些?飞狐江恩主图公式源码 附:飞狐背离大全公式源码 南方财富网小编为您提供
【飞狐江恩主图公式源码】
INPUT:最近天(30,1,360);当前月:=FRACPART(ROUND(当前日期/100)/100)*100;
WRAP: break-word; WHITE-SPACE: normal; TEXT-TRANSFORM: none; WORD-SPACING: 0px; COLOR: rgb(51,51,51); PADDING-BOTTOM: 0px; PADDING-TOP: 0px; FONT: 14px/24px 宋体, arial, sans-serif, 'DejaVu Sans', 'Lucida Grande', Tahoma, 'Hiragino Sans GB', STHeiti, SimSun, sans-serif; PADDING-LEFT: 0px; MARGIN: 0px; WIDOWS: 1; LETTER-SPACING: normal; PADDING-RIGHT: 0px; TEXT-INDENT: 0px; -webkit-text-stroke-width: 0px">月:=MONTH;日:=DAY;
N:=if(sysparam(1)=datacount,最近天,datacount-sysparam(1)+1);
HH:=HHV(HIGH,N);
LL:=LLV(LOW,N);
VN:=N;
IF VN>DATACOUNT THEN
VN=DATACOUNT+1;
FOR I=DATACOUNT DOWNTO DATACOUNT-VN+1 DO BEGIN
HH[I]:=HH[DATACOUNT];
LL[I]:=LL[DATACOUNT];
END;
TMP:=SETLBOUND(hh,DATACOUNT-VN+1);
TMP:=SETLBOUND(ll,DATACOUNT-VN+1);
KKH:=BARSLAST(H=HH);
KKL:=BARSLAST(L=LL);
N低日:=STRTONUM(NUMTOSTR(REF(DATE,KKL),0));
N高日:=STRTONUM(NUMTOSTR(REF(DATE,KKH),0));
多空:=IF(N低日>N高日,2,1),LINETHICK0;
DATE1:=IF(多空=1,N低日,N高日);
LLOW:=ref(LOW,BARSLAST(DATE1=DATE));
H1:=STRTONUM(NUMTOSTR(hh,2));
L1:=STRTONUM(NUMTOSTR(LLOW,2));
VERTLINE(DATE=DATE1),COLORFFAAAA,LINETHICK1;
{DRAWTEXT(DATE=DATE1,SYSPARAM(4)*0.95,'起\n \n\n测\n \n点'),COLORFFFFFF;}
IF 多空=1 THEN BEGIN
PARTLINE(DATE>N低日,L1),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.042),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.083),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.125),COLORMAGENTA;
PARTLINE(DATE>N低日,L1*1.167),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.208),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.25),COLORMAGENTA;
PARTLINE(DATE>N低日,L1*1.292),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.33),COLORMAGENTA;
PARTLINE(DATE>N低日,L1*1.375),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.417),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.458),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.5),COLORMAGENTA;
PARTLINE(DATE>N低日,L1*1.542),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.583),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.625),COLORMAGENTA;
PARTLINE(DATE>N低日,L1*1.667),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.708),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.75),COLORMAGENTA;
PARTLINE(DATE>N低日,L1*1.792),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.833),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.875),COLORMAGENTA;
PARTLINE(DATE>N低日,L1*1.917),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*1.958),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N低日,L1*2),COLORMAGENTA;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1+0.002,NUMTOSTR(L1,2)+' 0 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.042+0.002,NUMTOSTR(L1*1.042,2)+' 15 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.083+0.002,NUMTOSTR(L1*1.083,2)+' 30 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.125+0.002,NUMTOSTR(L1*1.125,2)+' 45 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.167+0.002,NUMTOSTR(L1*1.167,2)+' 60 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.208+0.002,NUMTOSTR(L1*1.208,2)+' 75 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.25+0.002,NUMTOSTR(L1*1.25,2)+' 90 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.292+0.002,NUMTOSTR(L1*1.292,2)+' 105 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.33+0.002,NUMTOSTR(L1*1.33,2)+' 120 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.375+0.002,NUMTOSTR(L1*1.375,2)+' 135 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.417+0.002,NUMTOSTR(L1*1.417,2)+' 150 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.458+0.002,NUMTOSTR(L1*1.458,2)+' 165 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.5+0.002,NUMTOSTR(L1*1.5,2)+' 180 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.542+0.002,NUMTOSTR(L1*1.542,2)+' 195 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.583+0.002,NUMTOSTR(L1*1.583,2)+' 210 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.625+0.002,NUMTOSTR(L1*1.625,2)+' 225 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.667+0.002,NUMTOSTR(L1*1.667,2)+' 240 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.708+0.002,NUMTOSTR(L1*1.708,2)+' 255 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.75+0.002,NUMTOSTR(L1*1.75,2)+' 270 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.792+0.002,NUMTOSTR(L1*1.792,2)+' 285 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.833+0.002,NUMTOSTR(L1*1.833,2)+' 290 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.875+0.002,NUMTOSTR(L1*1.875,2)+' 315 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.917+0.002,NUMTOSTR(L1*1.917,2)+' 330 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*1.958+0.002,NUMTOSTR(L1*1.958,2)+' 345 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,L1*2+0.002,NUMTOSTR(L1*2,2)+' 360 '),COLORWHITE,ALIGN2;
END;
ELSE BEGIN
PARTLINE(DATE>N高日,H1),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.042),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.083),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.125),COLORMAGENTA;
PARTLINE(DATE>N高日,H1-H1*0.167),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.208),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.25),COLORMAGENTA;
PARTLINE(DATE>N高日,H1-H1*0.292),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.33),COLORMAGENTA;
PARTLINE(DATE>N高日,H1-H1*0.375),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.417),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.458),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.5),COLORMAGENTA;
PARTLINE(DATE>N高日,H1-H1*0.542),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.583),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.625),COLORMAGENTA;
PARTLINE(DATE>N高日,H1-H1*0.667),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.708),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.75),COLORMAGENTA;
PARTLINE(DATE>N高日,H1-H1*0.792),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.833),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.875),COLORMAGENTA;
PARTLINE(DATE>N高日,H1-H1*0.917),COLORFFFF99,LINEDOT;
PARTLINE(DATE>N高日,H1-H1*0.958),COLORMAGENTA;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1+0.002,NUMTOSTR(H1-H1*0.042,2)+' 0 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.042+0.002,NUMTOSTR(H1-H1*0.042,2)+' 15 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.083+0.002,NUMTOSTR(H1-H1*0.083,2)+' 30 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.125+0.002,NUMTOSTR(H1-H1*0.125,2)+' 45 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.167+0.002,NUMTOSTR(H1-H1*0.167,2)+' 60 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.208+0.002,NUMTOSTR(H1-H1*0.208,2)+' 75 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.25+0.002,NUMTOSTR(H1-H1*0.25,2)+' 90 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.292+0.002,NUMTOSTR(H1-H1*0.292,2)+' 105 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.33+0.002,NUMTOSTR(H1-H1*0.33,2)+' 120 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.375+0.002,NUMTOSTR(H1-H1*0.375,2)+' 135 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.417+0.002,NUMTOSTR(H1-H1*0.417,2)+' 150 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.458+0.002,NUMTOSTR(H1-H1*0.458,2)+' 165 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.5+0.002,NUMTOSTR(H1-H1*0.5,2)+' 180 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.542+0.002,NUMTOSTR(H1-H1*0.542,2)+' 195 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.583+0.002,NUMTOSTR(H1-H1*0.583,2)+' 210 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.625+0.002,NUMTOSTR(H1-H1*0.625,2)+' 225 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.667+0.002,NUMTOSTR(H1-H1*0.667,2)+' 240 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.708+0.002,NUMTOSTR(H1-H1*0.708,2)+' 255 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.75+0.002,NUMTOSTR(H1-H1*0.75,2)+' 270 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.792+0.002,NUMTOSTR(H1-H1*0.792,2)+' 285 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.833+0.002,NUMTOSTR(H1-H1*0.833,2)+' 300 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.875+0.002,NUMTOSTR(H1-H1*0.875,2)+' 315 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.917+0.002,NUMTOSTR(H1-H1*0.917,2)+' 330 '),COLORWHITE,ALIGN2;
DRAWTEXT(SYSPARAM(3)=BARPOS,H1-H1*0.958+0.002,NUMTOSTR(H1-H1*0.958,2)+' 345 '),COLORWHITE,ALIGN2;
END;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='1',c,NUMTOSTR(当前月,0)+'月转折日:6、15、21、*25\n \n \n \n '),COLOR00FFFF,ALIGN4;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='2',c,NUMTOSTR(当前月,0)+'月转折日:6、15、21\n \n \n \n '),COLOR00FFFF,ALIGN4;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='3',c,NUMTOSTR(当前月,0)+'月转折日:6、15、*20、21\n \n \n \n '),COLOR00FFFF,ALIGN4;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='4',c,NUMTOSTR(当前月,0)+'月转折日:6、15、21\n \n \n \n '),COLOR00FFFF,ALIGN4;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='5',c,NUMTOSTR(当前月,0)+'月转折日:6、*12、15、21\n \n \n \n '),COLOR00FFFF,ALIGN4;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='6',c,NUMTOSTR(当前月,0)+'月转折日:6、*14、21\n \n \n \n '),COLOR00FFFF,ALIGN4;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='7',c,NUMTOSTR(当前月,0)+'月转折日:8、15、*19、23\n \n \n \n '),COLOR00FFFF,ALIGN4;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='8',c,NUMTOSTR(当前月,0)+'月转折日:*6、8、15、23\n \n \n \n '),COLOR00FFFF,ALIGN4;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='9',c,NUMTOSTR(当前月,0)+'月转折日:8、15、*18、23\n \n \n \n '),COLOR00FFFF,ALIGN4;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='10',c,NUMTOSTR(当前月,0)+'月转折日:8、15、23、*31\n \n \n \n '),COLOR00FFFF,ALIGN4;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='11',c,NUMTOSTR(当前月,0)+'月转折日:8、15、23、*28\n \n \n \n '),COLOR00FFFF,ALIGN4;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='12',c,NUMTOSTR(当前月,0)+'月转折日:8、15、23、*31\n \n \n \n '),COLOR00FFFF,ALIGN4;
附:【飞狐背离大全公式源码】
DIFF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIFF,9),colorFF;
MACD:2*(DIFF-DEA),COLORSTICK;
D1:=EMA(CLOSE,3)-EMA(CLOSE,8);
D2:=EMA(OPEN,3)-EMA(OPEN,8);
D3:=EMA(HIGH,3)-EMA(HIGH,8);
D4:=EMA(LOW,3)-EMA(LOW,8);
DRAWICON(CROSS(D1,DIFF) AND DIFF<-0.05,D4-0.1,1);
DRAWICON(CROSS(DIFF,D1) AND DIFF>0.1,D3+0.1,2);
STICKLINE(D1>=D2,D1,D2,7,0),colorFF00FF;
STICKLINE(D1<=D2,D1,D2,7,0),colorFF00;
A1:=BARSLAST(REF(CROSS("MACD.DIFF"(12,26,9),"MACD.DEA"(12,26,9)),1));
B1:=REF(CLOSE,A1+1)>CLOSE AND REF("MACD.DIFF"(12,26,9),A1+1)<"MACD.DIFF"(12,26,9) AND CROSS("MACD.DIFF"(12,26,9),"MACD.DEA"(12,26,9));
MACD底背离:=FILTER(B1>0,5);
STICKLINE(MACD底背离,0,0.75,3,0),colorFF00;
DRAWTEXT(MACD底背离,0.57,'MACD底背离'),colorFF00;
A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));
B2:=REF(CLOSE,A2+1)>CLOSE AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
KDJ底背离:=FILTER(B2>0,5);
STICKLINE(KDJ底背离,0,1,3,0),colorFFFF;
DRAWTEXT(KDJ底背离,0.8,'KDJ底背离'),colorFFFF;
A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=REF(CLOSE,A3+1)>CLOSE AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
RSI底背离:=FILTER(B3>0,5);
STICKLINE(RSI底背离,0,0.5,3,0),colorFFCC66;
DRAWTEXT(RSI底背离,0.25,'RSI底背离'),colorFFCC66;
2,colorFF;
C1:=BARSLAST(REF(CROSS("MACD.DEA"(12,26,9),"MACD.DIFF"(12,26,9)),1));
D1:=REF(CLOSE,C1+1)<CLOSE AND REF("MACD.DIFF"(12,26,9),C1+1)>"MACD.DIFF"(12,26,9) AND CROSS("MACD.DEA"(12,26,9),"MACD.DIFF"(12,26,9));
MACD顶背离:=FILTER(D1>0,5);
STICKLINE(MACD顶背离,2,1.25,3,0),color66FF;
DRAWTEXT(MACD顶背离,1.47,'MACD顶背离'),color66FF;
C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));
D2:=REF(CLOSE,C2+1)<CLOSE AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));
KDJ顶背离:=FILTER(D2>0,5);
STICKLINE(KDJ顶背离,2,1,3,0),colorFF;
DRAWTEXT(KDJ顶背离,1.2,'KDJ顶背离'),colorFF;
C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=REF(CLOSE,C3+1)<CLOSE AND REF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));
RSI顶背离:=FILTER(D3>0,5);
STICKLINE(RSI顶背离,2,1.5,3,0),colorFF00FF;
DRAWTEXT(RSI顶背离,1.75,'RSI顶背离'),colorFF00FF;
底背离:MACD底背离 OR KDJ底背离 OR RSI底背离;
顶背离:MACD顶背离 OR KDJ顶背离 OR RSI顶背离;
更多股票公式相关资讯请关注南方财富网
股票入门声明:资讯来源于互联网,属作者个人观点,仅供投资者参考,并不构成投资建议。投资者据此操作,风险自担。