极品KDJ指标 公式 源码[其他软件公式]
指标公式代码分析及使用说明:
这是一段股票交易的指标公式,包含各种技术指标计算方法。下面介绍每个指标的公式及其简要思路分析和使用参考建议:
1. CXH1、CXH2:计算当天股价相对于前一天的涨跌情况,即当天收盘价与前一天收盘价的差值,由于开盘价可能与前一天收盘价不同,所以开盘价也要考虑进去。如果当天股价比前一天低,则CXH1=0;如果当天股价比前一天高,则CXH1为最高价与开盘价的差值或者开盘价与前一天收盘价的差值中的较大值。如果当天股价比前一天高,则CXH2=0;如果当天股价比前一天低,则CXH2为开盘价与最低价的差值或者开盘价与前一天收盘价的差值中的较大值。
2. CXH3、CXH4:分别累加过去5天内涨幅和跌幅的大小。
3. CXH5:计算过去5天内股价涨幅与跌幅大小之间的比例,如果涨幅大于跌幅,则CXH5为两者比例;如果相等,则CXH5为0;如果跌幅大于涨幅,则CXH5为跌幅与涨幅比例的相反数。
4. CXH6:对过去5天内股价涨跌幅大小比例进行移动平均。
5. CXH8、CXH9:与CXH1、CXH2含义相同,只是计算时取的时间窗口不同。
6. CXHA、CXHB:分别累加过去3天内涨幅和跌幅的大小,与CXH3、CXH4含义相同。
7. CXHC:计算过去3天内股价涨幅与跌幅大小之间的比例,与CXH5含义相同。
8. CXHD:对过去3天内股价涨跌幅大小比例进行移动平均。
9. 火:判断当天收盘价是否比前一天低,如果是,则标记为“火”,使用红色竖线表示。
10. CXHE、CXHF:分别计算近两天内的最高价和最高价出现的时间,并将最高价的出现时间作为一个参数,计算得到一个合理的买入价,并用绿色线表示。
11. 山:计算过去5天内每一天的收盘价是否高于前一天的收盘价,统计连续出现高点的天数,并用数字表示。
12. CXH14-CXH19:与CXH8-CXH13含义相同,只是统计时间窗口不同。
13. RSV:计算随机指标,用于衡量当前股价处于高位还是低位。
14. STICKLINE、DRAWTEXT:使用K线图形式展示交易信号,如买入点、卖出点等。建议使用时,结合历史行情数据进行回测,并设置合理的止损和止盈策略。
源码:
CXH1:=IF(OPEN<=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));
CXH2:=IF(OPEN>=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));
CXH3:=SUM(CXH1,5);
CXH4:=SUM(CXH2,5);
CXH5:=IF(CXH3>CXH4,(CXH3-CXH4)/CXH3,IF(CXH3=CXH4,0,(CXH3-CXH4)/CXH4));
CXH6:=MA(CXH5,5);
CXH8:=IF(OPEN<=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));
CXH9:=IF(OPEN>=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));
CXHA:=SUM(CXH8,3);
CXHB:=SUM(CXH9,3);
CXHC:=IF(CXHA>CXHB,(CXHA-CXHB)/CXHA,IF(CXHA=CXHB,0,(CXHA-CXHB)/CXHB));
CXHD:=MA(CXHC,3);
火: BARSLAST(EMA(CLOSE,5)<REF(EMA(CLOSE,5),1)),COLORRED;
CXHE:=HHV(CLOSE,2);
CXHF:=BARSLAST(CXHE<REF(CXHE,2));
CXH10:=IF(CXHF>=1,LLV(CXHE,CXHF),LOW);
CXH11:=CXH10+CXH10*CXHF*0.5/100;
CXH12:=IF(CXH11<REF(CXH11,1),MA(LOW,3),CXH11);
CXH13:=CXH10+CXH10*(CXHF-1)*1.618/100;
山: COUNT(EMA(CLOSE,5)>REF(EMA(CLOSE,5),1),5);
CXH14:=IF(OPEN<=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));
CXH15:=IF(OPEN>=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));
CXH16:=SUM(CXH8,3);
CXH17:=SUM(CXH9,3);
CXH18:=IF(CXHA>CXHB,(CXHA-CXHB)/CXHA,IF(CXHA=CXHB,0,(CXHA-CXHB)/CXHB));
CXH19:=MA(CXHC,3);
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
买入或持股: STICKLINE(山>0,火,0,2,0),COLORRED;
CXH1A:=IF(OPEN<=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));
CXH1B:=IF(OPEN>=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));
CXH1C:=SUM(CXH8,3);
CXH1D:=SUM(CXH9,3);
CXH1E:=IF(CXHA>CXHB,(CXHA-CXHB)/CXHA,IF(CXHA=CXHB,0,(CXHA-CXHB)/CXHB));
CXH1F:=MA(CXHC,3);
下跌→抛出: STICKLINE(山>0,火,山,2,1),COLORF0F000;
CXH20:=IF(OPEN<=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));
CXH21:=IF(OPEN>=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));
CXH22:=SUM(CXH8,3);
CXH23:=SUM(CXH9,3);
CXH24:=IF(CXHA>CXHB,(CXHA-CXHB)/CXHA,IF(CXHA=CXHB,0,(CXHA-CXHB)/CXHB));
CXH25:=MA(CXHC,3);
观望: STICKLINE(山=0 AND 火=0,0,1,4,1),COLORBLUE;
CXH26:=IF(OPEN<=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));
CXH27:=IF(OPEN>=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));
CXH28:=SUM(CXH8,3);
CXH29:=SUM(CXH9,3);
CXH2A:=IF(CXHA>CXHB,(CXHA-CXHB)/CXHA,IF(CXHA=CXHB,0,(CXHA-CXHB)/CXHB));
CXH2B:=MA(CXHC,3);
植被: STICKLINE(山<火,火,山,1,0),COLOR00FF00;
CXH2C:=IF(OPEN<=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));
CXH2D:=IF(OPEN>=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));
CXH2E:=SUM(CXH8,3);
CXH2F:=SUM(CXH9,3);
CXH30:=IF(CXHA>CXHB,(CXHA-CXHB)/CXHA,IF(CXHA=CXHB,0,(CXHA-CXHB)/CXHB));
CXH31:=MA(CXHC,3);
CXH32:=(CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*10;
CXH33:=IF(OPEN<=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));
CXH34:=IF(OPEN>=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));
CXH35:=SUM(CXH8,3);
CXH36:=SUM(CXH9,3);
CXH37:=IF(CXHA>CXHB,(CXHA-CXHB)/CXHA,IF(CXHA=CXHB,0,(CXHA-CXHB)/CXHB));
CXH38:=MA(CXHC,3);
STICKLINE(REF(山,1)=0 AND 山>0,0,-1,2,0),COLORRED;
DRAWTEXT(REF(火,3)>0 AND REF(火,2)>0 AND REF(火,1)>0 AND 火=0 AND REF(火,1)>山,REF(火,1),'调整'),COLORYELLOW , ;
{程序化交易 www.cxh99.com }
公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程】
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容