//+-------------StoreHighsAndLows Function----support and resistance arrays------thanks to Robert C for assistance on this-------+
//+-------creates array of each trade series support and resistance for signal profile matching-------------------+
void StoreHighsAndLows(double HIGH, double LOW)
{
if ( SLIndex >= SLSIZE )
{
SLIndex = 0;
}
sLocatorLows[ SLIndex ] = LOW;
sLocatorHighs[ SLIndex ] = HIGH;
SLIndex++;
}
//+-----------------------end of StoreHighsAndLows------------------------------------+
//+--------------- Get past equity function---------Thanks Robert C.-----------+
// This returns past equity from the global equity array. The howFarBack parameter is a positive integer that indicates how far back into the array to go
// 1 would be the previous equity, 2 would be the equity before that, etc.
// the HowFarBack should not be greater than the arraysize
double GetPastEquity(int HowFarBack)
{
if ( HowFarBack > EquityValuesStored )
{
Print("Error getting past equity, Looking back farther than what we have stored");
return (-1);
}
else
{
int PastIndex = EquityIndex - HowFarBack;
if ( PastIndex < 0 )
{
PastIndex += StoredEquitySIZE;
}
return (EQUITY[PastIndex]);
}
}
//+--end of get past equity function-----------+
//+---Stores account Equity value in an array for future comparisions up to as many previous trades as the declared size of the array----thanks Robert C.----+
void StoreAccountEquity(double equity)
{
if ( EquityIndex >= StoredEquitySIZE )
{
EquityIndex = 0;
}
EQUITY[EquityIndex] = equity;
EquityIndex++;
if ( EquityValuesStored < StoredEquitySIZE )
{
EquityValuesStored++;
}
}
//+-------end of Store Equity function-------------------+
//+---------count open trades function-------ty Maji--------------------------+
//+-------------StoreHighsAndLows Function----support and resistance arrays------thanks to Robert C for assistance on this-------+
//+-------creates array of each trade series support and resistance for signal profile matching-------------------+
void StoreHighsAndLows(double HIGH, double LOW)
{
if ( SLIndex >= SLSIZE )
{
SLIndex = 0;
}
sLocatorLows[ SLIndex ] = LOW;
sLocatorHighs[ SLIndex ] = HIGH;
SLIndex++;
}
//+-----------------------end of StoreHighsAndLows------------------------------------+
//+--------------- Get past equity function---------Thanks Robert C.-----------+
// This returns past equity from the global equity array. The howFarBack parameter is a positive integer that indicates how far back into the array to go
// 1 would be the previous equity, 2 would be the equity before that, etc.
// the HowFarBack should not be greater than the arraysize
double GetPastEquity(int HowFarBack)
{
if ( HowFarBack > EquityValuesStored )
{
Print("Error getting past equity, Looking back farther than what we have stored");
return (-1);
}
else
{
int PastIndex = EquityIndex - HowFarBack;
if ( PastIndex < 0 )
{
PastIndex += StoredEquitySIZE;
}
return (EQUITY[PastIndex]);
}
}
//+--end of get past equity function-----------+
//+---Stores account Equity value in an array for future comparisions up to as many previous trades as the declared size of the array----thanks Robert C.----+
void StoreAccountEquity(double equity)
{
if ( EquityIndex >= StoredEquitySIZE )
{
EquityIndex = 0;
}
EQUITY[EquityIndex] = equity;
EquityIndex++;
if ( EquityValuesStored < StoredEquitySIZE )
{
EquityValuesStored++;
}
}
//+-------end of Store Equity function-------------------+
//+---------count open trades function-------ty Maji--------------------------+
希望有人能在这里找到谜底......
如果你把这段代码放在include .mqh文件中,这个帖子有运行GGL3所需的一切。我压缩了.htm报告,因为它们都超过了4MB,因为所有的修改订单......
看来我重新设计的追踪止损功能 将性能从120万提高到130万......或者是由于从初始存款1000元而不是500元开始的结果。我不知道是哪种情况,因为GGL3不会从500的初始存款开始,也不会开启任何交易。
遗憾的是,尽管在这方面似乎取得了进展,但仍有一些尚未披露的东西使其无法持续赚大钱。更多的时候,它失败了,破产了。如果不是跟踪止损造成的,那么一定是其他原因......我不知道是什么......。
看来,谁能搞清楚是什么原因导致同一EA在同一时间范围内的相同设置产生如此大的结果差异,并加以纠正,谁就能获得大量的回报和一些大笔资金。这让我目前陷入了困境。
我将休假一周......希望在我回来的时候有人能发表一些见解或解决方案。我不知道在揭开这个谜底之前,我怎么能真正继续进行更多的开发。
//| GGLrewrite.mqh |
//| In no event will author be liable for any damages whatsoever. |
//| Use at your own risk. |
//| |
//| Please do not remove this header. |
//+------------------------------------------------------------------+
#property copyright "Aaragorn and Eaglehawk & Maji & Robert C."
#property link "http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/"
#property link "http://forex.factoid.ca/forums/showthread.php?t=104"
#property link "https://www.forex-tsd.com/expert-advisors-metatrader-4/2840-gogetter-ea.html"
// many thanks goes to all those on the tsdforex forum and factoid forum who have encouraged us this far
//+------------------------------------------------------------------+
//| defines |
//+------------------------------------------------------------------+
//+-----------Store HIGH, LOW matching data------+
#define SLSIZE 15
static int SLIndex = 0;
static double sLocatorLows[ SLSIZE ] = { 0 };
static double sLocatorHighs[ SLSIZE ] = { 0 };
//+-----------Stored equity data-----------------+
#define StoredEquitySIZE 5
static int EquityIndex = 0;
static double EQUITY[ StoredEquitySIZE ] = { 0 };
static int EquityValuesStored = 0;
//+-----------close based on time----------------+
extern string Time_Settings="Time In Trade Settings";
extern int MonitorInMinutes = 60; // minutes after open to check state of trade
extern int ThresholdMove = 1; // if after that time we don't have +'x' pips we will exit
extern int MinsMultiplier = 75; // multiplies the MonitorInMinutes to make minutes (if 'x'=60) into hours
//+------------------------------------------------------------------+
//| Commonly used GoGetter Functions | |
//+------------------------------------------------------------------+
//+-------------StoreHighsAndLows Function----support and resistance arrays------thanks to Robert C for assistance on this-------+
//+-------creates array of each trade series support and resistance for signal profile matching-------------------+
void StoreHighsAndLows(double HIGH, double LOW)
{
if ( SLIndex >= SLSIZE )
{
SLIndex = 0;
}
sLocatorLows[ SLIndex ] = LOW;
sLocatorHighs[ SLIndex ] = HIGH;
SLIndex++;
}
//+-----------------------end of StoreHighsAndLows------------------------------------+
//+--------------- Get past equity function---------Thanks Robert C.-----------+
// This returns past equity from the global equity array. The howFarBack parameter is a positive integer that indicates how far back into the array to go
// 1 would be the previous equity, 2 would be the equity before that, etc.
// the HowFarBack should not be greater than the arraysize
double GetPastEquity(int HowFarBack)
{
if ( HowFarBack > EquityValuesStored )
{
Print("Error getting past equity, Looking back farther than what we have stored");
return (-1);
}
else
{
int PastIndex = EquityIndex - HowFarBack;
if ( PastIndex < 0 )
{
PastIndex += StoredEquitySIZE;
}
return (EQUITY[PastIndex]);
}
}
//+--end of get past equity function-----------+
//+---Stores account Equity value in an array for future comparisions up to as many previous trades as the declared size of the array----thanks Robert C.----+
void StoreAccountEquity(double equity)
{
if ( EquityIndex >= StoredEquitySIZE )
{
EquityIndex = 0;
}
EQUITY[EquityIndex] = equity;
EquityIndex++;
if ( EquityValuesStored < StoredEquitySIZE )
{
EquityValuesStored++;
}
}
//+-------end of Store Equity function-------------------+
//+---------count open trades function-------ty Maji--------------------------+
int CountTrades()
{
int count=0;
int trade;
for(trade=OrdersTotal()-1;trade>=0;trade--)
{
OrderSelect(trade,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()!=Symbol()&&OrderMagicNumber()!=MagicNumber)
continue;
if(OrderSymbol()==Symbol()&&OrderMagicNumber()==MagicNumber)
if((OrderType()==OP_SELL) || (OrderType()==OP_BUY))
count++;
}//for
return(count);
}
//+-----------end of count trades-------------------------------------+
//+---------------------Close Based on Time function------------Thanks to 'Maji' for this-------------------+
void CloseOrder()
{
double Profit=ThresholdMove*Point;
int total = CountTrades();
for (int cnt = 0 ; cnt < total ; cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if ((CurTime()-OrderOpenTime())>MonitorInMinutes*60*MinsMultiplier)
{
LowTrailingStopTrigger = False;
if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && Bid-Profit<OrderOpenPrice() )
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet);
}
if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && Bid+Profit>OrderOpenPrice())
{
OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet);
}
}
}
}
//+---------------------------end of close on time code---------------+
//+------------------------increase lots function-------------------------+
//+----------------increases lots based on account equity-----------------+
//double IncreaseLots()
//{
// Lots = NormalizeDouble(AccountFreeMargin()/(LotIncreaseFactor*1000/0.1),2);
// if(Lots > 99) Lots = 99;
// Print("account free margin = ",AccountFreeMargin()," Lots = ",Lots);
// return(Lots)
//}这里是压缩的包含文件,如果这样更容易管理的话。
我现在问的问题是:....
数据流是否稳定?我假设它是稳定的,因为它使用了历史中心的文件....,也许这个假设应该被质疑?
该平台处理数据流的方式是否稳定,是否可以依靠它每次都以完全相同的方式处理相同的数据?如果不是,这个平台是谁做的?我如何与他们联系?是什么东西需要修复以使其可靠?
如果这两个未知数中的任何一个仍然是潜在的变量,事实上是不可靠的,那么我似乎不可能稳定EA代码。如何验证它们的可靠性?
我已经在这个页面上发布了一个请求,希望大家关注这个问题......
http://www.metaquotes.net/index.php?bugtrack/
让我们希望有人能有一些见解并尽快回复。
我现在问的问题是:....
数据流是否稳定?我假设它是稳定的,因为它使用了历史中心的文件....,也许这个假设应该被质疑?
该平台处理数据流的方式是否稳定,是否可以依靠它每次都以完全相同的方式处理相同的数据?如果不是,这个平台是谁做的?我如何与他们联系?是什么东西需要修复以使其可靠?
如果这两个未知数中的任何一个仍然是潜在的变量,事实上是不可靠的,那么我似乎不可能稳定EA代码。如何验证它们的可靠性?
我已经在这个页面上发布了一个请求,希望大家关注这个问题......
http://www.metaquotes.net/index.php?bugtrack/
让我们希望有人能有一些见解,并尽快回复。.... 你有没有尝试在多个平台上进行前瞻性测试?我目前正在两个不同的BD平台上测试同一个EA,看看我将得到什么样的结果。我想确保在我进行实战之前,结果会有相当数量的固定数据。也许这是一个愚蠢的想法,但在我有一个相当肯定的想法,Ea将有一个稳定的性能之前,我不想冒真正的资本。
我只在metatrader 4上使用30tf对GPBUSD进行了测试。不是因为这样做不是个好主意,而是因为我只是个普通人,而且因为我不是女性,我也不善于处理多任务。所以我只是还没来得及做而已。我还没有做任何其他测试。我一直专注于开发问题。我的目标是在尝试扩展到其他对或其他平台或其他什么之前,先让它在这一个实例中稳定下来。
通过各种方式使用你的常识。下周我不在的时候,我将允许它在我的模拟账户 中运行。因为我们明天就要离开了,这一周我很可能要到下周二才会回到这个话题上。
我认为还不适合用真金白银去冒险,我只想看到不稳定的问题得到解决,然后在模拟中进行测试。然后我再看看数据告诉我该怎么做。我真的想邀请特别是开发人员在我不在的时候仔细检查一下,看看数据处理或数据文件的不正常情况是否可以得到验证。
我没有看到代码有什么明显的错误,可以说明这种差异。我以前也曾出过错,我也可能错了。如果有人能告诉我如何或在哪里纠正它,我就可以接受错误。
我不会对你撒谎,我很高兴能离开这个问题一段时间。它消耗了我太多的注意力,我应该在工作中寻求一些生活的平衡。
我把这个问题交给你们处理一段时间,看看你们能做什么。我只要求,如果你对它做任何研究,请将你的结果反馈给这个主题,以便大家都能从中受益。
...........
你能不能把长短句子放在一个mp4文件里?
为什么同样的设置却有如此不同的报告?
使用附件中的EA和附件中的include.mqh文件。我使用这些设置运行一个策略测试....
专家属性按钮....
测试标签...
1000美元的初始存款...
仓位。多头和空头
优化的参数。余额
遗传算法框未被选中
输入标签...
所有的用户输入都是完全按照EA中保存的方式使用的,不需要手动修改这个标签。
优化选项卡...
此选项卡中没有任何东西被选中
设置.....
专家顾问。GGL3, Aaragorn and Eaglehawk & Maji & Robert C.
符号。GBPUSD, 英镑对美元
期间。M30
模型。每个tick(基于所有可用的leasttimeframes和每个tick的分形内插)。
我使用的是附件中的1分钟数据文件。
使用日期框被选中;从。2005.09.09 到。今天 (2006.08.22)
我勾选了重新计算的方框
我没有勾选优化的方框
测试结束后,我得到这个报告...
**************************************************
测试中的条数 17735
模拟的点数为702859
建模质量89.82%。
初始存款1000.00
总净利润 1375788.66
毛利润 3678568.71
毛亏损 -2302780.05
利润系数 1.60
预期回报率 472.62
绝对缩水 240.00
最大跌幅 231662.10 (15.07%)
相对跌幅 55.32% (18074.74)
交易总数 2911
空头头寸(韩元%) 0 (0.00%)
多头头寸(韩元%) 2911 (42.05%)
盈利交易(占总数的百分比) 1224 (42.05%)
亏损交易(占总数的百分比) 1687 (57.95%)
最大的
盈利交易 89100.00
亏损交易 -15840.00
平均数
盈利交易 3005.37
亏损交易 -1365.01
最多
连续赢钱(以金钱计算的利润) 9 (106921.10)
连续亏损(金钱损失) 18 (-163.10)
最大的
连续盈利(赢钱的次数) 225720.50 (7)
连续亏损(亏损数) -15845.70 (5)
平均数
连续赢钱 2
连续亏损 2
****************************************************
现在我在想这是一个非常好的EA,所以我想再次测试它,以确保它做同样的事情....
我没有对设置做任何修改....
我在设置选项卡上选择了重新计算框,然后点击开始....,现在我得到了这个报告......
******************************************************
测试中的条数 18015
模拟的点数 739231
建模质量89.83%。
初始存款1000.00
总净利润 -731.75
毛利润 31897.83
毛亏损 -32629.58
利润系数 0.98
预期回报率 -0.24
绝对平仓780.40
最大跌幅 4912.15 (94.91%)
相对跌幅 94.91% (4912.15)
交易总数 2990
空头头寸(韩元%) 0 (0.00%)
多头头寸(韩元%) 2990 (34.88%)
盈利交易(占总数的百分比) 1043 (34.88%)
亏损交易(占总数的百分比) 1947 (65.12%)
最大的
盈利交易 1170.00
亏损交易 -360.00
平均数
盈利交易 30.58
亏损交易 -16.76
最多
连胜(盈利) 8 (124.50)
连续亏损(金钱上的损失) 20 (-45.50)
最大的
连续盈利(赢钱的次数)2606.30 (7)
连续亏损(亏损数) -360.00 (1)
平均数
连续赢钱 2
连续亏损 3
******************************************************
为什么这两个测试如此不同?
当它第二次测试EA的时候,测试做得有什么不同?
我怎样才能使测试器在每次重新计算时都进行相同的测试?
谢谢你的指导,让我每次测试这个EA时都能得到相同的报告。
Aaragorn
//+------------------------------------------------------------------+
//| GoGetterfunctions.mqh |
//| In no event will author be liable for any damages whatsoever. |
//| Use at your own risk. |
//| |
//| Please do not remove this header. |
//+------------------------------------------------------------------+
#property copyright "Aaragorn and Eaglehawk & Maji & Robert C."
#property link "http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/"
#property link "http://forex.factoid.ca/forums/showthread.php?t=104"
#property link "https://www.forex-tsd.com/expert-advisors-metatrader-4/2840-gogetter-ea.html"
// many thanks goes to all those on the tsdforex forum and factoid forum who have encouraged us this far
//+------------------------------------------------------------------+
//| defines |
//+------------------------------------------------------------------+
//+-----------Store HIGH, LOW matching data------+
#define SLSIZE 15
static int SLIndex = 0;
static double sLocatorLows[ SLSIZE ] = { 0 };
static double sLocatorHighs[ SLSIZE ] = { 0 };
//+-----------Stored equity data-----------------+
#define StoredEquitySIZE 5
static int EquityIndex = 0;
static double EQUITY[ StoredEquitySIZE ] = { 0 };
static int EquityValuesStored = 0;
//+-----------close based on time----------------+
extern string Time_Settings="Time In Trade Settings";
extern int MonitorInMinutes = 60; // minutes after open to check state of trade
extern int ThresholdMove = 1; // if after that time we don't have +'x' pips we will exit
extern int MinsMultiplier = 75; // multiplies the MonitorInMinutes to make minutes (if 'x'=60) into hours
//+------------------------------------------------------------------+
//| Commonly used GoGetter Functions | |
//+------------------------------------------------------------------+
//+-------------StoreHighsAndLows Function----support and resistance arrays------thanks to Robert C for assistance on this-------+
//+-------creates array of each trade series support and resistance for signal profile matching-------------------+
void StoreHighsAndLows(double HIGH, double LOW)
{
if ( SLIndex >= SLSIZE )
{
SLIndex = 0;
}
sLocatorLows[ SLIndex ] = LOW;
sLocatorHighs[ SLIndex ] = HIGH;
SLIndex++;
}
//+-----------------------end of StoreHighsAndLows------------------------------------+
//+--------------- Get past equity function---------Thanks Robert C.-----------+
// This returns past equity from the global equity array. The howFarBack parameter is a positive integer that indicates how far back into the array to go
// 1 would be the previous equity, 2 would be the equity before that, etc.
// the HowFarBack should not be greater than the arraysize
double GetPastEquity(int HowFarBack)
{
if ( HowFarBack > EquityValuesStored )
{
Print("Error getting past equity, Looking back farther than what we have stored");
return (-1);
}
else
{
int PastIndex = EquityIndex - HowFarBack;
if ( PastIndex < 0 )
{
PastIndex += StoredEquitySIZE;
}
return (EQUITY[PastIndex]);
}
}
//+--end of get past equity function-----------+
//+---Stores account Equity value in an array for future comparisions up to as many previous trades as the declared size of the array----thanks Robert C.----+
void StoreAccountEquity(double equity)
{
if ( EquityIndex >= StoredEquitySIZE )
{
EquityIndex = 0;
}
EQUITY[EquityIndex] = equity;
EquityIndex++;
if ( EquityValuesStored < StoredEquitySIZE )
{
EquityValuesStored++;
}
}
//+-------end of Store Equity function-------------------+
//+---------count open trades function-------ty Maji--------------------------+
int CountTrades()
{
int count=0;
int trade;
for(trade=OrdersTotal()-1;trade>=0;trade--)
{
OrderSelect(trade,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()!=Symbol()&&OrderMagicNumber()!=MagicNumber)
continue;
if(OrderSymbol()==Symbol()&&OrderMagicNumber()==MagicNumber)
if((OrderType()==OP_SELL) || (OrderType()==OP_BUY))
count++;
}//for
return(count);
}
//+-----------end of count trades-------------------------------------+
//+---------------------Close Based on Time function------------Thanks to 'Maji' for this-------------------+
void CloseOrder()
{
double Profit=ThresholdMove*Point;
int total = CountTrades();
for (int cnt = 0 ; cnt < total ; cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if ((CurTime()-OrderOpenTime())>MonitorInMinutes*60*MinsMultiplier)
{
LowTrailingStopTrigger = False;
if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && Bid-Profit<OrderOpenPrice() )
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet);
}
if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && Bid+Profit>OrderOpenPrice())
{
OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet);
}
}
}
}
//+---------------------------end of close on time code---------------+
//+------------------------increase lots function-------------------------+
//+----------------increases lots based on account equity-----------------+
//double IncreaseLots()
//{
// Lots = NormalizeDouble(AccountFreeMargin()/(LotIncreaseFactor*1000/0.1),2);
// if(Lots > 99) Lots = 99;
// Print("account free margin = ",AccountFreeMargin()," Lots = ",Lots);
// return(Lots)
//}
***************************end of include .mqh file******************************...我想帮助你进行测试,但由于某些原因,我不能把它附在图表上......想不明白为什么。
......我想帮助你进行测试,但由于某些原因,我不能把它附在图表上......搞不清楚为什么。
试着编译它。 你还需要在专家文件夹里有mqh文件才能工作。
试着编译它。 你还需要将mqh文件放在专家文件夹中,这样才能发挥作用。
实际上,mqh文件需要放在 "include "文件夹中,它是 "experts "文件夹的一个子文件夹。至少我是这样做的。
我在附加文件方面没有问题,我只是在让策略测试器 与之保持一致方面有问题。