各大指数指标源码(xt指标最佳参数)
1. xt指标最佳参数
该指标最佳参数是用来形容事物规格化程度的标准,在外扩化标准(Outward expansion standard)中,xt指标最佳参数用于表征完全化曐性系统的外在特点,根据完全化的相关标准,其可链接并执行xt筛选程序,从而执行代号为piont B的标准化子程序,启动并判断系统层的安全阈值指数。
xt指标最佳参数也可用于检查系统架构是否稳定。
2. 想自己编写股票公式。推荐下书籍?
量化思路:证券技术指标编写技法 内容提要 本书主要以以指标编写初学者为对象,从零入手,循序渐进,深入浅出的讲解公式建立的过程。
前两章主要介绍公式编辑系统的常规编写方法,重点是公式思路的量化和转换;第三章是目前主要的函数介绍,配合了大量的实例;第四章至第六章介绍公式的高级写法,循环的使用,C语言接口(DLL动态链接库)的使用,VBS的使用,第七章简单介绍公式加密的方法。全书共穿插引用了百余经典公式原码,如宝塔线、阿姆斯指数、多周期同图显示K线、板块排序、VBS输出到EXCEL等。目录 第一章 指标编写的意义及种类 一、指标编写的意义 二、指标的种类 第二章 指标编写的工具及语句规则 一、指标编写的工具 二、公式编写规则 三、量化思路 四、关系未来数据 第三章 函数介绍 一、行情函数 二、时间函数 三、引用函数 四、逻辑函数 五、数学函数 六、统计函数 七、指标函数 八、大盘函数、动态行情、财务指标、系统参数函数、常数函数 九、易理函数 十、字符串函数 十一、引用函数 十二、解盘函数 十三、绘图函数 十四、线型描述 十五、字符串函数 十六、扩展数据函数 十七、特殊函数 十八、编写公式时常用的通式 十九、公式解读 第四章 C语言接口 一、扩展函数的命名 二、扩展函数的引用 三、使用CUSTOM APPWIZARD编程 四、不使用CUSTOM APPWIZARD编程 五、举例 第五章 循环语句 一、序列变理与数组 二、循环语句 三、WHILE循环 四、FOR循环 五、序列变量下界语句 六、复合语句 七、IF语句 八、循环的嵌套 九、循环举例 第六章 VBS使用简介 一、数据——常量、变量、数组 二、运算符及优先级别 三、VBScript函数 四、条件、分支、循环语句 五、与公式相关的示例 第七章 公式加密输出3. expma指标源码?
AEXP12:EXPMA(CLOSE,12)COLORBLUE,LINETHICK1;
AEXP21:EXPMA(CLOSE,21)COLORGREEN,LINETHICK2;
AEXP50:EXPMA(CLOSE,50)COLORGREEN,LINETHICK2;
IF(AEXP12>(REFV(AEXP12,1)),AEXP12,DRAWNULL),COLORRED,LINETHICK1;
IF(AEXP21>(REFV(AEXP21,1)),AEXP21,DRAWNULL),COLORMAGENTA,LINETHICK2;
A1:=EMA(C,14),COLORA2A200,LINETHICK1;
A1X:=(A1-REF(A1,1))/REF(A1,1)*100,NODRAW;
DRAWTEXT_FIX(1,0,0.07,0,'【所属板块】'),COLORWHITE;
DRAWTEXT_FIX(1,0.07,0.07,0,DYBLOCK),COLOR0080FF; {地域}
DRAWTEXT_FIX(1,0.122,0.07,0,GNBLOCK),COLORCFB53B; {概念}
DRAWTEXT_FIX(1,0,0.19,0,'【莸利比例】'),COLORWHITE;
DRAWNUMBER_FIX(1,0.09,0.19,0,CONST(WINNER(C )*100)),COLORYELLOW;
DRAWTEXT_FIX(1,0.073,0,0,HYBLOCK),COLORRED; {行业}
{DRAWTEXT_FIX(1,0.124,0,0,FGBLOCK),COLORYELLOW;} {风格}
SAT:=IF((AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100>100,100,(AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100);
DRAWTEXT_FIX(1,0,0.31,0,'【量能饱和度】')COLORWHITE;
DRAWNUMBER_FIX(1,0.1,0.31,0,CONST(SAT)),COLORYELLOW;
突破:REF(EMA(C,14),1),NODRAW;
距离:(C-突破)/突破*100,NODRAW;
出击:IF(A1X>=0,REF(EMA(C,14),BARSLAST(CROSS(A1X,0))+1),DRAWNULL),COLORB000B0,LINETHICK1;
休假:IF(A1X<0,REF(EMA(C,14),BARSLAST(CROSS(0,A1X))+1),DRAWNULL),COLORFFFF00,LINETHICK1;
涨幅:IF(A1X>=0,(C-出击)/出击*100,DRAWNULL)NODRAW;
跌幅:IF(A1X<0,(C-休假)/休假*100,DRAWNULL)NODRAW;
TT:=240/FROMOPEN;比:=TT;AY2:=EMA(CLOSE,12)-EMA(CLOSE,26);
AZ2:=EMA(AY2,9);LT2:=(AY2-AZ2);
L211:=IF(LT2,LLV(L,21),DRAWNULL),COLOR217158,CIRCLEDOT;
ZGD:=HHV(H,80)*0.99;ZGD2:=CONST(ZGD);ZDD:=LLV(L211,80);ZDD2:=CONST(ZDD);
YYA4:=MA(CLOSE,20);YYA5:=(CLOSE > MA(CLOSE,5));YYA6:=(MA(CLOSE,5) > MA(CLOSE,10));
YYA7:=(CLOSE > MA(CLOSE,10));YYA8:=(MA(CLOSE,5) > MA(CLOSE,20));
YYA9:=(CLOSE > MA(CLOSE,20));YYA10:=REF(YYA4,1);YYA11:=(YYA4 > YYA10);
YYAVX:=(((((IF(YYA5,10,(0 - 10)) + IF(YYA6,10,(0 - 10))) + IF(YYA7,10,(0 - 10))) + IF(YYA8,10,(0 - 10))) + IF(YYA9,10,(0 - 10))) + IF(YYA11,10,(0 - 10)));
DSLX:=(CLOSE / INDEXC);DSLX1:=MA(DSLX,5);DSLX2:=MA(DSLX,10);
YYV1:=MA(VOL,5);YYV2:=MA(VOL,10);J1:=CONST(IF( YYAVX > 0,200,100));
J2:=CONST(IF( YYAVX > 0,00,100));J3:=CONST(IF( YYAVX > 0,100,100));
ZGD3:=ZGD2;ZDD3:=ZDD2;ZGD4:=ZGD2;
STICKLINE(CROSS(A1X,0),C,O,2,0),COLOR00FFFF;
STICKLINE(CROSS(0,A1X),C,O,2,0),COLOR606000;
情况1:=CONST(IF(((CROSS(YYAVX,1) AND (YYV1 >= YYV2)) AND (DSLX >= DSLX1)),1,0)),NODRAW;
情况2:=CONST(IF(((CROSS(YYAVX,1) AND (YYV1 < YYV2)) AND (DSLX >= DSLX1)),1,0));
情况3:=CONST(IF(((CROSS(YYAVX,1) AND (YYV1 > YYV2)) AND (DSLX < DSLX1)),1,0));
情况4:=CONST(IF(((CROSS(YYAVX,1) AND (YYV1 <= YYV2)) AND (DSLX < DSLX1)),1,0));
情况5:=CONST(IF(((CROSS(1,YYAVX) AND (YYV1 >= YYV2)) AND (DSLX >= DSLX1)),1,0));
情况6:=CONST(IF(((CROSS(1,YYAVX) AND (YYV1 < YYV2)) AND (DSLX >= DSLX1)),1,0));
情况7:=CONST(IF(((CROSS(1,YYAVX) AND (YYV1 >= YYV2)) AND (DSLX < DSLX1)),1,0));
情况8:=CONST(IF(((CROSS(1,YYAVX) AND (YYV1 < YYV2)) AND (DSLX < DSLX1)),1,0));
情况9:=CONST(IF(((((YYAVX >= 1) AND (REF(YYAVX,1) > 0)) AND (YYV1 >= YYV2)) AND (DSLX >= DSLX1)),1,0));
情况10:=CONST(IF(((((YYAVX >= 1) AND (REF(YYAVX,1) > 0)) AND (YYV1 < YYV2)) AND (DSLX >= DSLX1)),1,0));
情况11:=CONST(IF(((((YYAVX >= 1) AND (REF(YYAVX,1) > 0)) AND (YYV1 >= YYV2)) AND (DSLX < DSLX1)),1,0)),NODRAW;
情况12:=CONST(IF(((((YYAVX >= 1) AND (REF(YYAVX,1) > 0)) AND (YYV1 < YYV2)) AND (DSLX < DSLX1)),1,0));
情况13:=CONST(IF(((((YYAVX < 1) AND (REF(YYAVX,1) < 0)) AND (YYV1 >= YYV2)) AND (DSLX >= DSLX1)),1,0));
情况14:=CONST(IF(((((YYAVX < 1) AND (REF(YYAVX,1) < 0)) AND (YYV1 < YYV2)) AND (DSLX >= DSLX1)),1,0));
情况15:=CONST(IF(((((YYAVX < 1) AND (REF(YYAVX,1) < 0)) AND (YYV1 >= YYV2)) AND (DSLX < DSLX1)),1,0));
情况16:=CONST(IF(((((YYAVX < 1) AND (REF(YYAVX,1) < 0)) AND (YYV1 < YYV2)) AND (DSLX < DSLX1)),1,0));
大盘1:=CONST(IF((CROSS(YYAVX,1) AND (YYV1 >= YYV2)),1,0));
大盘2:=CONST(IF((CROSS(YYAVX,1) AND (YYV1 < YYV2)),1,0));
大盘3:=CONST(IF((CROSS(1,YYAVX) AND (YYV1 >= YYV2)),1,0));
大盘4:=CONST(IF((CROSS(1,YYAVX) AND (YYV1 < YYV2)),1,0));
大盘5:=CONST(IF((((YYAVX >= 1) AND (REF(YYAVX,1) > 0)) AND (YYV1 >= YYV2)),1,0));
大盘6:=CONST(IF((((YYAVX >= 1) AND (REF(YYAVX,1) > 0)) AND (YYV1 < YYV2)),1,0));
大盘7:=CONST(IF((((YYAVX < 1) AND (REF(YYAVX,1) < 0)) AND (YYV1 >= YYV2)),1,0));
大盘8:=CONST(IF((((YYAVX < 1) AND (REF(YYAVX,1) < 0)) AND (YYV1 < YYV2)),1,0));
MFI:=(HIGH-LOW)*1000000/(VOL*比);
绿灯:=MFI>=REF(MFI,1)AND VOL*比>=REF(VOL,1);
MMM1:=CONST(绿灯);
衰退:=MFI<REF(MFI,1)AND VOL*比<REF(VOL,1);
MMM2:=CONST(衰退);
伪装:=MFI>=REF(MFI,1)AND VOL*比<REF(VOL,1);
MMM3:=CONST(伪装);
蛰伏:=MFI<REF(MFI,1)AND VOL*比>=REF(VOL,1);
MMM4:=CONST(蛰伏);
WJ:=(H+L+C)/3;V1:=IF(H=L,1,H-MAX(O,C));V2:=IF(H=L,1,MAX(C,O)-WJ);
V3:=IF(H=L,1,MIN(O,C)-L);V4:=IF(H=L,1,WJ-MIN(C,O));V5:=VOL/IF(H=L,4,H-L);
V6:=(V1*V5);V7:=(V2*V5);V8:=(V3*V5);V9:=(V4*V5);
买盘1:=DYNAINFO(23)*比;卖盘1:=DYNAINFO(22)*比;
买盘2:=IF(ISLASTBAR AND C>300,(V9+V8)*TT,(V9+V8));
卖盘2:=IF(ISLASTBAR AND C>300,(V6+V7)*TT,(V6+V7));
买盘:=IF(ISLASTBAR AND PERIOD=5 AND C<300,买盘1,买盘2);
卖盘:=IF(ISLASTBAR AND PERIOD=5 AND C<300,卖盘1,卖盘2);
{买卖差:=买盘-卖盘;}
量大:=(卖盘+买盘)/REF(VOL,1)>2;
MMM5:=CONST(量大);
量缩:=REF(VOL,1)/(卖盘+买盘)>1.5;
MMM6:=CONST(量缩);
卖量大:=(卖盘-买盘)/买盘>0.4;
MMM7:=CONST(卖量大);
买量大:=(买盘-卖盘)/卖盘>0.4;
MMM8:=CONST(买量大);
TS1:=IF(情况1=1,0.06+0.06,0.06); TS2:=IF(情况2=1,TS1+0.06,TS1);
TS3:=IF(情况3=1,TS2+0.06,TS2); TS4:=IF(情况4=1,TS3+0.06,TS3);
TS5:=IF(情况5=1,TS4+0.06,TS4); TS6:=IF(情况6=1,TS5+0.06,TS5);
TS7:=IF(情况7=1,TS6+0.06,TS6); TS8:=IF(情况8=1,TS7+0.06,TS7);
TS9:=IF(情况9=1,TS8+0.06,TS8); TS10:=IF(情况10=1,TS9+0.06,TS9);
TS11:=IF(情况11=1,TS10+0.06,TS10); TS12:=IF(情况12=1,TS11+0.06,TS11);
TS13:=IF(情况13=1,TS12+0.06,TS12); TS14:=IF(情况14=1,TS13+0.06,TS13);
TS15:=IF(情况15=1,TS14+0.06,TS14); TS16:=IF(情况16=1,TS15+0.06,TS15);
TS17:=IF(大盘1=1,TS16+0.06,TS16); TS18:=IF(大盘2=1,TS17+0.06,TS17);
TS19:=IF(大盘3=1,TS18+0.06,TS18); TS20:=IF(大盘4=1,TS19+0.06,TS19);
TS21:=IF(大盘5=1,TS20+0.06,TS20); TS22:=IF(大盘6=1,TS21+0.06,TS21);
TS23:=IF(大盘7=1,TS22+0.06,TS22); TS24:=IF(大盘8=1,TS23+0.06,TS23);
TS25:=IF(MMM1=1,TS24+0.06,TS24);
TS26:=IF(MMM2=1,TS25+0.06,TS25);
TS27:=IF(MMM3=1,TS26+0.06,TS26);
TS28:=IF(MMM4=1,TS27+0.06,TS27);
TS29:=IF(MMM5=1,TS28+0.03,TS28);
TS30:=IF(MMM6=1,TS29+0.03,TS29);
TS31:=IF(MMM7=1,TS30+0.03,TS30);
TS32:=IF(MMM8=1,TS31+0.03,TS31);
DRAWTEXT_FIX(MMM5,0,0.42,0,'★今天比昨天的成交量放大一倍以上。'),COLORGREEN;
DRAWTEXT_FIX(MMM6,0,0.42,0,'★今天比昨天的成交量缩量一半以上。'),COLORYELLOW;
DRAWTEXT_FIX(MMM7,0,0.48,0,'☆该股今天卖出量大于买入量40%以上。'),COLORGREEN;
DRAWTEXT_FIX(MMM8,0,0.48,0,'☆该股今天买入量大于卖出量40%以上。'),COLORYELLOW;
4. 通达信某均线穿某均线倍量阳指标源代码?
以下为通达信某均线穿某均线倍量阳指标的源代码:
```
输入:M1:SHORT,M2:SHORT,M3:SHORT,M4:SHORT,N1:SHORT,N2:SHORT,N3:SHORT,N4:SHORT,PERIOD:INTEGER;
VAR:MA1:DOUBLE,MA2:DOUBLE,MA3:DOUBLE,MA4:DOUBLE,LC:DOUBLE,TR:DOUBLE;
VAR:UPP:DOUBLE,LOW:DOUBLE,B1:DOUBLE,B2:DOUBLE,B3:DOUBLE,B4:DOUBLE,B5:DOUBLE,B6:DOUBLE,B7:DOUBLE,B8:DOUBLE,B9:DOUBLE,B10:DOUBLE,B11:DOUBLE,B12:DOUBLE,B13:DOUBLE,B14:DOUBLE,B15:DOUBLE,B16:DOUBLE,B17:DOUBLE,B18:DOUBLE,B19:DOUBLE,B20:DOUBLE,B21:DOUBLE,B22:DOUBLE,B23:DOUBLE,B24:DOUBLE,B25:DOUBLE,B26:DOUBLE,B27:DOUBLE,B28:DOUBLE,B29:DOUBLE,B30:DOUBLE,B31:DOUBLE,B32:DOUBLE,B33:DOUBLE,B34:DOUBLE,B35:DOUBLE,B36:DOUBLE,B37:DOUBLE,B38:DOUBLE,B39:DOUBLE,B40:DOUBLE,B41:DOUBLE,B42:DOUBLE,B43:DOUBLE,B44:DOUBLE,B45:DOUBLE,B46:DOUBLE,B47:DOUBLE,B48:DOUBLE;
VAR:BUY:INTEGER;
IF BARSCOUNT>PERIOD THEN BEGIN
MA1=MA(CLOSE,M1);
MA2=MA(CLOSE,M2);
MA3=MA(CLOSE,M3);
MA4=MA(CLOSE,M4);
UPP=MA1+N1*STDEV(CLOSE,M1);
LOW=MA1-N2*STDEV(CLOSE,M1);
B1=CLOSE<MA1 AND CROSS(MA2,MA1);
B2=CLOSE<MA1 AND MA1<=MA2 AND MA2<MA3 AND MA3<MA4;
B3=CLOSE<MA1 AND MA4<MA3 AND MA3<MA2 AND MA2<MA1;
B4=CLOSE<=MA2 AND MA2<MA1 AND MA1<=UPP AND
(CLOSE-MA2)>N3*(MA2-MA3) AND (MA2-MA3)<N4*(MA3-MA4);
B5=CLOSE<=MA2 AND MA2<MA1 AND UPP<CLOSE;
B6=CLOSE>MA1 AND MA2>=MA1 AND BARSSINCE(B1)=1;
B7=CLOSE>MA1 AND MA2<MA1 AND BARSSINCE(B2)=1;
B8=CLOSE>MA1 AND MA3<MA2 AND MA2<MA1 AND BARSSINCE(B3)=1;
B9=CLOSE>MA1 AND MA1<=UPP AND MA2<MA1 AND (CLOSE-MA2)>N3*(MA2-MA3) AND (MA2-MA3)<N4*(MA3-MA4) AND BARSSINCE(B4)=1;
B10=CLOSE>MA1 AND UPP<=MA1 AND BARSSINCE(B5)=1;
LC = Ref(CLOSE,-1);
TR = Max(Max(HIGH-LOW,ABS(HIGH-LC)),ABS(LC-LOW));
B11=CLOSE>MA1 AND MA1>MA2 AND MA2>MA3 AND MA3>MA4 AND
CLOSE-MA4>(N1+N2+N3+N4)/4*TR AND BARSSINCE(B6)>=PERIOD;
B12=CLOSE>MA1 AND MA1>MA2 AND MA2>MA3 AND MA3>MA4 AND
CLOSE-MA4>(N1+N2+N3+N4)/4*TR AND BARSSINCE(B7)>=PERIOD;
B13=CLOSE>MA1 AND MA3<MA2 AND MA2<MA1 AND
CLOSE-MA1>(N1+N2+N3+N4)/4*TR AND BARSSINCE(B8)>=PERIOD;
IF B11 OR B12 OR B13 THEN
BEGIN
B14 = MA(CLOSE,N1) > MA(CLOSE,N2);
B15 = MA(CLOSE,N2) > MA(CLOSE,N3);
B16 = MA(CLOSE,N3) > MA(CLOSE,N4);
B17 = MA(CLOSE,N4) > MA(CLOSE,PERIOD);
B18 = VOLUME > MA(VOLUME,PERIOD)*N4;
B19 = CLOSE > MA(CLOSE,PERIOD);
B20 = IFF(B14 AND B15 AND B16 AND B17 AND B18 AND B19,1,0);
B21 = SUM(B20,PERIOD-1) = PERIOD-1;
B22 = REF(B21,1);
IF B21 THEN
BEGIN
IF B22 THEN BUY = 1;
END
ELSE BUY = 0;
END;
END;
BUY不为0时表示出现该指标的买入信号。