移动平均数 - 页 105 1...9899100101102103104105106107108109110111112...155 新评论 Mladen Rakic 2013.12.09 22:36 #1041 person77: 妙不可言--效果非常好,Mladen!非常感谢你。如果不是太麻烦的话,我有几个要求。 1. 当4个MA都在同步时,价格回撤并触及一个指定的MA (在这种情况下,第二条最短的MA,红色的15 EMA),我希望有一个箭头和警报产生。 然后我将改变到较小的1M时间框架,在那里寻找空头信号。 我插入水平线和垂直线,这样就很容易发现在较小的1M时间框架回测中要看的地方(A点)。 2. 我可以要求4ma同步indy只寻找两到三个ma的同步,以显示柱状图吗?(请看1米条件附件,了解我在这里要做的事情) 人77 恐怕这个指标的设计或预测不是为了显示价格触动。而且我很肯定,现在已经有很好的指标在做这种工作了。 至于2个和3个mas的版本:只需将代码中的""替换成 "if (ma1<ma2 && ma2<3" ... "等等,然后将2个mas设置为3个不同mas的相同值,或者将2对mas设置为相同的值,就可以让指标显示2个mas。 metrus 2013.12.09 23:55 #1042 mladen 谢谢你的建议。 我的编码几乎是无用的! 我把>和<改成了=,但在编译时出现了一些错误。 我需要做什么不同的事情呢? //------------------------------------------------------------------ #property copyright "www.forex-tsd.com" #property link "www.forex-tsd.com" //------------------------------------------------------------------ #属性 indicator_separate_window #属性 indicator_buffers 2 #属性 indicator_color1 LimeGreen #属性 indicator_color2 DarkOrange #属性 indicator_width1 2 #属性 indicator_width2 2 2 #属性 indicator_minimum 0 #属性 indicator_maximum 1 extern int Ma1Period = 5; extern int Ma1Price = PRICE_CLOSE; extern int Ma1Method = MODE_EMA; extern int Ma1Shift = 0; 外置 int Ma2Period = 15; 外置 int Ma2Price = PRICE_CLOSE; 外部int Ma2Method = MODE_EMA; 外置int Ma2Shift = 0; 外置 int Ma3Period = 28; 外置 int Ma3Price = PRICE_CLOSE; 外部int Ma3Method = MODE_EMA; 外置int Ma3Shift = 0; 外置 int Ma4Period = 45; 外置 int Ma4Price = PRICE_CLOSE; 外置int Ma4Method = MODE_EMA; 外置int Ma4Shift = 0; // // // // // 双重histu[]。 double histd[]; //------------------------------------------------------------------ // //------------------------------------------------------------------ // // // // // int init() { SetIndexBuffer(0,histu); SetIndexStyle(0,DRAW_HISTOGRAM); SetIndexBuffer(1,histd); SetIndexStyle(1,DRAW_HISTOGRAM); return(0); } int deinit() { return(0); } //------------------------------------------------------------------ // //------------------------------------------------------------------ // // // // // int start() { int counted_bars = IndicatorCounted()。 如果(counted_bars < 0)返回(-1)。 如果(counted_bars > 0)counted_bars--。 int limit = MathMin(Bars-counted_bars,Bars-1); // // // // // for(int i = limit; i >=0; i--) { double ma1 = iMA(NULL,0,Ma1Period,Ma1Shift,Ma1Method,Ma1Price,i); double ma2 = iMA(NULL,0,Ma2Period,Ma2Shift,Ma2Method,Ma2Price,i); double ma3 = iMA(NULL,0,Ma3Period,Ma3Shift,Ma3Method,Ma3Price,i); double ma4 = iMA(NULL,0,Ma4Period,Ma4Shift,Ma4Method,Ma4Price,i); histu =EMPTY_VALUE; histd = EMPTY_VALUE; if(ma1=ma2 && ma2=ma3&& ma3>ma4) histu = 1; if(ma1=ma2 && ma2=ma3&& ma3<ma4) histd = 1; } return(0); } Moving Average 如何在两个均线之间填充颜色??? 均线多头或空头排列指标-请教高手 dhanu 2013.12.10 05:07 #1043 嗨 使用MA的Renko图表2min怎么样? 谢谢你的建议 Mladen Rakic 2013.12.10 07:44 #1044 person77:mladen谢谢你的建议。 我的编码几乎是无用的! 我把>和<改为=,但在编译时出现了一些错误。 我需要做什么不同的事情呢? //------------------------------------------------------------------ #property copyright "www.forex-tsd.com" #property link "www.forex-tsd.com" //------------------------------------------------------------------ #属性 indicator_separate_window #属性 indicator_buffers 2 #属性 indicator_color1 LimeGreen #属性 indicator_color2 DarkOrange #属性 indicator_width1 2 #属性 indicator_width2 2 2 #属性 indicator_minimum 0 #属性 indicator_maximum 1 extern int Ma1Period = 5; extern int Ma1Price = PRICE_CLOSE; extern int Ma1Method = MODE_EMA; extern int Ma1Shift = 0; 外置 int Ma2Period = 15; 外置 int Ma2Price = PRICE_CLOSE; 外部int Ma2Method = MODE_EMA; 外置int Ma2Shift = 0; 外置 int Ma3Period = 28; 外置 int Ma3Price = PRICE_CLOSE; 外部int Ma3Method = MODE_EMA; 外置int Ma3Shift = 0; 外置 int Ma4Period = 45; 外置 int Ma4Price = PRICE_CLOSE; 外置int Ma4Method = MODE_EMA; 外置int Ma4Shift = 0; // // // // // 双重histu[]。 double histd[]; //------------------------------------------------------------------ // //------------------------------------------------------------------ // // // // // int init() { SetIndexBuffer(0,histu); SetIndexStyle(0,DRAW_HISTOGRAM); SetIndexBuffer(1,histd); SetIndexStyle(1,DRAW_HISTOGRAM); return(0); } int deinit() { return(0); } //------------------------------------------------------------------ // //------------------------------------------------------------------ // // // // // int start() { int counted_bars = IndicatorCounted()。 如果(counted_bars < 0)返回(-1)。 如果(counted_bars > 0)counted_bars--。 int limit = MathMin(Bars-counted_bars,Bars-1); // // // // // for(int i = limit; i >=0; i--) { double ma1 = iMA(NULL,0,Ma1Period,Ma1Shift,Ma1Method,Ma1Price,i); double ma2 = iMA(NULL,0,Ma2Period,Ma2Shift,Ma2Method,Ma2Price,i); double ma3 = iMA(NULL,0,Ma3Period,Ma3Shift,Ma3Method,Ma3Price,i); double ma4 = iMA(NULL,0,Ma4Period,Ma4Shift,Ma4Method,Ma4Price,i); histu = EMPTY_VALUE; histd = EMPTY_VALUE; if(ma1=ma2 && ma2=ma3&& ma3>ma4) histu = 1; if(ma1=ma2 && ma2=ma3&& ma3<ma4) histd = 1; } 返回(0)。 } 人77 你应该用">="替换"<"(而不仅仅是"=")。 _____________________ PS:忘了告诉大家,2个MAs总是同步的 metrus 2013.12.10 09:17 #1045 那是完美的工作! 谢谢mladen。 tampa 2013.12.28 11:45 #1046 考夫曼自适应移动平均线 考夫曼自适应移动平均线(作者:Alexander Gettinger) 考夫曼自适应移动平均线(KAMA)是由佩里-考夫曼创造的,并在他的《更聪明的交易》(1995)一书中首次提出。 Formulas: KAMA = KAMA+sc*(价格-KAMA),其中sc = (er*0.6015+0.0645)*(er*0.6015+0.0645)。er = Abs(Price-Price)/Sum1。Sum1 = 从(i-Length+1)到i的Sum(Abs(Price-Price))。 附加的文件: kama.mq4 2 kb tampa 2014.01.02 14:20 #1047 线性回归 的两个版本(来自同一作者) 附加的文件: nt_trigger_lines_big_recoded.mq4 5 kb nt_trigger_lines_small_recoded.mq4 5 kb Mladen Rakic 2014.01.16 17:47 #1048 考夫曼AMA预过滤 为其他一些事情准备考夫曼AMA(自适应移动平均线),这里有一个版本,有一个非常简化的使用方法(现在ama计算被做成了一个函数)。它也可以有每个过滤的价格(而不是使用原始价格,可以使用过滤的价格(要打开过滤,将PriceFilter设置为1)。 附加的文件: kaufman.gif 36 kb kaufman_-_price_filtered_3.mq4 5 kb tampa 2014.02.27 20:32 #1049 MA28 (Alexander Gettinger著) 附加的文件: ma28.mq4 4 kb ma28.png 83 kb vito 2014.02.28 07:29 #1050 能否将该指标做成多时间框架? 谢谢 mladen: 为其他一些事情准备考夫曼AMA(自适应移动平均线),这里有一个版本,有一个非常简化的使用方法(ama计算现在被做成一个函数)。它也可以有每个过滤的价格(而不是使用原始价格,可以使用过滤的价格(要打开过滤,将PriceFilter设置为1)。 1...9899100101102103104105106107108109110111112...155 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
妙不可言--效果非常好,Mladen!非常感谢你。
如果不是太麻烦的话,我有几个要求。
1. 当4个MA都在同步时,价格回撤并触及一个指定的MA
(在这种情况下,第二条最短的MA,红色的15 EMA),我希望有一个箭头和警报产生。
然后我将改变到较小的1M时间框架,在那里寻找空头信号。
我插入水平线和垂直线,这样就很容易发现在较小的1M时间框架回测中要看的地方(A点)。
2. 我可以要求4ma同步indy只寻找两到三个ma的同步,以显示柱状图吗?(请看1米条件附件,了解我在这里要做的事情)
人77
恐怕这个指标的设计或预测不是为了显示价格触动。而且我很肯定,现在已经有很好的指标在做这种工作了。
至于2个和3个mas的版本:只需将代码中的""替换成 "if (ma1<ma2 && ma2<3" ... "等等,然后将2个mas设置为3个不同mas的相同值,或者将2对mas设置为相同的值,就可以让指标显示2个mas。
mladen
谢谢你的建议。
我的编码几乎是无用的!
我把>和<改成了=,但在编译时出现了一些错误。
我需要做什么不同的事情呢?
//------------------------------------------------------------------
#property copyright "www.forex-tsd.com"
#property link "www.forex-tsd.com"
//------------------------------------------------------------------
#属性 indicator_separate_window
#属性 indicator_buffers 2
#属性 indicator_color1 LimeGreen
#属性 indicator_color2 DarkOrange
#属性 indicator_width1 2
#属性 indicator_width2 2 2
#属性 indicator_minimum 0
#属性 indicator_maximum 1
extern int Ma1Period = 5;
extern int Ma1Price = PRICE_CLOSE;
extern int Ma1Method = MODE_EMA;
extern int Ma1Shift = 0;
外置 int Ma2Period = 15;
外置 int Ma2Price = PRICE_CLOSE;
外部int Ma2Method = MODE_EMA;
外置int Ma2Shift = 0;
外置 int Ma3Period = 28;
外置 int Ma3Price = PRICE_CLOSE;
外部int Ma3Method = MODE_EMA;
外置int Ma3Shift = 0;
外置 int Ma4Period = 45;
外置 int Ma4Price = PRICE_CLOSE;
外置int Ma4Method = MODE_EMA;
外置int Ma4Shift = 0;
//
//
//
//
//
双重histu[]。
double histd[];
//------------------------------------------------------------------
//
//------------------------------------------------------------------
//
//
//
//
//
int init()
{
SetIndexBuffer(0,histu); SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(1,histd); SetIndexStyle(1,DRAW_HISTOGRAM);
return(0);
}
int deinit() { return(0); }
//------------------------------------------------------------------
//
//------------------------------------------------------------------
//
//
//
//
//
int start()
{
int counted_bars = IndicatorCounted()。
如果(counted_bars < 0)返回(-1)。
如果(counted_bars > 0)counted_bars--。
int limit = MathMin(Bars-counted_bars,Bars-1);
//
//
//
//
//
for(int i = limit; i >=0; i--)
{
double ma1 = iMA(NULL,0,Ma1Period,Ma1Shift,Ma1Method,Ma1Price,i);
double ma2 = iMA(NULL,0,Ma2Period,Ma2Shift,Ma2Method,Ma2Price,i);
double ma3 = iMA(NULL,0,Ma3Period,Ma3Shift,Ma3Method,Ma3Price,i);
double ma4 = iMA(NULL,0,Ma4Period,Ma4Shift,Ma4Method,Ma4Price,i);
histu =EMPTY_VALUE;
histd = EMPTY_VALUE;
if(ma1=ma2 && ma2=ma3&& ma3>ma4) histu = 1;
if(ma1=ma2 && ma2=ma3&& ma3<ma4) histd = 1;
}
return(0);
}
嗨
使用MA的Renko图表2min怎么样?
谢谢你的建议
mladen
谢谢你的建议。
我的编码几乎是无用的!
我把>和<改为=,但在编译时出现了一些错误。
我需要做什么不同的事情呢?
//------------------------------------------------------------------
#property copyright "www.forex-tsd.com"
#property link "www.forex-tsd.com"
//------------------------------------------------------------------
#属性 indicator_separate_window
#属性 indicator_buffers 2
#属性 indicator_color1 LimeGreen
#属性 indicator_color2 DarkOrange
#属性 indicator_width1 2
#属性 indicator_width2 2 2
#属性 indicator_minimum 0
#属性 indicator_maximum 1
extern int Ma1Period = 5;
extern int Ma1Price = PRICE_CLOSE;
extern int Ma1Method = MODE_EMA;
extern int Ma1Shift = 0;
外置 int Ma2Period = 15;
外置 int Ma2Price = PRICE_CLOSE;
外部int Ma2Method = MODE_EMA;
外置int Ma2Shift = 0;
外置 int Ma3Period = 28;
外置 int Ma3Price = PRICE_CLOSE;
外部int Ma3Method = MODE_EMA;
外置int Ma3Shift = 0;
外置 int Ma4Period = 45;
外置 int Ma4Price = PRICE_CLOSE;
外置int Ma4Method = MODE_EMA;
外置int Ma4Shift = 0;
//
//
//
//
//
双重histu[]。
double histd[];
//------------------------------------------------------------------
//
//------------------------------------------------------------------
//
//
//
//
//
int init()
{
SetIndexBuffer(0,histu); SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(1,histd); SetIndexStyle(1,DRAW_HISTOGRAM);
return(0);
}
int deinit() { return(0); }
//------------------------------------------------------------------
//
//------------------------------------------------------------------
//
//
//
//
//
int start()
{
int counted_bars = IndicatorCounted()。
如果(counted_bars < 0)返回(-1)。
如果(counted_bars > 0)counted_bars--。
int limit = MathMin(Bars-counted_bars,Bars-1);
//
//
//
//
//
for(int i = limit; i >=0; i--)
{
double ma1 = iMA(NULL,0,Ma1Period,Ma1Shift,Ma1Method,Ma1Price,i);
double ma2 = iMA(NULL,0,Ma2Period,Ma2Shift,Ma2Method,Ma2Price,i);
double ma3 = iMA(NULL,0,Ma3Period,Ma3Shift,Ma3Method,Ma3Price,i);
double ma4 = iMA(NULL,0,Ma4Period,Ma4Shift,Ma4Method,Ma4Price,i);
histu = EMPTY_VALUE;
histd = EMPTY_VALUE;
if(ma1=ma2 && ma2=ma3&& ma3>ma4) histu = 1;
if(ma1=ma2 && ma2=ma3&& ma3<ma4) histd = 1;
}
返回(0)。
}人77
你应该用">="替换"<"(而不仅仅是"=")。
_____________________
PS:忘了告诉大家,2个MAs总是同步的
那是完美的工作!
谢谢mladen。
考夫曼自适应移动平均线
考夫曼自适应移动平均线(作者:Alexander Gettinger)
Formulas:
KAMA = KAMA+sc*(价格-KAMA),其中
sc = (er*0.6015+0.0645)*(er*0.6015+0.0645)。
er = Abs(Price-Price)/Sum1。
Sum1 = 从(i-Length+1)到i的Sum(Abs(Price-Price))。
线性回归 的两个版本(来自同一作者)
考夫曼AMA预过滤
为其他一些事情准备考夫曼AMA(自适应移动平均线),这里有一个版本,有一个非常简化的使用方法(现在ama计算被做成了一个函数)。它也可以有每个过滤的价格(而不是使用原始价格,可以使用过滤的价格(要打开过滤,将PriceFilter设置为1)。
MA28 (Alexander Gettinger著)
能否将该指标做成多时间框架? 谢谢![](https://c.mql5.com/forextsd/smiles/regular_smile.png)
为其他一些事情准备考夫曼AMA(自适应移动平均线),这里有一个版本,有一个非常简化的使用方法(ama计算现在被做成一个函数)。它也可以有每个过滤的价格(而不是使用原始价格,可以使用过滤的价格(要打开过滤,将PriceFilter设置为1)。