• 新添加量子混沌系统板块,欢迎大家访问!---“量子混沌系统”
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏我们吧

“NMC斜率通道”,依托斜率捕捉市场趋势 MT4指标!免费

指标下载 qchaos.009 3个月前 (11-13) 8583 复制链接

指标名称:NMC斜率通道

版本:MT4 ver. 1.03(指标)

NMC斜率通道是一款通过结合自然市场组合指标与斜率背离分析的强大工具,能够帮助交易者识别市场的潜在反转点。通过捕捉价格与NMC之间的背离信号,结合其他技术指标,可以大大提高交易策略的准确性和有效性。适合那些希望在复杂市场环境中精准捕捉趋势变化和反转机会的交易者。

另外,如果发生突破也是有效的信号入场点。如下:

看指标信号:

如图信号向下突破,表示前面的上涨趋势已经完结,可能下跌。

“NMC斜率通道”,依托斜率捕捉市场趋势 MT4指标!免费

我们来看看十几分钟后的行情,果然下跌了。

“NMC斜率通道”,依托斜率捕捉市场趋势 MT4指标!免费

当然,这只是我十多分钟的观察,具体操作验证,还需要更多的数据支撑。

参数:

extern string TimeFrame = "Current time frame"; // 当前时间框架设置,指定指标应用的时间周期
extern int NMCPeriod = 20; // NMC(自然市场组合)指标的周期,通常用于平滑价格数据或计算相关指标
extern int NMCPrice = PRICE_HA; // 使用的价格类型,这里是 HA(Heiken Ashi)价格类型,表示用 Heiken Ashi 计算数据
extern double TEMAPeriod = 4; // TEMA(Triple Exponential Moving Average)的周期,控制移动平均的平滑程度
extern bool UseRiver = true; // 是否使用"河流"方法,决定是使用自然市场河流方法(River)还是其他方法(如镜像 Mirror)
extern int LinearRegressionLength = 50; // 线性回归的长度,定义计算线性回归时所使用的数据点数量
extern double LinearRegressionChannelWidth = 2.0; // 线性回归通道的宽度,用于控制通道的宽度范围,通常用于设置上下轨道的偏移
extern string IndicatorUniqueID = "NMC斜率通道"; // 指标的唯一标识符,通常用于标记该指标,在多个指标中避免重复
extern color ChartLineColor = Gold; // 图表中线条的颜色,Gold 表示金色,用于绘制图表中的线条
extern int ChartLineMiddleStyle = STYLE_DOT; // 图表中线条中间部分的样式,STYLE_DOT 表示虚线
extern int ChartLineStyle = STYLE_SOLID; // 图表中线条的样式,STYLE_SOLID 表示实线
extern color NmcLineColor = Gold; // NMC线条的颜色,Gold 表示金色
extern int NmcLineMiddleStyle = STYLE_DOT; // NMC线条中间部分的样式,STYLE_DOT 表示虚线
extern int NmcLineStyle = STYLE_SOLID; // NMC线条的样式,STYLE_SOLID 表示实线
extern bool Interpolate = false; // 是否进行插值,决定是否在时间轴上进行数据插值处理,用于提高数据的精度或平滑度

 

部分代码展示:

//+——————————————————————+
//| NMC斜率通道.mq4 |
//| Copyright © 2009-2024, http://www.QChaos.com |
//| https://www.qchaos.com/ |
//+——————————————————————+

property copyright "Copyright © 量化混沌, http://www.qchaos.com"

property link "https://www.qchaos.com"

property version "1.03"

property description "———————————————"

property description "EA、指标公式分享"

property description "EA、指标编写业务承接"

property description "———————————————"

property description "更多资源,关注公众号:量化程序"

property description "微 信:QChaos001"

property description "手机号:134-8068-5281"

property description "———————————————"

property indicator_separate_window

property indicator_buffers 2

property indicator_color1 DeepSkyBlue

property indicator_color2 Gray

property indicator_style2 STYLE_DOT

define PRICE_HA 7

extern string TimeFrame = "Current time frame";
extern int NMCPeriod = 20;
extern int NMCPrice = PRICE_HA;
extern double TEMAPeriod = 4;
extern bool UseRiver = true;
extern int LinearRegressionLength = 50;
extern double LinearRegressionChannelWidth = 2.0;
extern string IndicatorUniqueID = "NMC斜率通道";
extern color ChartLineColor = Gold;
extern int ChartLineMiddleStyle = STYLE_DOT;
extern int ChartLineStyle = STYLE_SOLID;
extern color NmcLineColor = Gold;
extern int NmcLineMiddleStyle = STYLE_DOT;
extern int NmcLineStyle = STYLE_SOLID;
extern bool Interpolate = false;

double work[][3];
double buffer1[];
double nmc[];
double zeroLine[];
double tBuffer[][4];
double alpha;
string shortName;
string indicatorFileName;
bool returnBars;
bool calculateValue;
int timeFrame;

//+——————————————————————+
//| |
//+——————————————————————+
int init()
{

IndicatorBuffers(3);
SetIndexBuffer(0,nmc); SetIndexLabel(0,"NMC") ; SetIndexDrawBegin(0,NMCPeriod);
SetIndexBuffer(1,zeroLine); SetIndexLabel(1,NULL);
SetIndexBuffer(2,buffer1);

string using = "";
if (UseRiver)
using = "river ";
else using = "mirror ";

NMCPeriod = MathMax(NMCPeriod ,1);
indicatorFileName = WindowExpertName();
returnBars = (TimeFrame=="returnBars"); if (returnBars) return(0);
calculateValue = (TimeFrame=="calculateValue");
if (calculateValue)
{
int s = StringFind(IndicatorUniqueID,":",0);
shortName = IndicatorUniqueID;
IndicatorUniqueID = StringSubstr(IndicatorUniqueID,0,s);
return(0);
}
timeFrame = stringToTimeFrame(TimeFrame);
shortName = IndicatorUniqueID+": "+timeFrameToString(timeFrame)+" – zl nmc2 "+using+" ("+NMCPeriod+","+DoubleToStr(TEMAPeriod,2)+","+LinearRegressionLength+")";

IndicatorShortName(shortName);
return(0);
}

int deinit()
{
for (int i=ObjectsTotal(); i>=0; i–)
{
string name = ObjectName(i); if (StringFind(name,IndicatorUniqueID)==0) ObjectDelete(name);
}
return(0);
}

define iPrc 3

int start()
{
double alpha = 2.0 /(1.0 + TEMAPeriod);
int counted_bars=IndicatorCounted();
int i,k,r,limit;

if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars–;
limit = MathMin(Bars-counted_bars,Bars-1);
if (returnBars) { nmc[0] = limit+1; return(0); }

if (calculateValue || timeFrame==Period())
{
if (ArrayRange(tBuffer,0) != Bars) ArrayResize(tBuffer,Bars);
if (ArrayRange(work,0)!=Bars) ArrayResize(work,Bars);
for(i=limit, r=Bars-i-1; i >= 0; i–,r++)
{
double currPrice = calculateTEMA(i,TEMAPeriod,NMCPrice,0);
work[r][0] = work[r-1][0]+alpha(currPrice -work[r-1][0]);
work[r][1] = work[r-1][1]+alpha
(work[r][0]-work[r-1][1]);
work[r][2] = work[r-1][2]+alpha(work[r][1]-work[r-1][2]);
buffer1[i] = currPrice+(currPrice-(3
work[r][0]-3*work[r][1]+work[r][2]));
if (currPrice > 0)
tBuffer[r][iPrc] = MathLog(currPrice);
else tBuffer[r][iPrc] = 0.00;

nmc[i] = 0;
zeroLine[i] = 0;

double nms = iNmsFunction(i);
double tmp;
if (UseRiver)
tmp = iNmrFunction(1,i);
else tmp = iNmmFunction(1,i);
tmp = (MathAbs(nms)tmp+MathAbs(tmp)nms)/2.00;
if (tmp > 0) nmc[i] = MathSqrt( tmp);
if (tmp < 0) nmc[i] = -MathSqrt(-tmp);
fillLrArray(i,0,nmc[i]);
fillLrArray(i,1,iMA(NULL,0,1,0,MODE_SMA,NMCPrice,i));
}

double nmcError; double nmcSlope; double lrnmc = iLrValue(nmc[0], LinearRegressionLength,nmcSlope,nmcError,0,0);
double prcError; double prcSlope; double lrPrc = iLrValue(iMA(NULL,0,1,0,MODE_SMA,NMCPrice,0),LinearRegressionLength,prcSlope,prcError,0,1);
int window = WindowFind(shortName);
createLine(window,lrnmc,lrnmc-(LinearRegressionLength-1.0)nmcSlope,"nmcLine",NmcLineColor ,NmcLineStyle ,NmcLineMiddleStyle ,nmcErrorLinearRegressionChannelWidth);
createLine(0 ,lrPrc,lrPrc-(LinearRegressionLength-1.0)prcSlope,"prcLine",ChartLineColor,ChartLineStyle,ChartLineMiddleStyle,prcErrorLinearRegressionChannelWidth);

return(0);
}


量子混沌 , 版权所有丨如未注明 , 均为原创
转载请注明原文链接:“NMC斜率通道”,依托斜率捕捉市场趋势 MT4指标!免费