您现在的位置:程序化交易>> 股票公式>> 其他>> 其他软件公式>>正文内容

趋势线、强势线和强牛线趋势K线 指标 公式 源码[其他软件公式]

指标代码分析及使用建议:

代码是一个基于K线图的股票技术分析指标,主要是通过计算最近几个交易日收盘价的大小比较来判断股票的趋势和强弱。

具体运算思路如下:首先定义了一系列的布尔变量,其中CXH2表示当当前收盘价大于前两天的收盘价时为真,CXH3~CXH19则表示在一系列条件下的股票价格上涨或下跌。然后通过STICKLINE函数将符合条件的K线柱用不同的颜色标注出来以示区分。除此之外还使用了DMA函数计算趋势线、强势线和强牛线等。

在操作建议方面,该指标可以辅助股票交易者更好地判断股票的趋势和强弱,但需要注意的是,该指标并非绝对可靠,仍需根据其他因素进行综合判断。

 

 

源码:

CXH2:=((CLOSE > REF(CLOSE,1)) AND (CLOSE > REF(CLOSE,2)));
CXH3:=((REF(CXH2,1) AND (CLOSE <= REF(CLOSE,1))) AND (CLOSE >= REF(CLOSE,2)));
CXH4:=((REF(CXH3,1) AND (CLOSE >= REF(CLOSE,1))) AND (CLOSE <= REF(CLOSE,2)));
CXH5:=((REF(CXH4,1) AND (CLOSE <= REF(CLOSE,1))) AND (CLOSE >= REF(CLOSE,2)));
CXH6:=((REF(CXH5,1) AND (CLOSE >= REF(CLOSE,1))) AND (CLOSE <= REF(CLOSE,2)));
CXH7:=((REF(CXH6,1) AND (CLOSE <= REF(CLOSE,1))) AND (CLOSE >= REF(CLOSE,2)));
CXH8:=((REF(CXH7,1) AND (CLOSE >= REF(CLOSE,1))) AND (CLOSE <= REF(CLOSE,2)));
CXH9:=((REF(CXH8,1) AND (CLOSE <= REF(CLOSE,1))) AND (CLOSE >= REF(CLOSE,2)));
CXHA:=((REF(CXH9,1) AND (CLOSE >= REF(CLOSE,1))) AND (CLOSE <= REF(CLOSE,2)));
CXHB:=((REF(CXHA,1) AND (CLOSE <= REF(CLOSE,1))) AND (CLOSE >= REF(CLOSE,2)));
CXHC:=((REF(CXHB,1) AND (CLOSE >= REF(CLOSE,1))) AND (CLOSE <= REF(CLOSE,2)));
CXHD:=((REF(CXHC,1) AND (CLOSE <= REF(CLOSE,1))) AND (CLOSE >= REF(CLOSE,2)));
STICKLINE((((((((((((CXH2 OR CXH3) OR CXH4) OR CXH5) OR CXH6) OR CXH7) OR CXH8) OR CXH9) OR CXHA) OR CXHB) OR CXHC) OR CXHD),CLOSE,REF(CLOSE,1),8,1),colorFF;
CXHE:=((CLOSE < REF(CLOSE,1)) AND (CLOSE < REF(CLOSE,2)));
CXHF:=((REF(CXHE,1) AND (CLOSE >= REF(CLOSE,1))) AND (CLOSE <= REF(CLOSE,2)));
CXH10:=((REF(CXHF,1) AND (CLOSE <= REF(CLOSE,1))) AND (CLOSE >= REF(CLOSE,2)));
CXH11:=((REF(CXH10,1) AND (CLOSE >= REF(CLOSE,1))) AND (CLOSE <= REF(CLOSE,2)));
CXH12:=((REF(CXH11,1) AND (CLOSE <= REF(CLOSE,1))) AND (CLOSE >= REF(CLOSE,2)));
CXH13:=((REF(CXH12,1) AND (CLOSE >= REF(CLOSE,1))) AND (CLOSE <= REF(CLOSE,2)));
CXH14:=((REF(CXH13,1) AND (CLOSE <= REF(CLOSE,1))) AND (CLOSE >= REF(CLOSE,2)));
CXH15:=((REF(CXH14,1) AND (CLOSE >= REF(CLOSE,1))) AND (CLOSE <= REF(CLOSE,2)));
CXH16:=((REF(CXH15,1) AND (CLOSE <= REF(CLOSE,1))) AND (CLOSE >= REF(CLOSE,2)));
CXH17:=((REF(CXH16,1) AND (CLOSE >= REF(CLOSE,1))) AND (CLOSE <= REF(CLOSE,2)));
CXH18:=((REF(CXH17,1) AND (CLOSE <= REF(CLOSE,1))) AND (CLOSE >= REF(CLOSE,2)));
CXH19:=((REF(CXH18,1) AND (CLOSE >= REF(CLOSE,1))) AND (CLOSE <= REF(CLOSE,2)));
STICKLINE((((((((((((CXHE OR CXHF) OR CXH10) OR CXH11) OR CXH12) OR CXH13) OR CXH14) OR CXH15) OR CXH16) OR CXH17) OR CXH18) OR CXH19),CLOSE,REF(CLOSE,1),8,1),COLORFF9900;
CXH1A:=(REF((((((((((((CXHE OR CXHF) OR CXH10) OR CXH11) OR CXH12) OR CXH13) OR CXH14) OR CXH15) OR CXH16) OR CXH17) OR CXH18) OR CXH19),1) AND CXH2);
STICKLINE(CXH1A,REF(CLOSE,1),REF(CLOSE,2),8,0)COLORYELLOW;
AA:=(REF((((((((((((CXH2 OR CXH3) OR CXH4) OR CXH5) OR CXH6) OR CXH7) OR CXH8) OR CXH9) OR CXHA) OR CXHB) OR CXHC) OR CXHD),1) AND CXHE);
STICKLINE(AA,REF(CLOSE,1),REF(CLOSE,2),10,0)COLORBLUE;
YC_AA:=(OPEN+CLOSE)/2;
趋势线:DMA(YC_AA,VOL/SUM(VOL,8))LINETHICK1,;
强势线:DMA(YC_AA,VOL/SUM(VOL,36))LINETHICK1,COLORYELLOW;
强牛线:DMA(YC_AA,VOL/SUM(VOL,70))LINETHICK1,COLORRED;

趋势线 由绿变红 显示字‘买’;由红变绿 显示字‘卖’;位置在变色下方

 

公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程

 

 

有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友

可联系技术人员 QQ: 262069696  点击在线交流或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)

怎么收费,代编流程等详情请点击查阅!

(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)

 


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容