股资源-股票学习站-学炒股-股票课程-炒股教程-分析选股指标-入门基础知识

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[大智慧] 综合度 (大智慧、通达信、飞狐)源码+排序


    [-----复制链接-----]
楼主
 通达信源码安装路径:1,工具栏点击公式选项。2,弹出公式窗口点击新建。3,把源码复制到指标编辑器保存。4,回到K线图界面安装建立好的公式 || 2024-3-22 17:28:22
综合度 (大智慧、通达信、飞狐)源码+排序介绍

综合度 (大智慧、通达信、飞狐)源码+排序

综合度

公式中用到MACD、DMI及量三个指标进行综合度评比。满分为9分。其中MACD所占比重偏大为4分,量占3分,DMI占2分。

DZH2 (排序时选择指标线综合度)
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
DEA度:=IF(DEA>REF(DEA,1) AND DEA>0,2,IF(DEA>REF(DEA,1) AND DEA<0,1,0));
DIFF度:=IF(DIFF>DEA AND DEA>REF(DEA,1) AND DIFF>REF(DIFF,1),1,IF(DIFF>DEA AND DEA>REF(DEA,1) AND DIFF<REF(DIFF,1),0.5,0));
MACD度:=IF(MACD>REF(MACD,1) AND MACD>0,1,IF(MACD>REF(MACD,1) AND MACD<0,0.5,0));
M度:=DEA度+DIFF度+MACD度;
V35:=MA(V,35);
五日量:=SUM(V,5);
均量度:=IF(V>35 AND V35>REF(V35,1),2,IF(V<V35 AND V35>REF(V35,1),1,0));
增量度:=IF(五日量>REF(五日量,1),1,0);
量度:=均量度+增量度;
TR:=SMA(MAX(MAX(H-L,ABS(H-REF(C,1))),ABS(L-REF(C,1))),14,1);
HD:=H-REF(H,1);
LD:=REF(L,1)-L;
DMP:=SMA(IF(HD>0 AND HD>LD,HD,0),6,1);
DMM:=SMA(IF(LD>0 AND LD>HD,LD,0),6,1);
PDI:=DMP*100/TR;
MDI:=DMM*100/TR;
PDI度:=IF(PDI>REF(PDI,1) AND PDI>MDI,1,IF(PDI>REF(PDI,1) AND PDI<MDI,0.5,0));
MDI度:=IF(MDI<REF(MDI,1) AND MDI<PDI,1,IF(MDI<REF(MDI,1) AND MDI>PDI,0.5,0));
DMI度:=PDI度+MDI度;
综合度:M度+量度+DMI度,COLORMAGENTA,PRECIS1,LINETHICK0;
走强:=IF(综合度>=5,综合度,0);
走弱:=IF(综合度<5,综合度,0);
强势:SMA(走强,3,1),COLORRED,PRECIS2,LAYER1;
弱势:SMA(走弱,3,1),COLORGREEN,PRECIS2,LAYER2;
FILLRGN(强势,4,强势>=4),COLOR000066,PRECIS2,LAYER3;
STICKLINE(C,4,4,5,0),COLORYELLOW,LAYER4;


{综合度 TDX}
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
DEA度:=IF(DEA>REF(DEA,1) AND DEA>0,2,IF(DEA>REF(DEA,1) AND DEA<0,1,0));
DIFF度:=IF(DIFF>DEA AND DEA>REF(DEA,1) AND DIFF>REF(DIFF,1),1,IF(DIFF>DEA AND DEA>REF(DEA,1) AND DIFF<REF

(DIFF,1),0.5,0));
MACD度:=IF(MACD>REF(MACD,1) AND MACD>0,1,IF(MACD>REF(MACD,1) AND MACD<0,0.5,0));
M度:=DEA度+DIFF度+MACD度;
V35:=MA(V,35);
五日量:=SUM(V,5);
均量度:=IF(V>35 AND V35>REF(V35,1),2,IF(V<V35 AND V35>REF(V35,1),1,0));
增量度:=IF(五日量>REF(五日量,1),1,0);
量度:=均量度+增量度;
TR:=SMA(MAX(MAX(H-L,ABS(H-REF(C,1))),ABS(L-REF(C,1))),14,1);
HD:=H-REF(H,1);
LD:=REF(L,1)-L;
DMP:=SMA(IF(HD>0 AND HD>LD,HD,0),6,1);
DMM:=SMA(IF(LD>0 AND LD>HD,LD,0),6,1);
PDI:=DMP*100/TR;
MDI:=DMM*100/TR;
PDI度:=IF(PDI>REF(PDI,1) AND PDI>MDI,1,IF(PDI>REF(PDI,1) AND PDI<MDI,0.5,0));
MDI度:=IF(MDI<REF(MDI,1) AND MDI<PDI,1,IF(MDI<REF(MDI,1) AND MDI>PDI,0.5,0));
DMI度:=PDI度+MDI度;
综合度:M度+量度+DMI度,COLORMAGENTA,NODRAW;
走强:=IF(综合度>=5,综合度,0);
走弱:=IF(综合度<5,综合度,0);
强势线:SMA(走强,3,1),COLORRED,;
弱势线:SMA(走弱,3,1),COLORGREEN,;
STICKLINE(C,4,4,5,0),COLORYELLOW,;
{追补};
STICKLINE(强势线>4,4,强势线,0,0),COLORRED,;

飞狐
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
DEA度:=IF(DEA>REF(DEA,1) AND DEA>0,2,IF(DEA>REF(DEA,1) AND DEA<0,1,0));
DIFF度:=IF(DIFF>DEA AND DEA>REF(DEA,1) AND DIFF>REF(DIFF,1),1,IF(DIFF>DEA AND DEA>REF(DEA,1) AND DIFF<REF(DIFF,1),0.5,0));
MACD度:=IF(MACD>REF(MACD,1) AND MACD>0,1,IF(MACD>REF(MACD,1) AND MACD<0,0.5,0));
M度:=DEA度+DIFF度+MACD度;
V35:=MA(V,35);
五日量:=SUM(V,5);
均量度:=IF(V>35 AND V35>REF(V35,1),2,IF(V<V35 AND V35>REF(V35,1),1,0));
增量度:=IF(五日量>REF(五日量,1),1,0);
量度:=均量度+增量度;
TR1:=SMA(MAX(MAX(H-L,ABS(H-REF(C,1))),ABS(L-REF(C,1))),14,1);
HD:=H-REF(H,1);
LD:=REF(L,1)-L;
DMP:=SMA(IF(HD>0 AND HD>LD,HD,0),6,1);
DMM:=SMA(IF(LD>0 AND LD>HD,LD,0),6,1);
PDI:=DMP*100/TR1;
MDI:=DMM*100/TR1;
PDI度:=IF(PDI>REF(PDI,1) AND PDI>MDI,1,IF(PDI>REF(PDI,1) AND PDI<MDI,0.5,0));
MDI度:=IF(MDI<REF(MDI,1) AND MDI<PDI,1,IF(MDI<REF(MDI,1) AND MDI>PDI,0.5,0));
DMI度:=PDI度+MDI度;
综合度:M度+量度+DMI度,COLORMAGENTA,PRECISION2,LINETHICK0;
走强:=IF(综合度>=5,综合度,0);
走弱:=IF(综合度<5,综合度,0);
强势:SMA(走强,3,1),COLORRED,PRECISION2;
弱势:SMA(走弱,3,1),COLORGREEN,PRECISION2;
FILLRGN(强势>=4,强势,4),COLOR000066;
STICKLINE(C,4,4,5,0),COLORYELLOW;

综合度(排序)

DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
DEA度:=IF(DEA>REF(DEA,1) AND DEA>0,2,IF(DEA>REF(DEA,1) AND DEA<0,1,0));
DIFF度:=IF(DIFF>DEA AND DEA>REF(DEA,1) AND DIFF>REF(DIFF,1),1,IF(DIFF>DEA AND DEA>REF(DEA,1) AND DIFF<REF(DIFF,1),0.5,0));
MACD度:=IF(MACD>REF(MACD,1) AND MACD>0,1,IF(MACD>REF(MACD,1) AND MACD<0,0.5,0));
M度:=DEA度+DIFF度+MACD度;
V35:=MA(V,35);
五日量:=SUM(V,5);
均量度:=IF(V>35 AND V35>REF(V35,1),2,IF(V<V35 AND V35>REF(V35,1),1,0));
增量度:=IF(五日量>REF(五日量,1),1,0);
量度:=均量度+增量度;
TR:=SMA(MAX(MAX(H-L,ABS(H-REF(C,1))),ABS(L-REF(C,1))),14,1);
HD:=H-REF(H,1);
LD:=REF(L,1)-L;
DMP:=SMA(IF(HD>0 AND HD>LD,HD,0),6,1);
DMM:=SMA(IF(LD>0 AND LD>HD,LD,0),6,1);
PDI:=DMP*100/TR;
MDI:=DMM*100/TR;
PDI度:=IF(PDI>REF(PDI,1) AND PDI>MDI,1,IF(PDI>REF(PDI,1) AND PDI<MDI,0.5,0));
MDI度:=IF(MDI<REF(MDI,1) AND MDI<PDI,1,IF(MDI<REF(MDI,1) AND MDI>PDI,0.5,0));
DMI度:=PDI度+MDI度;
综合度:M度+量度+DMI度,PRECIS1;
 



gd11464

回复

举报

QQ|

GMT+8, 2024-11-18 13:51

快速回复 返回顶部 返回列表