【指标学习】冲天龙头趋势通道指标:如何帮你抓住日内T0机会
在股票市场中,技术分析是投资者不可或缺的工具之一。通过技术指标可以更好地理解市场趋势、价格波动以及潜在的买卖机会。
一、指标的基本构成
通达信冲天龙头指标由多个子指标和条件判断组成,主要包括以下几个部分:
二、指标的核心功能
龙头通道源代码通达信:
通道:(WMA(WMA(HIGH,25),25)-WMA(WMA(LOW,25),25))*1+WMA(WMA(HIGH,25),25),DOTLINE,COLORYELLOW;龙头:WMA(WMA(LOW,25),25)-(WMA(WMA(HIGH,25),25)-WMA(WMA(LOW,25),25))*1,COLORRED,LINETHICK2;通道2:EMA(龙头,25),COLORCYAN,LINETHICK2;DRAWBAND(龙头,RGB(55,0,0),通道2,RGB(0,91,0));DRAWKLINE(HIGH,OPEN,LOW,CLOSE);STICKLINE(龙头>LOW AND 龙头< HIGH,龙头,MIN(MIN(OPEN,CLOSE),龙头),3,0),COLORBLUE;STICKLINE(龙头>MIN(CLOSE,OPEN) AND 龙头< MAX(CLOSE,OPEN),龙头,MIN(OPEN,CLOSE),0,0),COLORBLUE;STICKLINE(龙头>HIGH,OPEN,CLOSE,3,0),COLORBLUE;STICKLINE(龙头>HIGH,HIGH,LOW,0,0),COLORBLUE;STICKLINE(NOT(龙头>HIGH),OPEN,CLOSE,3,0),COLORRED;STICKLINE(NOT(龙头>HIGH),HIGH,LOW,0,0),COLORRED;lijin4:=100*WMA(WMA(CLOSE-REF(CLOSE,1),6),6)/WMA(WMA(ABS(CLOSE-REF(CLOSE,1)),6),6);lijin5:=LLV(lijin4,2)=LLV(lijin4,7) AND COUNT(lijin4< 0,2) AND CROSS(lijin4,MA(lijin4,2));lijin6:=龙头>HIGH AND lijin5 AND LOW<=龙头 AND CLOSE!=LOW;lijin7:=(HIGH+LOW+CLOSE)/3;lijin8:=VOL/IF(HIGH=LOW,4,HIGH-LOW);lijin9:=IF(CAPITAL=0,lijin8*(lijin7-MIN(CLOSE,OPEN)),lijin8*IF(HIGH=LOW,1,MIN(OPEN,CLOSE)-LOW));lijin10:=IF(CAPITAL=0,lijin8*(MIN(OPEN,CLOSE)-LOW),lijin8*IF(HIGH=LOW,1,lijin7-MIN(CLOSE,OPEN)));lijin11:=IF(CAPITAL=0,lijin8*(HIGH-MAX(OPEN,CLOSE)),lijin8*IF(HIGH=LOW,1,HIGH-MAX(OPEN,CLOSE)));lijin12:=IF(CAPITAL=0,lijin8*(MAX(CLOSE,OPEN)-lijin7),lijin8*IF(HIGH=LOW,1,MAX(CLOSE,OPEN)-lijin7));lijin13:=(lijin9+lijin10-(lijin11+lijin12))/IF(CAPITAL=0,10000,10000);lijin14:=SMA(IF(CLOSE>=REF(CLOSE,1),lijin13,(-lijin13)/100),2,1);lijin15:=SMA(lijin14*120/FROMOPEN*5,2,1);lijin16:=SMA(lijin15,5,1);lijin17:=SMA(lijin16,5,1);lijin18:=CURRBARSCOUNT=1 AND CLOSE< REF(CLOSE,1);lijin19:=REF(lijin14,1)-lijin18;lijin20:=CLOSE>OPEN AND lijin19< 0.02 AND MA(CLOSE,5)>MA(CLOSE,60) AND CLOSE/REF(CLOSE,1)>=1.02 AND HIGH< 通道;lijin21:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;lijin22:=SMA(lijin21,3,1);lijin23:=SMA(lijin22,3,1);lijin24:=3*lijin22-2*lijin23;lijin25:=MA(CLOSE,5);lijin26:=MA(CLOSE,10);lijin27:=MA(CLOSE,20);lijin28:=MA(CLOSE,30);lijin29:=MA(CLOSE,60);lijin30:=lijin25/LOW;lijin31:=HIGH/lijin25;lijin32:=lijin30>1.1 AND CLOSE>OPEN;lijin33:=lijin31>1.1 AND CLOSE< OPEN;lijin34:=lijin30>1.05 AND CLOSE>OPEN AND CLOSE< lijin25 AND CLOSE< lijin26 AND CLOSE< lijin27 AND CLOSE< lijin29;lijin35:=lijin31>1.05 AND CLOSE< OPEN;lijin36:=lijin29/CLOSE;lijin37:=lijin32>0 AND lijin34>0 AND lijin36>1.5 AND lijin24>lijin22;STICKLINE(lijin37,OPEN,CLOSE,2,0),COLORFF00FF;lijin38:=HIGH>lijin26*1.15 AND CLOSE< OPEN;CTA:=REF(C,1)< 龙头 AND REF(C,2)< 龙头 AND O< 龙头 AND C>龙头;卖:DRAWICON(FILTER(lijin38>0,1),HIGH*1.02,6);买:DRAWICON(CTA,LOW*1.02,15);通达信dll龙头通道C++源代码:#include <vector>
#include <cmath>
#include <algorithm>
struct KLine {
double high;
double low;
double open;
double close;
double volume;
};
// 计算加权移动平均线 (WMA)
double WMA(const std::vector<double>& data, int period) {
double sum = 0.0;
double weightSum = 0.0;
for (int i = 0; i < period; ++i) {
double weight = (period - i);
sum += data * weight;
weightSum += weight;
}
return sum / weightSum;
}
// 计算指数移动平均线 (EMA)
double EMA(const std::vector<double>& data, int period) {
double alpha = 2.0 / (period + 1);
double ema = data[0];
for (size_t i = 1; i < data.size(); ++i) {
ema = alpha * data + (1 - alpha) * ema;
}
return ema;
}
// 计算通道
double calculateChannel(const std::vector<KLine>& klines, int period) {
std::vector<double> highs;
std::vector<double> lows;
for (constauto& kline : klines) {
highs.push_back(kline.high);
lows.push_back(kline.low);
}
double wmaHigh = WMA(highs, period);
double wmaLow = WMA(lows, period);
return (wmaHigh - wmaLow) * 1 + wmaHigh;
}
// 计算龙头
double calculateLongTou(const std::vector<KLine>& klines, int period) {
std::vector<double> highs;
std::vector<double> lows;
for (constauto& kline : klines) {
highs.push_back(kline.high);
lows.push_back(kline.low);
}
double wmaHigh = WMA(highs, period);
double wmaLow = WMA(lows, period);
return wmaLow - (wmaHigh - wmaLow) * 1;
}
// 计算通道2
double calculateChannel2(double longTou, int period) {
std::vector<double> longTouData(period, longTou);
return EMA(longTouData, period);
}
风险提示:本指标仅供技术研究与学习交流使用。资本市场具有高度不确定性,任何基于本指标的投资决策都需要自行承担风险,不构成任何投资建议。
学习分享
学术交流:我们专注于市场的学术交流与研究包括自用指标抄底逃顶零滞后均线最速曲线,以及期货自动化和股票自动化学习。
分享知识:田都元帅,敬神常在,爱人如己,我为人人,与人为善,分享快乐!
一、指标的基本构成
通达信冲天龙头指标由多个子指标和条件判断组成,主要包括以下几个部分:
- 通道计算:通过加权移动平均线(WMA)计算出的高点和低点通道,用于标识价格的波动范围。龙头线:基于WMA计算出的关键价格线,用于判断市场的支撑和阻力位。通道2:基于龙头线的指数移动平均线(EMA),用于平滑价格波动,提供更稳定的趋势信号。量价关系:通过成交量与价格的关系,判断市场的资金流向和买卖力度。买卖信号:通过一系列条件判断,生成买入和卖出的信号。
二、指标的核心功能
- 趋势识别:通过通道和龙头线的计算,指标能够清晰地展示市场的趋势方向。当价格在通道上方运行时,表明市场处于上升趋势;反之,则处于下降趋势。支撑与阻力:龙头线和通道2为投资者提供了关键的支撑和阻力位。当价格接近或突破这些关键位时,往往意味着市场可能出现反转或加速。买卖信号:指标通过复杂的条件判断,生成买入和卖出的信号。这些信号基于价格、成交量以及多个技术指标的综合分析,具有较高的可靠性。风险控制:通过量价关系的分析,指标能够帮助投资者识别市场的潜在风险。当成交量与价格出现背离时,往往意味着市场可能出现反转。
- 趋势跟踪:投资者可以利用通道和龙头线进行趋势跟踪。当价格在通道上方运行时,可以持有或加仓;当价格跌破通道时,应考虑减仓或离场。支撑与阻力交易:当价格接近龙头线或通道2时,可以视为买入或卖出的机会。例如,当价格回调至龙头线附近时,可以考虑买入;当价格反弹至通道2附近时,可以考虑卖出。买卖信号执行:当指标生成买入信号时,投资者可以积极进场;当生成卖出信号时,应及时离场。这些信号基于多重条件的综合分析,具有较高的胜率。风险控制:通过量价关系的分析,投资者可以及时识别市场的潜在风险。例如,当价格创新高而成交量未能同步放大时,可能意味着市场上涨动力不足,应考虑减仓或离场。
龙头通道源代码通达信:
通道:(WMA(WMA(HIGH,25),25)-WMA(WMA(LOW,25),25))*1+WMA(WMA(HIGH,25),25),DOTLINE,COLORYELLOW;龙头:WMA(WMA(LOW,25),25)-(WMA(WMA(HIGH,25),25)-WMA(WMA(LOW,25),25))*1,COLORRED,LINETHICK2;通道2:EMA(龙头,25),COLORCYAN,LINETHICK2;DRAWBAND(龙头,RGB(55,0,0),通道2,RGB(0,91,0));DRAWKLINE(HIGH,OPEN,LOW,CLOSE);STICKLINE(龙头>LOW AND 龙头< HIGH,龙头,MIN(MIN(OPEN,CLOSE),龙头),3,0),COLORBLUE;STICKLINE(龙头>MIN(CLOSE,OPEN) AND 龙头< MAX(CLOSE,OPEN),龙头,MIN(OPEN,CLOSE),0,0),COLORBLUE;STICKLINE(龙头>HIGH,OPEN,CLOSE,3,0),COLORBLUE;STICKLINE(龙头>HIGH,HIGH,LOW,0,0),COLORBLUE;STICKLINE(NOT(龙头>HIGH),OPEN,CLOSE,3,0),COLORRED;STICKLINE(NOT(龙头>HIGH),HIGH,LOW,0,0),COLORRED;lijin4:=100*WMA(WMA(CLOSE-REF(CLOSE,1),6),6)/WMA(WMA(ABS(CLOSE-REF(CLOSE,1)),6),6);lijin5:=LLV(lijin4,2)=LLV(lijin4,7) AND COUNT(lijin4< 0,2) AND CROSS(lijin4,MA(lijin4,2));lijin6:=龙头>HIGH AND lijin5 AND LOW<=龙头 AND CLOSE!=LOW;lijin7:=(HIGH+LOW+CLOSE)/3;lijin8:=VOL/IF(HIGH=LOW,4,HIGH-LOW);lijin9:=IF(CAPITAL=0,lijin8*(lijin7-MIN(CLOSE,OPEN)),lijin8*IF(HIGH=LOW,1,MIN(OPEN,CLOSE)-LOW));lijin10:=IF(CAPITAL=0,lijin8*(MIN(OPEN,CLOSE)-LOW),lijin8*IF(HIGH=LOW,1,lijin7-MIN(CLOSE,OPEN)));lijin11:=IF(CAPITAL=0,lijin8*(HIGH-MAX(OPEN,CLOSE)),lijin8*IF(HIGH=LOW,1,HIGH-MAX(OPEN,CLOSE)));lijin12:=IF(CAPITAL=0,lijin8*(MAX(CLOSE,OPEN)-lijin7),lijin8*IF(HIGH=LOW,1,MAX(CLOSE,OPEN)-lijin7));lijin13:=(lijin9+lijin10-(lijin11+lijin12))/IF(CAPITAL=0,10000,10000);lijin14:=SMA(IF(CLOSE>=REF(CLOSE,1),lijin13,(-lijin13)/100),2,1);lijin15:=SMA(lijin14*120/FROMOPEN*5,2,1);lijin16:=SMA(lijin15,5,1);lijin17:=SMA(lijin16,5,1);lijin18:=CURRBARSCOUNT=1 AND CLOSE< REF(CLOSE,1);lijin19:=REF(lijin14,1)-lijin18;lijin20:=CLOSE>OPEN AND lijin19< 0.02 AND MA(CLOSE,5)>MA(CLOSE,60) AND CLOSE/REF(CLOSE,1)>=1.02 AND HIGH< 通道;lijin21:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;lijin22:=SMA(lijin21,3,1);lijin23:=SMA(lijin22,3,1);lijin24:=3*lijin22-2*lijin23;lijin25:=MA(CLOSE,5);lijin26:=MA(CLOSE,10);lijin27:=MA(CLOSE,20);lijin28:=MA(CLOSE,30);lijin29:=MA(CLOSE,60);lijin30:=lijin25/LOW;lijin31:=HIGH/lijin25;lijin32:=lijin30>1.1 AND CLOSE>OPEN;lijin33:=lijin31>1.1 AND CLOSE< OPEN;lijin34:=lijin30>1.05 AND CLOSE>OPEN AND CLOSE< lijin25 AND CLOSE< lijin26 AND CLOSE< lijin27 AND CLOSE< lijin29;lijin35:=lijin31>1.05 AND CLOSE< OPEN;lijin36:=lijin29/CLOSE;lijin37:=lijin32>0 AND lijin34>0 AND lijin36>1.5 AND lijin24>lijin22;STICKLINE(lijin37,OPEN,CLOSE,2,0),COLORFF00FF;lijin38:=HIGH>lijin26*1.15 AND CLOSE< OPEN;CTA:=REF(C,1)< 龙头 AND REF(C,2)< 龙头 AND O< 龙头 AND C>龙头;卖:DRAWICON(FILTER(lijin38>0,1),HIGH*1.02,6);买:DRAWICON(CTA,LOW*1.02,15);通达信dll龙头通道C++源代码:#include <vector>
#include <cmath>
#include <algorithm>
struct KLine {
double high;
double low;
double open;
double close;
double volume;
};
// 计算加权移动平均线 (WMA)
double WMA(const std::vector<double>& data, int period) {
double sum = 0.0;
double weightSum = 0.0;
for (int i = 0; i < period; ++i) {
double weight = (period - i);
sum += data * weight;
weightSum += weight;
}
return sum / weightSum;
}
// 计算指数移动平均线 (EMA)
double EMA(const std::vector<double>& data, int period) {
double alpha = 2.0 / (period + 1);
double ema = data[0];
for (size_t i = 1; i < data.size(); ++i) {
ema = alpha * data + (1 - alpha) * ema;
}
return ema;
}
// 计算通道
double calculateChannel(const std::vector<KLine>& klines, int period) {
std::vector<double> highs;
std::vector<double> lows;
for (constauto& kline : klines) {
highs.push_back(kline.high);
lows.push_back(kline.low);
}
double wmaHigh = WMA(highs, period);
double wmaLow = WMA(lows, period);
return (wmaHigh - wmaLow) * 1 + wmaHigh;
}
// 计算龙头
double calculateLongTou(const std::vector<KLine>& klines, int period) {
std::vector<double> highs;
std::vector<double> lows;
for (constauto& kline : klines) {
highs.push_back(kline.high);
lows.push_back(kline.low);
}
double wmaHigh = WMA(highs, period);
double wmaLow = WMA(lows, period);
return wmaLow - (wmaHigh - wmaLow) * 1;
}
// 计算通道2
double calculateChannel2(double longTou, int period) {
std::vector<double> longTouData(period, longTou);
return EMA(longTouData, period);
}
风险提示:本指标仅供技术研究与学习交流使用。资本市场具有高度不确定性,任何基于本指标的投资决策都需要自行承担风险,不构成任何投资建议。
学习分享
学术交流:我们专注于市场的学术交流与研究包括自用指标抄底逃顶零滞后均线最速曲线,以及期货自动化和股票自动化学习。
分享知识:田都元帅,敬神常在,爱人如己,我为人人,与人为善,分享快乐!