[警告关闭!]任何新手问题,为了不给论坛添乱。专业人士,不要走过。没有你,哪里都不能去。 - 页 1061 1...105410551056105710581059106010611062106310641065106610671068...1145 新评论 Павел 2010.12.20 16:28 #10601 晚上好。 有一个有趣的顾问 "Frank_ud",问题是--如何为阿尔帕里磨刀? --- 2010.12.20 17:31 #10602 volshebnik: 阿列克谢,你是对的。我检查了我的专家顾问--当MA周期=6 ...10 ......我的专家顾问在测试了一个月后挂掉了......。测试停止并挂起。 专家顾问根本无法打开交易。为什么测试器会挂起? 如果零除法 写在日志里,那就更容易了。 但这样一来,你就必须把版画放在每个区块中,并监测事件的进展。然后,在确定了悬停区之后,你必须对行数进行更具体的分析。 这可能是一个周期的问题。 LordSnake 2010.12.20 20:14 #10603 你能告诉我如何改变动量指标 的公式吗? --- 2010.12.20 20:16 #10604 把这个指标放在这里,我给你看。 LordSnake 2010.12.20 20:19 #10605 //| Momentum.mq4 | //| Copyright © 2004, MetaQuotes Software Corp. //| http://www.metaquotes.net/ | //+------------------------------------------------------------------+ #property copyright "Copyright © 2004, MetaQuotes Software Corp. #属性链接 "http://www.metaquotes.net/" #属性 indicator_separate_window #property indicator_buffers 1 #property indicator_color1 DodgerBlue //---- 输入参数 外置 int MomPeriod=14; //---- 缓冲区 双倍MomBuffer[]。 //+------------------------------------------------------------------+ //|自定义指标初始化功能 //+------------------------------------------------------------------+ int init() { string short_name; //---- 指标线 SetIndexStyle(0,DRAW_LINE)。 SetIndexBuffer(0,MomBuffer)。 //---- DataWindow和指标子窗口标签的名称 short_name="Mom("+MomPeriod+")"。 IndicatorShortName(short_name)。 SetIndexLabel(0,short_name)。 //---- SetIndexDrawBegin(0,MomPeriod)。 //---- return(0); } //+------------------------------------------------------------------+ //| 势头 | //+------------------------------------------------------------------+ int start() { int i,counted_bars=IndicatorCounted()。 //---- 如果(Bars<=MomPeriod)返回(0)。 //---- 初始零点 如果(counted_bars<1) for(i=1;i<=MomPeriod;i++) MomBuffer[Bars-i]=0.0。 //---- i=Bars-MomPeriod-1。 如果(counted_bars>=MomPeriod) i=Bars-counted_bars-1; while(i>=0) { MomBuffer[i]=Close[i]-Close[i+MomPeriod]。 i--; } return(0); } //+------------------------------------------------------------------+ [WARNING CLOSED!] Any newbie DEMARKER implementation!!! 任何菜鸟问题,为了不给论坛添乱。专业人士,不要路过。没有你就无处可去 - 6. --- 2010.12.20 20:22 #10606 好的,第二个问题。 究竟是什么在 LordSnake 2010.12.20 20:22 #10607 //| Momentum.mq4 | //| Copyright © 2004, MetaQuotes Software Corp. //| http://www.metaquotes.net/ | //+------------------------------------------------------------------+ #property copyright "Copyright © 2004, MetaQuotes Software Corp. #属性链接 "http://www.metaquotes.net/" #属性 indicator_separate_window #property indicator_buffers 1 #property indicator_color1 DodgerBlue //---- 输入参数 外置 int MomPeriod=14; //---- 缓冲区 双倍MomBuffer[]。 //+------------------------------------------------------------------+ //|自定义指标初始化功能 //+------------------------------------------------------------------+ int init() { string short_name; //---- 指标线 SetIndexStyle(0,DRAW_LINE)。 SetIndexBuffer(0,MomBuffer)。 //---- DataWindow和指标子窗口标签的名称 short_name="Mom("+MomPeriod+")"。 IndicatorShortName(short_name)。 SetIndexLabel(0,short_name)。 //---- SetIndexDrawBegin(0,MomPeriod)。 //---- return(0); } //+------------------------------------------------------------------+ //| 势头 | //+------------------------------------------------------------------+ int start() { int i,counted_bars=IndicatorCounted()。 //---- 如果(Bars<=MomPeriod)返回(0)。 //---- 初始零点 如果(counted_bars<1) for(i=1;i<=MomPeriod;i++) MomBuffer[Bars-i]=0.0。 //---- i=Bars-MomPeriod-1。 如果(counted_bars>=MomPeriod) i=Bars-counted_bars-1; while(i>=0) { MomBuffer[i]=Close[i]-Close[i+MomPeriod]。 i--; } return(0); } //+------------------------------------------------------------------+ [WARNING CLOSED!] Any newbie DEMARKER implementation!!! 任何菜鸟问题,为了不给论坛添乱。专业人士,不要路过。没有你就无处可去 - 6. --- 2010.12.20 20:24 #10608 在公式中到底需要改变什么? 也就是你想增加什么新的公式? PS。 你一定是不小心发布了两次指标 LordSnake 2010.12.20 20:28 #10609 对不起,我已经说到了最后一个问题。 这是原来的那个。 //| Momentum.mq4 | //| Copyright © 2004, MetaQuotes Software Corp. //| http://www.metaquotes.net/ | //+------------------------------------------------------------------+ #property copyright "Copyright © 2004, MetaQuotes Software Corp. #属性链接 "http://www.metaquotes.net/" #属性 indicator_separate_window #property indicator_buffers 1 #property indicator_color1 DodgerBlue //---- 输入参数 外置 int MomPeriod=14; //---- 缓冲区 双倍MomBuffer[]。 //+------------------------------------------------------------------+ //|自定义指标初始化功能 //+------------------------------------------------------------------+ int init() { string short_name; //---- 指标线 SetIndexStyle(0,DRAW_LINE)。 SetIndexBuffer(0,MomBuffer)。 //---- DataWindow和指标子窗口标签的名称 short_name="Mom("+MomPeriod+")"。 IndicatorShortName(short_name)。 SetIndexLabel(0,short_name)。 //---- SetIndexDrawBegin(0,MomPeriod)。 //---- return(0); } //+------------------------------------------------------------------+ //| 势头 | //+------------------------------------------------------------------+ int start() { int i,counted_bars=IndicatorCounted()。 //---- 如果(Bars<=MomPeriod)返回(0)。 //---- 初始零点 如果(counted_bars<1) for(i=1;i<=MomPeriod;i++) MomBuffer[Bars-i]=0.0。 //---- i=Bars-MomPeriod-1。 如果(counted_bars>=MomPeriod) i=Bars-counted_bars-1; while(i>=0) { MomBuffer[i]=Close[i]*100/Close[i+MomPeriod] 。 i--; } return(0); } //+------------------------------------------------------------------+ 在这个指标中,其公式为:。MOMENTUM = CLOSE (i) / CLOSE (i - n) * 100,而我需要 MOMENTUM = CLOSE (i) - CLOSE (i - n) [WARNING CLOSED!] Any newbie DEMARKER implementation!!! 谁想要一个战略?很多,而且是免费的) Andrey F. Zelinsky 2010.12.20 20:30 #10610 lordsnake: 对不起,我已经说到了最后一个问题。 这里是原文。 //| Momentum.mq4 | //| Copyright © 2004, MetaQuotes Software Corp. //| http://www.metaquotes.net/ | //+------------------------------------------------------------------+ #property copyright "Copyright © 2004, MetaQuotes Software Corp. #属性链接 "http://www.metaquotes.net/" #属性 indicator_separate_window #property indicator_buffers 1 #property indicator_color1 DodgerBlue //---- 输入参数 外置 int MomPeriod=14; //---- 缓冲区 双倍MomBuffer[]。 //+------------------------------------------------------------------+ //|自定义指标初始化功能 //+------------------------------------------------------------------+ int init() { string short_name; //---- 指标线 SetIndexStyle(0,DRAW_LINE)。 SetIndexBuffer(0,MomBuffer)。 //---- DataWindow和指标子窗口标签的名称 short_name="Mom("+MomPeriod+")"。 IndicatorShortName(short_name)。 SetIndexLabel(0,short_name)。 //---- SetIndexDrawBegin(0,MomPeriod)。 //---- return(0); } //+------------------------------------------------------------------+ //| 势头 | //+------------------------------------------------------------------+ int start() { int i,counted_bars=IndicatorCounted()。 //---- 如果(Bars<=MomPeriod)返回(0)。 //---- 初始零点 如果(counted_bars<1) for(i=1;i<=MomPeriod;i++) MomBuffer[Bars-i]=0.0。 //---- i=Bars-MomPeriod-1。 如果(counted_bars>=MomPeriod) i=Bars-counted_bars-1; while(i>=0) { MomBuffer[i]=Close[i]*100/Close[i+MomPeriod]; // this MomBuffer[i]=Close[i]- Close[i+MomPeriod]; //改成这样 i--; } return(0); } //+------------------------------------------------------------------+ 在这个指标中,该公式。MOMENTUM = CLOSE (i) / CLOSE (i - n) * 100,但我需要 MOMENTUM = CLOSE (i) - CLOSE (i - n) 1...105410551056105710581059106010611062106310641065106610671068...1145 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
晚上好。
有一个有趣的顾问 "Frank_ud",问题是--如何为阿尔帕里磨刀?
阿列克谢,你是对的。我检查了我的专家顾问--当MA周期=6 ...10 ......我的专家顾问在测试了一个月后挂掉了......。测试停止并挂起。 专家顾问根本无法打开交易。为什么测试器会挂起?
如果零除法 写在日志里,那就更容易了。
但这样一来,你就必须把版画放在每个区块中,并监测事件的进展。然后,在确定了悬停区之后,你必须对行数进行更具体的分析。
这可能是一个周期的问题。
你能告诉我如何改变动量指标 的公式吗?
//| Copyright © 2004, MetaQuotes Software Corp.
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp.
#属性链接 "http://www.metaquotes.net/"
#属性 indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 DodgerBlue
//---- 输入参数
外置 int MomPeriod=14;
//---- 缓冲区
双倍MomBuffer[]。
//+------------------------------------------------------------------+
//|自定义指标初始化功能
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- 指标线
SetIndexStyle(0,DRAW_LINE)。
SetIndexBuffer(0,MomBuffer)。
//---- DataWindow和指标子窗口标签的名称
short_name="Mom("+MomPeriod+")"。
IndicatorShortName(short_name)。
SetIndexLabel(0,short_name)。
//----
SetIndexDrawBegin(0,MomPeriod)。
//----
return(0);
}
//+------------------------------------------------------------------+
//| 势头 |
//+------------------------------------------------------------------+
int start()
{
int i,counted_bars=IndicatorCounted()。
//----
如果(Bars<=MomPeriod)返回(0)。
//---- 初始零点
如果(counted_bars<1)
for(i=1;i<=MomPeriod;i++) MomBuffer[Bars-i]=0.0。
//----
i=Bars-MomPeriod-1。
如果(counted_bars>=MomPeriod) i=Bars-counted_bars-1;
while(i>=0)
{
MomBuffer[i]=Close[i]-Close[i+MomPeriod]。
i--;
}
return(0);
}
//+------------------------------------------------------------------+
好的,第二个问题。
究竟是什么在
//| Copyright © 2004, MetaQuotes Software Corp.
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp.
#属性链接 "http://www.metaquotes.net/"
#属性 indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 DodgerBlue
//---- 输入参数
外置 int MomPeriod=14;
//---- 缓冲区
双倍MomBuffer[]。
//+------------------------------------------------------------------+
//|自定义指标初始化功能
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- 指标线
SetIndexStyle(0,DRAW_LINE)。
SetIndexBuffer(0,MomBuffer)。
//---- DataWindow和指标子窗口标签的名称
short_name="Mom("+MomPeriod+")"。
IndicatorShortName(short_name)。
SetIndexLabel(0,short_name)。
//----
SetIndexDrawBegin(0,MomPeriod)。
//----
return(0);
}
//+------------------------------------------------------------------+
//| 势头 |
//+------------------------------------------------------------------+
int start()
{
int i,counted_bars=IndicatorCounted()。
//----
如果(Bars<=MomPeriod)返回(0)。
//---- 初始零点
如果(counted_bars<1)
for(i=1;i<=MomPeriod;i++) MomBuffer[Bars-i]=0.0。
//----
i=Bars-MomPeriod-1。
如果(counted_bars>=MomPeriod) i=Bars-counted_bars-1;
while(i>=0)
{
MomBuffer[i]=Close[i]-Close[i+MomPeriod]。
i--;
}
return(0);
}
//+------------------------------------------------------------------+
在公式中到底需要改变什么? 也就是你想增加什么新的公式?
PS。
你一定是不小心发布了两次指标
对不起,我已经说到了最后一个问题。
这是原来的那个。
//| Momentum.mq4 |//| Copyright © 2004, MetaQuotes Software Corp.
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp.
#属性链接 "http://www.metaquotes.net/"
#属性 indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 DodgerBlue
//---- 输入参数
外置 int MomPeriod=14;
//---- 缓冲区
双倍MomBuffer[]。
//+------------------------------------------------------------------+
//|自定义指标初始化功能
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- 指标线
SetIndexStyle(0,DRAW_LINE)。
SetIndexBuffer(0,MomBuffer)。
//---- DataWindow和指标子窗口标签的名称
short_name="Mom("+MomPeriod+")"。
IndicatorShortName(short_name)。
SetIndexLabel(0,short_name)。
//----
SetIndexDrawBegin(0,MomPeriod)。
//----
return(0);
}
//+------------------------------------------------------------------+
//| 势头 |
//+------------------------------------------------------------------+
int start()
{
int i,counted_bars=IndicatorCounted()。
//----
如果(Bars<=MomPeriod)返回(0)。
//---- 初始零点
如果(counted_bars<1)
for(i=1;i<=MomPeriod;i++) MomBuffer[Bars-i]=0.0。
//----
i=Bars-MomPeriod-1。
如果(counted_bars>=MomPeriod) i=Bars-counted_bars-1;
while(i>=0)
{
MomBuffer[i]=Close[i]*100/Close[i+MomPeriod] 。
i--;
}
return(0);
}
//+------------------------------------------------------------------+
在这个指标中,其公式为:。MOMENTUM = CLOSE (i) / CLOSE (i - n) * 100,而我需要
MOMENTUM = CLOSE (i) - CLOSE (i - n)对不起,我已经说到了最后一个问题。
这里是原文。
//| Momentum.mq4 |
MomBuffer[i]=Close[i]- Close[i+MomPeriod]; //改成这样//| Copyright © 2004, MetaQuotes Software Corp.
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp.
#属性链接 "http://www.metaquotes.net/"
#属性 indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 DodgerBlue
//---- 输入参数
外置 int MomPeriod=14;
//---- 缓冲区
双倍MomBuffer[]。
//+------------------------------------------------------------------+
//|自定义指标初始化功能
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- 指标线
SetIndexStyle(0,DRAW_LINE)。
SetIndexBuffer(0,MomBuffer)。
//---- DataWindow和指标子窗口标签的名称
short_name="Mom("+MomPeriod+")"。
IndicatorShortName(short_name)。
SetIndexLabel(0,short_name)。
//----
SetIndexDrawBegin(0,MomPeriod)。
//----
return(0);
}
//+------------------------------------------------------------------+
//| 势头 |
//+------------------------------------------------------------------+
int start()
{
int i,counted_bars=IndicatorCounted()。
//----
如果(Bars<=MomPeriod)返回(0)。
//---- 初始零点
如果(counted_bars<1)
for(i=1;i<=MomPeriod;i++) MomBuffer[Bars-i]=0.0。
//----
i=Bars-MomPeriod-1。
如果(counted_bars>=MomPeriod) i=Bars-counted_bars-1;
while(i>=0)
{
MomBuffer[i]=Close[i]*100/Close[i+MomPeriod]; // this
i--;
}
return(0);
}
//+------------------------------------------------------------------+
在这个指标中,该公式。MOMENTUM = CLOSE (i) / CLOSE (i - n) * 100,但我需要
MOMENTUM = CLOSE (i) - CLOSE (i - n)