软件名称:[B]指标编写通式(一)[/B]
软件类型:国产软件
运行环境:Win9X/Win2000/WinXP/Win2003/
软件语言:简体中文
授权方式:解密版
软件大小:0 Bytes
官方主页:Home Page
更新时间:2009-05-04 11:13:47
软件简介:
说明:多数是从网上收集整理的,版权归原创者。主要适用于飞狐,其它股软偶有涉及。
一、角度线
ATAN((A/REF(A,1)-1)*100)*57.3;
{57.3是把弧度转为角度 }
例:10日均线斜率大于45度
A:=MA(C,10);
ATAN((A/REF(A,1)-1)*100)*57.3>45;
二、除权及天数
上除权:=SPLITBARS(1);
本除权:=BARSLAST(IF(SPLITBARS(0)=1,SPLITBARS(0)+1,0))+1;
比例:SPLIT(1),LINETHICK0;
复权价:=C*(1+比例);
DRAWTEXTEX(1,1,100,0,'上次除权距今:'+NUMTOSTR(上除权,0)+' 天'),COLOREE8899;
DRAWTEXTEX(1,10,100,100,'本次除权距今:'+NUMTOSTR(本除权,0)+' 天'),COLOREE8899;
DRAWTEXTEX(1,10,310,0,'复权价:'+NUMTOSTR(复权价,2)+' 元'),COLOREE8899;
三、主图叠加大盘K线
input:n(42,1,250);
AA:=SUM(1,0);
BB:=IF(AA=1,1,0);
TT:=ISLASTBAR ;
DD:=BACKSET(TT=1,N+1);
EE:=BACKSET(TT=1,N);
FF:=IF(DD>EE,1,0);
GG:=IF(C>0,FF,BB);
PP:=BARSLAST(GG=1);
X:=REF(INDEXC,PP);
Y:=REF(CLOSE,PP);
CC:=(INDEXC/X)*Y;
OO:=(INDEXO/X)*Y;
HH:=(INDEXH/X)*Y;
LL:=(INDEXL/X)*Y;
STICKLINE(CC>=OO,HH,LL,1,0),ColorFF00FF;
STICKLINE(CC>=OO,CC,OO,7,1),ColorFF00FF;
STICKLINE(CC<OO,HH,LL,1,0),ColorE8E800;
STICKLINE(CC<OO,CC,OO,7,1),ColorE8E800;
四、三大传统指标顶底背离
A1:=BARSLAST(ref(cross("macd.diff"(12,26,9),"macd.dea"(12,26,9)),1));
B1:=ref(c,A1+1)>c 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底背离:STICKLINE(FILTER(B1>0,5),0,0.75,3,0),COLOR00FF00;{5天内B1>0的条件不被记录在内,在当前周期内出现B1>0画绿色柱线}
DRAWTEXT(FILTER(B1>0,5),0.57,'MACD底背离'),COLOR00FF00;
A2:=BARSLAST(ref(cross("kdj.k"(9,3,3),"kdj.d"(9,3,3)),1));
B2:=ref(c,A2+1)>c 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底背离:STICKLINE(FILTER(B2>0,5),0,1,3,0),COLORYELLOW;{5天内B2>0的条件不被记录在内,在当前周期内出现B>0画黄s柱线}
DRAWTEXT(FILTER(B2>0,5),0.80,'KDJ底背离'),COLORYELLOW;
A3:=BARSLAST(ref(cross("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=ref(c,A3+1)>c 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底背离:STICKLINE(FILTER(B3>0,5),0,0.5,3,0),COLORFFCC66;{5天内B3>0的条件不被记录在内,在当前周期内出现B3>0画青色柱线}
DRAWTEXT(FILTER(B3>0,5),0.25,'RSI底背离'),COLORFFCC66;
C1:=BARSLAST(ref(cross("macd.dea"(12,26,9),"macd.diff"(12,26,9)),1));
D1:=ref(c,C1+1) and cross("macd.dea"(12,26,9),"macd.diff"(12,26,9));
MACD顶背离:STICKLINE(FILTER(D1>0,5),2,1.25,3,0),COLOR0066FF;{5天内D1>0的条件不被记录在内,在当前周期内出现D1>0画橘黄s柱线}
DRAWTEXT(FILTER(D1>0,5),1.47,'MACD顶背离'),COLOR0066FF;
C2:=BARSLAST(ref(cross("kdj.d"(9,3,3),"kdj.k"(9,3,3)),1));
D2:=ref(c,C2+1)and cross("kdj.d"(9,3,3),"kdj.k"(9,3,3));
KDJ顶背离:STICKLINE(FILTER(D2>0,5),2,1,3,0),COLORRED;{5天内D2>0的条件不被记录在内,在当前周期内出现D2>0画红色柱线}
DRAWTEXT(FILTER(D2>0,5),1.2,'KDJ顶背离'),COLORRED;
C3:=BARSLAST(ref(cross("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=ref(c,C3+1) and cross("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));
RSI顶背离:STICKLINE(FILTER(D3>0,5),2,1.5,3,0),COLORFF00FF;{5天内D3>0的条件不被记录在内,在当前周期内出现D3>0画粉色柱线}
DRAWTEXT(FILTER(D3>0,5),1.75,'RSI顶背离'),COLORFF00FF;
五、二十四节气
立春:=FILTER(MONTH=2 AND (DAY=3 OR DAY=5 ),2);
雨水:=FILTER(MONTH=2 AND (DAY=18 OR DAY=20),2);
惊蛰:=FILTER(MONTH=3 AND (DAY=5 OR DAY=7 ),2);
春分:=FILTER(MONTH=3 AND (DAY=20 OR DAY=22),2);
清明:=FILTER(MONTH=4 AND (DAY=4 OR DAY=6 ),2);
谷雨:=FILTER(MONTH=4 AND (DAY=19 OR DAY=21),2);
立夏:=FILTER(MONTH=5 AND (DAY=6 OR DAY=8 ),2);
小满:=FILTER(MONTH=5 AND (DAY=20 OR DAY=22),2);
芒种:=FILTER(MONTH=6 AND (DAY=5 OR DAY=7 ),2);
夏至:=FILTER(MONTH=6 AND (DAY=20 OR DAY=22),2);
小暑:=FILTER(MONTH=7 AND (DAY=6 OR DAY=8 ),2);
大署:=FILTER(MONTH=7 AND (DAY=22 OR DAY=24),2);
立秋:=FILTER(MONTH=8 AND (DAY=7 OR DAY=9 ),2);
处暑:=FILTER(MONTH=8 AND (DAY=22 OR DAY=24),2);
白露:=FILTER(MONTH=9 AND (DAY=7 OR DAY=9 ),2);
秋分:=FILTER(MONTH=9 AND (DAY=22 OR DAY=24),2);
寒露:=FILTER(MONTH=10 AND (DAY=7 OR DAY=9 ),2);
霜降:=FILTER(MONTH=10 AND (DAY=22 OR DAY=24),2);
立冬:=FILTER(MONTH=11 AND (DAY=7 OR DAY=9 ),2);
小雪:=FILTER(MONTH=11 AND (DAY=22 OR DAY=24),2);
大雪:=FILTER(MONTH=12 AND (DAY=6 OR DAY=8 ),2);
冬至:=FILTER(MONTH=12 AND (DAY=21 OR DAY=23),2);
小寒:=FILTER(MONTH=1 AND (DAY=5 OR DAY=7 ),2);
大寒:=FILTER(MONTH=1 AND (DAY=19 OR DAY=21),2);
DRAWTEXT(立春,100,'立春'),COLORgreen,ALIGN;
DRAWTEXT(雨水,100,'雨水'),COLORgreen,ALIGN;
DRAWTEXT(惊蛰,100,'惊蛰'),COLORgreen,ALIGN;
DRAWTEXT(春分,100,'春分'),COLORgreen,ALIGN;
DRAWTEXT(清明,100,'清明'),COLORgreen,ALIGN;
DRAWTEXT(谷雨,100,'谷雨'),COLORgreen,ALIGN;
DRAWTEXT(立夏,100,'立夏'),COLORMAGENTA,ALIGN;
DRAWTEXT(小满,100,'小满'),COLORMAGENTA,ALIGN;
DRAWTEXT(芒种,100,'芒种'),COLORMAGENTA,ALIGN;
DRAWTEXT(夏至,100,'夏至'),COLORMAGENTA,ALIGN;
DRAWTEXT(小暑,100,'小暑'),COLORMAGENTA,ALIGN;
DRAWTEXT(大署,100,'大署'),COLORMAGENTA,ALIGN;
DRAWTEXT(立秋,100,'立秋'),COLORYELLOW,ALIGN;
DRAWTEXT(处暑,100,'处暑'),COLORYELLOW,ALIGN;
DRAWTEXT(白露,100,'白露'),COLORYELLOW,ALIGN;
DRAWTEXT(秋分,100,'秋分'),COLORYELLOW,ALIGN;
DRAWTEXT(寒露,100,'寒露'),COLORYELLOW,ALIGN;
DRAWTEXT(霜降,100,'霜降'),COLORYELLOW,ALIGN;
DRAWTEXT(立冬,100,'立冬'),COLORWHITE,ALIGN;
DRAWTEXT(小雪,100,'小雪'),COLORWHITE,ALIGN;
DRAWTEXT(大雪,100,'大雪'),COLORWHITE,ALIGN;
DRAWTEXT(冬至,100,'冬至'),COLORWHITE,ALIGN;
DRAWTEXT(小寒,100,'小寒'),COLORWHITE,ALIGN;
DRAWTEXT(大寒,100,'大寒'),COLORWHITE,ALIGN;
六、发行价
v1:=splitdata(1);v2:=splitdata(2);
v3:=splitdata(3);v4:=splitdata(4);
jj:=finance(51);
cap:=c;
jj[1]:=jj;
for i=2 to datacount do
jj:=(jj[i-1]+v2*v3/10)/(1+(v1+v2)/10)-v4/10;
发行价:jj[2],linethick0;
七、标识符号
为了公式显示的丰富多彩,除了运用绘图函数提供的符号外,还可以通过显示文字的方式,将这些符号选择合适的加进去。
♂♀★●↑↓▲▼△◥◤◢◣Ψ◎ ̄ ̄
例:DRAWTEXT(c>0,10,'★'),COLORRED;
八、显示基本资料
S:=('股票代码:' + STKLABEL);
DRAWTEXT((SYSPARAM(2) = BARPOS),CLOSE,S),ALIGN4,Color00FFFF;
DRAWTEXT((BARPOS = SYSPARAM(2)),HIGH,((((((((((((((((((((((((((((((((((' 所属板块:' + BLKNAME) + '\n') + '发行价') + NUMTOSTR(FINANCE(51),2)) + '元') + ' 发行量') + NUMTOSTR(FINANCE(52),2)) + '万股') + '\n') + '总股本') + NUMTOSTR(FINANCE(1),0)) + '万股') + ' 流通A股') + NUMTOSTR(FINANCE(7),0)) + '万股') + ' 净资产') + NUMTOSTR(FINANCE(35),2)) + '亿元') + ' 每股收益') + NUMTOSTR(FINANCE(33),2)) + '元') + ' 每股未分配') + NUMTOSTR(FINANCE(32),2)) + '元') + '\n') + '市盈率') + NUMTOSTR(DYNAINFO(39),2)) + '%') + ' 投资收益') + NUMTOSTR(FINANCE
[url=http://www.70822.com/soft/sort013/sort035/down-8894.html]指标编写通式(一)[/url]
一、角度线
ATAN((A/REF(A,1)-1)*100)*57.3;
{57.3是把弧度转为角度 }
例:10日均线斜率大于45度
A:=MA(C,10);
ATAN((A/REF(A,1)-1)*100)*57.3>45;
二、除权及天数
上除权:=SPLITBARS(1);
本除权:=BARSLAST(IF(SPLITBARS(0)=1,SPLITBARS(0)+1,0))+1;
比例:SPLIT(1),LINETHICK0;
复权价:=C*(1+比例);
DRAWTEXTEX(1,1,100,0,'上次除权距今:'+NUMTOSTR(上除权,0)+' 天'),COLOREE8899;
DRAWTEXTEX(1,10,100,100,'本次除权距今:'+NUMTOSTR(本除权,0)+' 天'),COLOREE8899;
DRAWTEXTEX(1,10,310,0,'复权价:'+NUMTOSTR(复权价,2)+' 元'),COLOREE8899;
三、主图叠加大盘K线
input:n(42,1,250);
AA:=SUM(1,0);
BB:=IF(AA=1,1,0);
TT:=ISLASTBAR ;
DD:=BACKSET(TT=1,N+1);
EE:=BACKSET(TT=1,N);
FF:=IF(DD>EE,1,0);
GG:=IF(C>0,FF,BB);
PP:=BARSLAST(GG=1);
X:=REF(INDEXC,PP);
Y:=REF(CLOSE,PP);
CC:=(INDEXC/X)*Y;
OO:=(INDEXO/X)*Y;
HH:=(INDEXH/X)*Y;
LL:=(INDEXL/X)*Y;
STICKLINE(CC>=OO,HH,LL,1,0),ColorFF00FF;
STICKLINE(CC>=OO,CC,OO,7,1),ColorFF00FF;
STICKLINE(CC<OO,HH,LL,1,0),ColorE8E800;
STICKLINE(CC<OO,CC,OO,7,1),ColorE8E800;
四、三大传统指标顶底背离
A1:=BARSLAST(ref(cross("macd.diff"(12,26,9),"macd.dea"(12,26,9)),1));
B1:=ref(c,A1+1)>c 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底背离:STICKLINE(FILTER(B1>0,5),0,0.75,3,0),COLOR00FF00;{5天内B1>0的条件不被记录在内,在当前周期内出现B1>0画绿色柱线}
DRAWTEXT(FILTER(B1>0,5),0.57,'MACD底背离'),COLOR00FF00;
A2:=BARSLAST(ref(cross("kdj.k"(9,3,3),"kdj.d"(9,3,3)),1));
B2:=ref(c,A2+1)>c 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底背离:STICKLINE(FILTER(B2>0,5),0,1,3,0),COLORYELLOW;{5天内B2>0的条件不被记录在内,在当前周期内出现B>0画黄s柱线}
DRAWTEXT(FILTER(B2>0,5),0.80,'KDJ底背离'),COLORYELLOW;
A3:=BARSLAST(ref(cross("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=ref(c,A3+1)>c 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底背离:STICKLINE(FILTER(B3>0,5),0,0.5,3,0),COLORFFCC66;{5天内B3>0的条件不被记录在内,在当前周期内出现B3>0画青色柱线}
DRAWTEXT(FILTER(B3>0,5),0.25,'RSI底背离'),COLORFFCC66;
C1:=BARSLAST(ref(cross("macd.dea"(12,26,9),"macd.diff"(12,26,9)),1));
D1:=ref(c,C1+1) and cross("macd.dea"(12,26,9),"macd.diff"(12,26,9));
MACD顶背离:STICKLINE(FILTER(D1>0,5),2,1.25,3,0),COLOR0066FF;{5天内D1>0的条件不被记录在内,在当前周期内出现D1>0画橘黄s柱线}
DRAWTEXT(FILTER(D1>0,5),1.47,'MACD顶背离'),COLOR0066FF;
C2:=BARSLAST(ref(cross("kdj.d"(9,3,3),"kdj.k"(9,3,3)),1));
D2:=ref(c,C2+1)and cross("kdj.d"(9,3,3),"kdj.k"(9,3,3));
KDJ顶背离:STICKLINE(FILTER(D2>0,5),2,1,3,0),COLORRED;{5天内D2>0的条件不被记录在内,在当前周期内出现D2>0画红色柱线}
DRAWTEXT(FILTER(D2>0,5),1.2,'KDJ顶背离'),COLORRED;
C3:=BARSLAST(ref(cross("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=ref(c,C3+1) and cross("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));
RSI顶背离:STICKLINE(FILTER(D3>0,5),2,1.5,3,0),COLORFF00FF;{5天内D3>0的条件不被记录在内,在当前周期内出现D3>0画粉色柱线}
DRAWTEXT(FILTER(D3>0,5),1.75,'RSI顶背离'),COLORFF00FF;
五、二十四节气
立春:=FILTER(MONTH=2 AND (DAY=3 OR DAY=5 ),2);
雨水:=FILTER(MONTH=2 AND (DAY=18 OR DAY=20),2);
惊蛰:=FILTER(MONTH=3 AND (DAY=5 OR DAY=7 ),2);
春分:=FILTER(MONTH=3 AND (DAY=20 OR DAY=22),2);
清明:=FILTER(MONTH=4 AND (DAY=4 OR DAY=6 ),2);
谷雨:=FILTER(MONTH=4 AND (DAY=19 OR DAY=21),2);
立夏:=FILTER(MONTH=5 AND (DAY=6 OR DAY=8 ),2);
小满:=FILTER(MONTH=5 AND (DAY=20 OR DAY=22),2);
芒种:=FILTER(MONTH=6 AND (DAY=5 OR DAY=7 ),2);
夏至:=FILTER(MONTH=6 AND (DAY=20 OR DAY=22),2);
小暑:=FILTER(MONTH=7 AND (DAY=6 OR DAY=8 ),2);
大署:=FILTER(MONTH=7 AND (DAY=22 OR DAY=24),2);
立秋:=FILTER(MONTH=8 AND (DAY=7 OR DAY=9 ),2);
处暑:=FILTER(MONTH=8 AND (DAY=22 OR DAY=24),2);
白露:=FILTER(MONTH=9 AND (DAY=7 OR DAY=9 ),2);
秋分:=FILTER(MONTH=9 AND (DAY=22 OR DAY=24),2);
寒露:=FILTER(MONTH=10 AND (DAY=7 OR DAY=9 ),2);
霜降:=FILTER(MONTH=10 AND (DAY=22 OR DAY=24),2);
立冬:=FILTER(MONTH=11 AND (DAY=7 OR DAY=9 ),2);
小雪:=FILTER(MONTH=11 AND (DAY=22 OR DAY=24),2);
大雪:=FILTER(MONTH=12 AND (DAY=6 OR DAY=8 ),2);
冬至:=FILTER(MONTH=12 AND (DAY=21 OR DAY=23),2);
小寒:=FILTER(MONTH=1 AND (DAY=5 OR DAY=7 ),2);
大寒:=FILTER(MONTH=1 AND (DAY=19 OR DAY=21),2);
DRAWTEXT(立春,100,'立春'),COLORgreen,ALIGN;
DRAWTEXT(雨水,100,'雨水'),COLORgreen,ALIGN;
DRAWTEXT(惊蛰,100,'惊蛰'),COLORgreen,ALIGN;
DRAWTEXT(春分,100,'春分'),COLORgreen,ALIGN;
DRAWTEXT(清明,100,'清明'),COLORgreen,ALIGN;
DRAWTEXT(谷雨,100,'谷雨'),COLORgreen,ALIGN;
DRAWTEXT(立夏,100,'立夏'),COLORMAGENTA,ALIGN;
DRAWTEXT(小满,100,'小满'),COLORMAGENTA,ALIGN;
DRAWTEXT(芒种,100,'芒种'),COLORMAGENTA,ALIGN;
DRAWTEXT(夏至,100,'夏至'),COLORMAGENTA,ALIGN;
DRAWTEXT(小暑,100,'小暑'),COLORMAGENTA,ALIGN;
DRAWTEXT(大署,100,'大署'),COLORMAGENTA,ALIGN;
DRAWTEXT(立秋,100,'立秋'),COLORYELLOW,ALIGN;
DRAWTEXT(处暑,100,'处暑'),COLORYELLOW,ALIGN;
DRAWTEXT(白露,100,'白露'),COLORYELLOW,ALIGN;
DRAWTEXT(秋分,100,'秋分'),COLORYELLOW,ALIGN;
DRAWTEXT(寒露,100,'寒露'),COLORYELLOW,ALIGN;
DRAWTEXT(霜降,100,'霜降'),COLORYELLOW,ALIGN;
DRAWTEXT(立冬,100,'立冬'),COLORWHITE,ALIGN;
DRAWTEXT(小雪,100,'小雪'),COLORWHITE,ALIGN;
DRAWTEXT(大雪,100,'大雪'),COLORWHITE,ALIGN;
DRAWTEXT(冬至,100,'冬至'),COLORWHITE,ALIGN;
DRAWTEXT(小寒,100,'小寒'),COLORWHITE,ALIGN;
DRAWTEXT(大寒,100,'大寒'),COLORWHITE,ALIGN;
六、发行价
v1:=splitdata(1);v2:=splitdata(2);
v3:=splitdata(3);v4:=splitdata(4);
jj:=finance(51);
cap:=c;
jj[1]:=jj;
for i=2 to datacount do
jj:=(jj[i-1]+v2*v3/10)/(1+(v1+v2)/10)-v4/10;
发行价:jj[2],linethick0;
七、标识符号
为了公式显示的丰富多彩,除了运用绘图函数提供的符号外,还可以通过显示文字的方式,将这些符号选择合适的加进去。
♂♀★●↑↓▲▼△◥◤◢◣Ψ◎ ̄ ̄
例:DRAWTEXT(c>0,10,'★'),COLORRED;
八、显示基本资料
S:=('股票代码:' + STKLABEL);
DRAWTEXT((SYSPARAM(2) = BARPOS),CLOSE,S),ALIGN4,Color00FFFF;
DRAWTEXT((BARPOS = SYSPARAM(2)),HIGH,((((((((((((((((((((((((((((((((((' 所属板块:' + BLKNAME) + '\n') + '发行价') + NUMTOSTR(FINANCE(51),2)) + '元') + ' 发行量') + NUMTOSTR(FINANCE(52),2)) + '万股') + '\n') + '总股本') + NUMTOSTR(FINANCE(1),0)) + '万股') + ' 流通A股') + NUMTOSTR(FINANCE(7),0)) + '万股') + ' 净资产') + NUMTOSTR(FINANCE(35),2)) + '亿元') + ' 每股收益') + NUMTOSTR(FINANCE(33),2)) + '元') + ' 每股未分配') + NUMTOSTR(FINANCE(32),2)) + '元') + '\n') + '市盈率') + NUMTOSTR(DYNAINFO(39),2)) + '%') + ' 投资收益') + NUMTOSTR(FINANCE
[url=http://www.70822.com/soft/sort013/sort035/down-8894.html]指标编写通式(一)[/url]