精英指标 :) - 页 383 1...376377378379380381382383384385386387388389390...1108 新评论 Mladen Rakic 2011.10.02 06:26 #3821 TepeFinans 给你 我只想解释一下为什么名字里有 "通用 "二字:我没有使用metatrader提供的 "默认 "指标,而是使用了一个允许不同周期数值和信号平滑化的版本。用于数值和信号的平滑是三角移动平均线("常规 "三角移动平均线,而不是居中的,所以没有任何重新计算),默认设置为与内置指标相同,但也允许你试验不同的平滑长度。 附上一个简单的指标,以及一个带有MTF、警报和背离线的版本。附上 "简单版本,以便让该版本可以简单地与默认的内置指标相媲美。另外,在寻找分歧时,把rvi平滑化可能是一个好主意(把平滑期设置为1),因为这样 "原始rvi "值的滞后性最小,而且这样的peek识别比平滑化模式更精确。但是要注意,这是一个 "原始rvi",而不是rvi(这里有一个常规rvi(上)和 "原始rvi"(下)分歧的比较--可以看出,当涉及到分歧时,原始rvi的工作更加精确,这样,"通用 "版本变得更有用一些 问候 姆拉登 TepeFinans: 嗨,Mladen 相对活力指数分歧??? 附加的文件: rvi_1.gif 27 kb rvi_2.gif 29 kb rvi_generic.mq4 4 kb rvi_genericamp_divergence.mq4 15 kb TepeFinans 2011.10.02 08:24 #3822 嗨,Mladen 谢谢 mladen: TepeFinans给你 我只想解释一下为什么叫 "通用":我没有使用metatrader提供的 "默认 "指标,而是使用了一个允许不同周期数值和信号平滑的版本。用于数值和信号的平滑是三角移动平均线("常规 "三角移动平均线,而不是居中的,所以没有任何重新计算),默认设置为与内置指标相同,但也允许你试验不同的平滑长度。 附上一个简单的指标,以及一个带有MTF、警报和背离线的版本。附上 "简单版本,以便让该版本可以简单地与默认的内置指标相媲美。另外,在寻找分歧时,把rvi平滑化可能是一个好主意(把平滑期设置为1),因为这样 "原始rvi "值的滞后性最小,而且这样的peek识别比平滑化模式更精确。但是要注意,这是一个 "原始rvi",而不是rvi(这里有一个常规rvi(上)和 "原始rvi"(下)分歧的比较--可以看出,当涉及到分歧时,原始rvi的工作更加精确,这样,"通用 "版本变得更有用一些 问候 姆拉登 Mladen Rakic 2011.10.03 08:55 #3823 QQE高级这是一个试图使一个已经很有用的指标 更有用的尝试 QQE添加的内容:在计算前可以选择和平滑(过滤)价格,并可以使用内置的metatrader rsi之外的其他指标。内置的metatrader rsi与Welles Wilder's rsi不同,我决定将QQE计算中使用的默认rsi类型设置为Wilder's rsi,理由不止一个。像往常一样,rsi方法可以是 0 - "常规 "rsi 1 - Wilder的rsi 2 - rsx 3 - Cuttler rsi 此外,即使是非常温和的价格预平滑也会产生相当有趣的结果:这里是一个 "常规 "QQE与高级QQE的比较,计算中使用了Wilder的3期预平滑(MaPeriodset 为3)rsi 或在15分钟图表上的相同设置的1小时指标(现在,当人们在寻找波动的时候,似乎看一下这样的东西可能有助于避免一些错误) 附加的文件: qqe_adv_1.gif 24 kb qqe_adv_2.gif 20 kb qqe_advanced.mq4 12 kb 解读经典和隐藏背离的新途径。 第二部分 轻松快捷开发 MetaTrader 程序的函数库(第十一部分)。 与 khaliddxd 2011.10.03 12:31 #3824 Mladen, 善意的请求 亲爱的Mladen, 能否将qqe指标转换为彩色条形图!像以前一样。 谢谢你 你的。 khaliddxd camisa 2011.10.03 19:56 #3825 mladen: TepeFinans给你 我只想解释一下为什么在名称中使用 "通用":我没有使用metatrader提供的 "默认 "指标,而是使用了一个允许不同周期数值和信号平滑的版本。用于数值和信号的平滑是三角移动平均线("常规 "三角移动平均线,而不是居中的,所以没有任何重新计算),默认设置为与内置指标相同,但也允许你试验不同的平滑长度。 附上一个简单的指标,以及一个带有MTF、警报和背离线的版本。附上 "简单版本,以便让该版本可以简单地与默认的内置指标相媲美。另外,在寻找分歧时,把rvi平滑化可能是一个好主意(把平滑期设置为1),因为这样 "原始rvi "值的滞后性最小,而且这样的peek识别比平滑化模式更精确。但是要注意,这是一个 "原始rvi",而不是rvi(这里有一个常规rvi(上)和 "原始rvi"(下)分歧的比较--可以看出,当涉及到分歧时,原始rvi的工作更加精确,这样,"通用 "版本变得更有用一些 问候 姆拉登 箭头,好吗?(请为Mladen的新QQE提供同样的信息) forexts2 2011.10.04 04:35 #3826 要求另一个新的indi Mladen, 这里有一个关于另一个新指标 的请求,叫做 Mogalef波段 这个代码已经在今年5月的一个交易商会议上公开了。 现在论坛上有不同的版本。忍者,PRT,GraphAT(见附件文件)等。 但GrapAT版本似乎还不错 请把这个代码翻译成Mql4,我想每个人都会喜欢... 如果需要的话,请随时做自己的修改。 谢谢你 devinci **************************************************************** //======================= // Mogalef Bands - GrapAT //======================= //1---- Weighted prices "Mogalef" // CP(0)=(High+Low+Open+2*Close)/5 //2---- linear regression Weighted prices P1 periods // If RangHisto>=P1 Then somx = 0 somy = 0 somxx = 0 somxy = 0 For P1 Prices somx = somx+RangPour somy = somy+CP somxx = somxx+RangPour*RangPour somxy = somxy+RangPour*CP EndFor a = (P1*somxy-somx*somy)/(P1*somxx-somx*somx) b = (somy-a*somx)/P1 MogRegLin = b + a*P1 EndIf //3---Standard deviation of linear regression on P2 periods // If RangHisto>= P1+P2-1 Then StanDev(0)=StandarDeviation(MogRegLin,P2) EndIf //4---- "Mogalef" Bands // If RangHisto>=P1+P2 Then If MogRegLinMogB(1) // NO LAG if Lin Reg is within inside bands Then StanDev=StanDev(1) MogM=MogM(1) MogH=MogH(1) MogB=MogB(1) IfNot // shift/lag when computing new band values MogM=MogRegLin MogH=MogRegLin+P3*StanDev MogB=MogRegLin-P3*StanDev EndIf EndIf //end of code ************************************************************************** other version: {********************************************************* Mogalef Bands easy language Multicharts **********************************************************} variables: var0(0), var1(0), HighBand(0), LowBand(0), Mediane(0); var0 = LinearRegValue((Open+High+Low+(2*Close))/5,3,0); var1 = StandardDev(var0,7,1); if currentbar=8 then begin HighBand = var0 + 2*var1; LowBand = var0 - 2*var1; Mediane = var0; end else if var0 HighBand then begin HighBand = var0 + 2*var1; LowBand = var0 - 2*var1; Mediane = var0; end; Plot1(HighBand,"HighBand"); Plot2(LowBand,"LowBand"); Plot3(Mediane,"Mediane"); ********************************************************* other version: ************************** Mogalef Bands Ninja trader ************************** #region Using declarations using System; using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.Drawing.Drawing2D; using System.Xml.Serialization; using NinjaTrader.Cbi; using NinjaTrader.Data; using NinjaTrader.Gui.Chart; #endregion // This namespace holds all indicators and is required. Do not change it. namespace NinjaTrader.Indicator { /// /// Enter the description of your new custom indicator here /// [Description("Enter the description of your new custom indicator here")] public class MogalefBands : Indicator { #region Variables // Wizard generated variables // User defined variables (add any user defined variables below) private DataSeries CPSerie, ESerie, FSerie; private double nMedian = 0, nHigh = 0, nLow = 0; private int LinRegPeriode = 3, StdDevPeriode = 7; #endregion /// /// This method is used to configure the indicator and is called once before any bar data is loaded. /// protected override void Initialize() { Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "MMedian")); Add(new Plot(Color.FromKnownColor(KnownColor.Gray), PlotStyle.Line, "MHigh")); Add(new Plot(Color.FromKnownColor(KnownColor.Gray), PlotStyle.Line, "MLow")); Overlay = true; CPSerie = new DataSeries( this ); ESerie = new DataSeries( this ); FSerie = new DataSeries( this ); } /// /// Called on each bar update event (incoming tick) /// protected override void OnBarUpdate() { // Use this method for calculating your indicator values. Assign a value to each // plot below by replacing 'Close[0]' with your own formula. if (CurrentBar < 8) { CPSerie.Set((Open[0] + High[0] + Low[0] + (2*Close[0]))/5); nMedian = CPSerie[0]; nHigh = 0; nLow = 0; return; } CPSerie.Set((Open[0] + High[0] + Low[0] + (2*Close[0]))/5); if (CurrentBar > 8 + StdDevPeriode) { FSerie.Set(LinReg(CPSerie,LinRegPeriode)[0]); ESerie.Set(StdDev(FSerie,StdDevPeriode)[0]); } else { FSerie.Set(CPSerie[0]); ESerie.Set(0); } if (FSerie[0] nHigh) { nMedian = FSerie[0]; nHigh = nMedian + (2*ESerie[0]); nLow = nMedian - (2*ESerie[0]); } MMedian.Set(nMedian); MHigh.Set(nHigh); MLow.Set(nLow); } #region Properties // this line prevents the data series from being displayed in the indicator properties dialog, do not remove [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove public DataSeries MMedian { get { return Values[0]; } } // this line prevents the data series from being displayed in the indicator properties dialog, do not remove [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove public DataSeries MHigh { get { return Values[1]; } } // this line prevents the data series from being displayed in the indicator properties dialog, do not remove [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove public DataSeries MLow { get { return Values[2]; } } [Description("")] [Category("Parameters")] [Gui.Design.DisplayName("LinReg periode")] public int LinRegPERIODE { get { return LinRegPeriode; } set { LinRegPeriode = Math.Max(1, value); } } [Description("")] [Category("Parameters")] [Gui.Design.DisplayName("StdDev periode")] public int StdDevPERIODE { get { return StdDevPeriode; } set { StdDevPeriode = Math.Max(1, value); } } #endregion } } ****************************************************************** ****************************************************************** 附加的文件: example1.png 37 kb Elite indicators :) T3 T3 Mladen Rakic 2011.10.04 04:58 #3827 devinci 给你 使用了他们使用的默认参数,并添加了他们使用的价格(在metatrader中不存在的(High+Low+Open+2*Close)/5),在BandsPrice 参数中使用8来获得该价格。 PS:我编辑了你的帖子,以使其 "视觉上更短"。其他方面没有改动。希望你不要介意 问候 Mladen devinci: Mladen, 这里有一个关于另一个新指标Mogalef带的请求这个代码已经在今年5月的一个交易商会议上公开了。现在论坛上有不同的版本。忍者,PRT,GraphAT(见附件文件)等。但GrapAT版本似乎还不错请把这个代码翻译成Mql4,我想每个人都会喜欢...如果需要的话,请随时做自己的修改。谢谢你devinci**************************************************************** //======================= // Mogalef Bands - GrapAT //======================= //1---- Weighted prices "Mogalef" // CP(0)=(High+Low+Open+2*Close)/5 //2---- linear regression Weighted prices P1 periods // If RangHisto>=P1 Then somx = 0 somy = 0 somxx = 0 somxy = 0 For P1 Prices somx = somx+RangPour somy = somy+CP somxx = somxx+RangPour*RangPour somxy = somxy+RangPour*CP EndFor a = (P1*somxy-somx*somy)/(P1*somxx-somx*somx) b = (somy-a*somx)/P1 MogRegLin = b + a*P1 EndIf //3---Standard deviation of linear regression on P2 periods // If RangHisto>= P1+P2-1 Then StanDev(0)=StandarDeviation(MogRegLin,P2) EndIf //4---- "Mogalef" Bands // If RangHisto>=P1+P2 Then If MogRegLinMogB(1) // NO LAG if Lin Reg is within inside bands Then StanDev=StanDev(1) MogM=MogM(1) MogH=MogH(1) MogB=MogB(1) IfNot // shift/lag when computing new band values MogM=MogRegLin MogH=MogRegLin+P3*StanDev MogB=MogRegLin-P3*StanDev EndIf EndIf //end of code ************************************************************************** other version: {********************************************************* Mogalef Bands easy language Multicharts **********************************************************} variables: var0(0), var1(0), HighBand(0), LowBand(0), Mediane(0); var0 = LinearRegValue((Open+High+Low+(2*Close))/5,3,0); var1 = StandardDev(var0,7,1); if currentbar=8 then begin HighBand = var0 + 2*var1; LowBand = var0 - 2*var1; Mediane = var0; end else if var0 HighBand then begin HighBand = var0 + 2*var1; LowBand = var0 - 2*var1; Mediane = var0; end; Plot1(HighBand,"HighBand"); Plot2(LowBand,"LowBand"); Plot3(Mediane,"Mediane"); ********************************************************* other version: ************************** Mogalef Bands Ninja trader ************************** #region Using declarations using System; using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.Drawing.Drawing2D; using System.Xml.Serialization; using NinjaTrader.Cbi; using NinjaTrader.Data; using NinjaTrader.Gui.Chart; #endregion // This namespace holds all indicators and is required. Do not change it. namespace NinjaTrader.Indicator { /// /// Enter the description of your new custom indicator here /// [Description("Enter the description of your new custom indicator here")] public class MogalefBands : Indicator { #region Variables // Wizard generated variables // User defined variables (add any user defined variables below) private DataSeries CPSerie, ESerie, FSerie; private double nMedian = 0, nHigh = 0, nLow = 0; private int LinRegPeriode = 3, StdDevPeriode = 7; #endregion /// /// This method is used to configure the indicator and is called once before any bar data is loaded. /// protected override void Initialize() { Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "MMedian")); Add(new Plot(Color.FromKnownColor(KnownColor.Gray), PlotStyle.Line, "MHigh")); Add(new Plot(Color.FromKnownColor(KnownColor.Gray), PlotStyle.Line, "MLow")); Overlay = true; CPSerie = new DataSeries( this ); ESerie = new DataSeries( this ); FSerie = new DataSeries( this ); } /// /// Called on each bar update event (incoming tick) /// protected override void OnBarUpdate() { // Use this method for calculating your indicator values. Assign a value to each // plot below by replacing 'Close[0]' with your own formula. if (CurrentBar < 8) { CPSerie.Set((Open[0] + High[0] + Low[0] + (2*Close[0]))/5); nMedian = CPSerie[0]; nHigh = 0; nLow = 0; return; } CPSerie.Set((Open[0] + High[0] + Low[0] + (2*Close[0]))/5); if (CurrentBar > 8 + StdDevPeriode) { FSerie.Set(LinReg(CPSerie,LinRegPeriode)[0]); ESerie.Set(StdDev(FSerie,StdDevPeriode)[0]); } else { FSerie.Set(CPSerie[0]); ESerie.Set(0); } if (FSerie[0] nHigh) { nMedian = FSerie[0]; nHigh = nMedian + (2*ESerie[0]); nLow = nMedian - (2*ESerie[0]); } MMedian.Set(nMedian); MHigh.Set(nHigh); MLow.Set(nLow); } #region Properties // this line prevents the data series from being displayed in the indicator properties dialog, do not remove [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove public DataSeries MMedian { get { return Values[0]; } } // this line prevents the data series from being displayed in the indicator properties dialog, do not remove [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove public DataSeries MHigh { get { return Values[1]; } } // this line prevents the data series from being displayed in the indicator properties dialog, do not remove [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove public DataSeries MLow { get { return Values[2]; } } [Description("")] [Category("Parameters")] [Gui.Design.DisplayName("LinReg periode")] public int LinRegPERIODE { get { return LinRegPeriode; } set { LinRegPeriode = Math.Max(1, value); } } [Description("")] [Category("Parameters")] [Gui.Design.DisplayName("StdDev periode")] public int StdDevPERIODE { get { return StdDevPeriode; } set { StdDevPeriode = Math.Max(1, value); } } #endregion } } ****************************************************************** ****************************************************************** 附加的文件: mogalef_bands.mq4 5 kb linr_bands.gif 19 kb forexts2 2011.10.04 10:32 #3828 莫加莱夫乐队 Mladen, 非常感谢,这是完美的 祝你有个愉快的一天 devinci barbaron 2011.10.04 16:06 #3829 如果可能的话,现在请给我一份报告 你好,Mladen。 你能不能从2个不同时间框架的QQE高级版中做一个与你之前做的简单QQE相同的柱状图(红色、绿色和灰色条)? 预先感谢 barbaron 2011.10.05 04:58 #3830 莫加莱夫手镯 BTW 对Mogalef Bands和如何使用它们的描述很好,http://www.whselfinvest.com/en/trading_strategies_26_Mogalef_Bands.php,请欣赏。 1...376377378379380381382383384385386387388389390...1108 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
TepeFinans
给你
我只想解释一下为什么名字里有 "通用 "二字:我没有使用metatrader提供的 "默认 "指标,而是使用了一个允许不同周期数值和信号平滑化的版本。用于数值和信号的平滑是三角移动平均线("常规 "三角移动平均线,而不是居中的,所以没有任何重新计算),默认设置为与内置指标相同,但也允许你试验不同的平滑长度。
附上一个简单的指标,以及一个带有MTF、警报和背离线的版本。附上 "简单版本,以便让该版本可以简单地与默认的内置指标相媲美。另外,在寻找分歧时,把rvi平滑化可能是一个好主意(把平滑期设置为1),因为这样 "原始rvi "值的滞后性最小,而且这样的peek识别比平滑化模式更精确。但是要注意,这是一个 "原始rvi",而不是rvi(这里有一个常规rvi(上)和 "原始rvi"(下)分歧的比较--可以看出,当涉及到分歧时,原始rvi的工作更加精确,这样,"通用 "版本变得更有用一些
问候
姆拉登
嗨,Mladen
相对活力指数
分歧
???嗨,Mladen
谢谢
TepeFinans
给你
我只想解释一下为什么叫 "通用":我没有使用metatrader提供的 "默认 "指标,而是使用了一个允许不同周期数值和信号平滑的版本。用于数值和信号的平滑是三角移动平均线("常规 "三角移动平均线,而不是居中的,所以没有任何重新计算),默认设置为与内置指标相同,但也允许你试验不同的平滑长度。
附上一个简单的指标,以及一个带有MTF、警报和背离线的版本。附上 "简单版本,以便让该版本可以简单地与默认的内置指标相媲美。另外,在寻找分歧时,把rvi平滑化可能是一个好主意(把平滑期设置为1),因为这样 "原始rvi "值的滞后性最小,而且这样的peek识别比平滑化模式更精确。但是要注意,这是一个 "原始rvi",而不是rvi(这里有一个常规rvi(上)和 "原始rvi"(下)分歧的比较--可以看出,当涉及到分歧时,原始rvi的工作更加精确,这样,"通用 "版本变得更有用一些
问候
姆拉登QQE高级
这是一个试图使一个已经很有用的指标 更有用的尝试
QQE添加的内容:在计算前可以选择和平滑(过滤)价格,并可以使用内置的metatrader rsi之外的其他指标。内置的metatrader rsi与Welles Wilder's rsi不同,我决定将QQE计算中使用的默认rsi类型设置为Wilder's rsi,理由不止一个。像往常一样,rsi方法可以是
Mladen, 善意的请求
亲爱的Mladen,
能否将qqe指标转换为彩色条形图!像以前一样。
谢谢你
你的。
khaliddxd
TepeFinans
给你
我只想解释一下为什么在名称中使用 "通用":我没有使用metatrader提供的 "默认 "指标,而是使用了一个允许不同周期数值和信号平滑的版本。用于数值和信号的平滑是三角移动平均线("常规 "三角移动平均线,而不是居中的,所以没有任何重新计算),默认设置为与内置指标相同,但也允许你试验不同的平滑长度。
附上一个简单的指标,以及一个带有MTF、警报和背离线的版本。附上 "简单版本,以便让该版本可以简单地与默认的内置指标相媲美。另外,在寻找分歧时,把rvi平滑化可能是一个好主意(把平滑期设置为1),因为这样 "原始rvi "值的滞后性最小,而且这样的peek识别比平滑化模式更精确。但是要注意,这是一个 "原始rvi",而不是rvi(这里有一个常规rvi(上)和 "原始rvi"(下)分歧的比较--可以看出,当涉及到分歧时,原始rvi的工作更加精确,这样,"通用 "版本变得更有用一些
问候
姆拉登箭头,好吗?(请为Mladen的新QQE提供同样的信息)
要求另一个新的indi
Mladen,
这里有一个关于另一个新指标 的请求,叫做 Mogalef波段
这个代码已经在今年5月的一个交易商会议上公开了。
现在论坛上有不同的版本。忍者,PRT,GraphAT(见附件文件)等。
但GrapAT版本似乎还不错
请把这个代码翻译成Mql4,我想每个人都会喜欢...
如果需要的话,请随时做自己的修改。
谢谢你
devinci
//=======================
// Mogalef Bands - GrapAT
//=======================
//1---- Weighted prices "Mogalef"
//
CP(0)=(High+Low+Open+2*Close)/5
//2---- linear regression Weighted prices P1 periods
//
If RangHisto>=P1 Then
somx = 0
somy = 0
somxx = 0
somxy = 0
For P1 Prices
somx = somx+RangPour
somy = somy+CP
somxx = somxx+RangPour*RangPour
somxy = somxy+RangPour*CP
EndFor
a = (P1*somxy-somx*somy)/(P1*somxx-somx*somx)
b = (somy-a*somx)/P1
MogRegLin = b + a*P1
EndIf
//3---Standard deviation of linear regression on P2 periods
//
If RangHisto>= P1+P2-1 Then
StanDev(0)=StandarDeviation(MogRegLin,P2)
EndIf
//4---- "Mogalef" Bands
//
If RangHisto>=P1+P2 Then
If MogRegLinMogB(1) // NO LAG if Lin Reg is within inside bands
Then
StanDev=StanDev(1)
MogM=MogM(1)
MogH=MogH(1)
MogB=MogB(1)
IfNot // shift/lag when computing new band values
MogM=MogRegLin
MogH=MogRegLin+P3*StanDev
MogB=MogRegLin-P3*StanDev
EndIf
EndIf
//end of code
**************************************************************************
other version:
{*********************************************************
Mogalef Bands easy language Multicharts
**********************************************************}
variables: var0(0), var1(0), HighBand(0), LowBand(0), Mediane(0);
var0 = LinearRegValue((Open+High+Low+(2*Close))/5,3,0);
var1 = StandardDev(var0,7,1);
if currentbar=8 then
begin
HighBand = var0 + 2*var1;
LowBand = var0 - 2*var1;
Mediane = var0;
end
else
if var0 HighBand then
begin
HighBand = var0 + 2*var1;
LowBand = var0 - 2*var1;
Mediane = var0;
end;
Plot1(HighBand,"HighBand");
Plot2(LowBand,"LowBand");
Plot3(Mediane,"Mediane");
*********************************************************
other version:
**************************
Mogalef Bands Ninja trader
**************************
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;
#endregion
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
///
/// Enter the description of your new custom indicator here
///
[Description("Enter the description of your new custom indicator here")]
public class MogalefBands : Indicator
{
#region Variables
// Wizard generated variables
// User defined variables (add any user defined variables below)
private DataSeries CPSerie, ESerie, FSerie;
private double nMedian = 0, nHigh = 0, nLow = 0;
private int LinRegPeriode = 3, StdDevPeriode = 7;
#endregion
///
/// This method is used to configure the indicator and is called once before any bar data is loaded.
///
protected override void Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "MMedian"));
Add(new Plot(Color.FromKnownColor(KnownColor.Gray), PlotStyle.Line, "MHigh"));
Add(new Plot(Color.FromKnownColor(KnownColor.Gray), PlotStyle.Line, "MLow"));
Overlay = true;
CPSerie = new DataSeries( this );
ESerie = new DataSeries( this );
FSerie = new DataSeries( this );
}
///
/// Called on each bar update event (incoming tick)
///
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
if (CurrentBar < 8)
{
CPSerie.Set((Open[0] + High[0] + Low[0] + (2*Close[0]))/5);
nMedian = CPSerie[0];
nHigh = 0;
nLow = 0;
return;
}
CPSerie.Set((Open[0] + High[0] + Low[0] + (2*Close[0]))/5);
if (CurrentBar > 8 + StdDevPeriode)
{
FSerie.Set(LinReg(CPSerie,LinRegPeriode)[0]);
ESerie.Set(StdDev(FSerie,StdDevPeriode)[0]);
}
else
{
FSerie.Set(CPSerie[0]);
ESerie.Set(0);
}
if (FSerie[0] nHigh)
{
nMedian = FSerie[0];
nHigh = nMedian + (2*ESerie[0]);
nLow = nMedian - (2*ESerie[0]);
}
MMedian.Set(nMedian);
MHigh.Set(nHigh);
MLow.Set(nLow);
}
#region Properties
// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries MMedian
{
get { return Values[0]; }
}
// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries MHigh
{
get { return Values[1]; }
}
// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries MLow
{
get { return Values[2]; }
}
[Description("")]
[Category("Parameters")]
[Gui.Design.DisplayName("LinReg periode")]
public int LinRegPERIODE
{
get { return LinRegPeriode; }
set { LinRegPeriode = Math.Max(1, value); }
}
[Description("")]
[Category("Parameters")]
[Gui.Design.DisplayName("StdDev periode")]
public int StdDevPERIODE
{
get { return StdDevPeriode; }
set { StdDevPeriode = Math.Max(1, value); }
}
#endregion
}
}
******************************************************************
******************************************************************devinci
给你 使用了他们使用的默认参数,并添加了他们使用的价格(在metatrader中不存在的(High+Low+Open+2*Close)/5),在BandsPrice 参数中使用8来获得该价格。
PS:我编辑了你的帖子,以使其 "视觉上更短"。其他方面没有改动。希望你不要介意
问候
Mladen
Mladen,
这里有一个关于另一个新指标Mogalef带的请求
这个代码已经在今年5月的一个交易商会议上公开了。
现在论坛上有不同的版本。忍者,PRT,GraphAT(见附件文件)等。
但GrapAT版本似乎还不错
请把这个代码翻译成Mql4,我想每个人都会喜欢...
如果需要的话,请随时做自己的修改。
谢谢你
devinci
//=======================
// Mogalef Bands - GrapAT
//=======================
//1---- Weighted prices "Mogalef"
//
CP(0)=(High+Low+Open+2*Close)/5
//2---- linear regression Weighted prices P1 periods
//
If RangHisto>=P1 Then
somx = 0
somy = 0
somxx = 0
somxy = 0
For P1 Prices
somx = somx+RangPour
somy = somy+CP
somxx = somxx+RangPour*RangPour
somxy = somxy+RangPour*CP
EndFor
a = (P1*somxy-somx*somy)/(P1*somxx-somx*somx)
b = (somy-a*somx)/P1
MogRegLin = b + a*P1
EndIf
//3---Standard deviation of linear regression on P2 periods
//
If RangHisto>= P1+P2-1 Then
StanDev(0)=StandarDeviation(MogRegLin,P2)
EndIf
//4---- "Mogalef" Bands
//
If RangHisto>=P1+P2 Then
If MogRegLinMogB(1) // NO LAG if Lin Reg is within inside bands
Then
StanDev=StanDev(1)
MogM=MogM(1)
MogH=MogH(1)
MogB=MogB(1)
IfNot // shift/lag when computing new band values
MogM=MogRegLin
MogH=MogRegLin+P3*StanDev
MogB=MogRegLin-P3*StanDev
EndIf
EndIf
//end of code
**************************************************************************
other version:
{*********************************************************
Mogalef Bands easy language Multicharts
**********************************************************}
variables: var0(0), var1(0), HighBand(0), LowBand(0), Mediane(0);
var0 = LinearRegValue((Open+High+Low+(2*Close))/5,3,0);
var1 = StandardDev(var0,7,1);
if currentbar=8 then
begin
HighBand = var0 + 2*var1;
LowBand = var0 - 2*var1;
Mediane = var0;
end
else
if var0 HighBand then
begin
HighBand = var0 + 2*var1;
LowBand = var0 - 2*var1;
Mediane = var0;
end;
Plot1(HighBand,"HighBand");
Plot2(LowBand,"LowBand");
Plot3(Mediane,"Mediane");
*********************************************************
other version:
**************************
Mogalef Bands Ninja trader
**************************
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;
#endregion
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
///
/// Enter the description of your new custom indicator here
///
[Description("Enter the description of your new custom indicator here")]
public class MogalefBands : Indicator
{
#region Variables
// Wizard generated variables
// User defined variables (add any user defined variables below)
private DataSeries CPSerie, ESerie, FSerie;
private double nMedian = 0, nHigh = 0, nLow = 0;
private int LinRegPeriode = 3, StdDevPeriode = 7;
#endregion
///
/// This method is used to configure the indicator and is called once before any bar data is loaded.
///
protected override void Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "MMedian"));
Add(new Plot(Color.FromKnownColor(KnownColor.Gray), PlotStyle.Line, "MHigh"));
Add(new Plot(Color.FromKnownColor(KnownColor.Gray), PlotStyle.Line, "MLow"));
Overlay = true;
CPSerie = new DataSeries( this );
ESerie = new DataSeries( this );
FSerie = new DataSeries( this );
}
///
/// Called on each bar update event (incoming tick)
///
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
if (CurrentBar < 8)
{
CPSerie.Set((Open[0] + High[0] + Low[0] + (2*Close[0]))/5);
nMedian = CPSerie[0];
nHigh = 0;
nLow = 0;
return;
}
CPSerie.Set((Open[0] + High[0] + Low[0] + (2*Close[0]))/5);
if (CurrentBar > 8 + StdDevPeriode)
{
FSerie.Set(LinReg(CPSerie,LinRegPeriode)[0]);
ESerie.Set(StdDev(FSerie,StdDevPeriode)[0]);
}
else
{
FSerie.Set(CPSerie[0]);
ESerie.Set(0);
}
if (FSerie[0] nHigh)
{
nMedian = FSerie[0];
nHigh = nMedian + (2*ESerie[0]);
nLow = nMedian - (2*ESerie[0]);
}
MMedian.Set(nMedian);
MHigh.Set(nHigh);
MLow.Set(nLow);
}
#region Properties
// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries MMedian
{
get { return Values[0]; }
}
// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries MHigh
{
get { return Values[1]; }
}
// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries MLow
{
get { return Values[2]; }
}
[Description("")]
[Category("Parameters")]
[Gui.Design.DisplayName("LinReg periode")]
public int LinRegPERIODE
{
get { return LinRegPeriode; }
set { LinRegPeriode = Math.Max(1, value); }
}
[Description("")]
[Category("Parameters")]
[Gui.Design.DisplayName("StdDev periode")]
public int StdDevPERIODE
{
get { return StdDevPeriode; }
set { StdDevPeriode = Math.Max(1, value); }
}
#endregion
}
}
******************************************************************
******************************************************************莫加莱夫乐队
Mladen,
非常感谢,这是完美的
祝你有个愉快的一天
devinci
如果可能的话,现在请给我一份报告
你好,Mladen。
你能不能从2个不同时间框架的QQE高级版中做一个与你之前做的简单QQE相同的柱状图(红色、绿色和灰色条)?
预先感谢
莫加莱夫手镯
BTW 对Mogalef Bands和如何使用它们的描述很好,http://www.whselfinvest.com/en/trading_strategies_26_Mogalef_Bands.php,请欣赏。