//+-------------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レポートをzip圧縮しました、なぜなら全ての変更された注文のために両方とも4MBを超えるからです。
トレーリングストップ機能の 再設計により、120万から130万にパフォーマンスが向上したようです。GGL3は初期預金500では起動せず、取引も開始されないので、どちらかわかりません。![](https://c.mql5.com/forextsd/smiles/confused_smile.png)
悲しいことに、これに関する進歩のように見えるにもかかわらず、これが一貫して大金を作ることから保つまだ何か明らかにされていないままであることを報告する。もっと頻繁にそれは失敗し、倒産する。もし、トレーリングストップが原因でないなら、何か他の原因があるはずです...。
同じ時間帯に同じ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)
//}インクルードファイルはzip圧縮されています。
今、私が質問しているのは......。
データストリームは安定しているのでしょうか?履歴センターのファイルを使用しているので、そうだと思うのですが......おそらくその仮定は覆されるはずです。
このプラットフォームがデータストリームを処理する方法は安定していて、同じデータを毎回まったく同じように処理することができるのか?もしそうでなければ、誰がこのプラットフォームを作ったのでしょうか?
もし、この2つの未知数のどちらかが潜在的に可変であり、実際に信頼できないのであれば、EAコードを安定化させることはできそうにありません。その信頼性はどのようにして確認できるのでしょうか?
この質問については、このページで注意を促しているのですが...。
http://www.metaquotes.net/index.php?bugtrack/
早く誰か洞察して返信してくれることを期待します。
今、私が質問していることは....
データストリームは安定しているのでしょうか?履歴センターのファイルを使用しているからだと思いますが、その前提は覆されるべきでしょうか。
このプラットフォームがデータストリームを処理する方法は安定していて、同じデータを毎回まったく同じように処理することができるでしょうか?もしそうでなければ、誰がこのプラットフォームを作ったのでしょうか?
もし、この2つの未知数のどちらかがまだ潜在的に可変であり、実際に信頼できないのであれば、EAコードを安定化させることはできそうにないです。その信頼性はどのようにして確認できるのでしょうか?
この質問については、このページで注意喚起のお願いをしました...。
http://www.metaquotes.net/index.php?bugtrack/
どなたか、早くお分かりになり、お返事いただけるといいのですが。私は現在、同じEAを2つの異なるBDプラットフォームでテストし、どのような結果が得られるかを確認しています。それは愚かな考えかもしれませんが、EAが一貫した性能を持つというかなり確かな考えを持つまでは、実際の資金を危険にさらしたくありません。![](https://c.mql5.com/forextsd/smiles/rolleyes2.png)
メタトレーダー4ではGPBUSDの30tfを使ってしかテストしていません。それは、そうすることが良いアイデアでないからではなく、私は人間であり、女性ではないので、マルチタスクもうまくできないからです。だから、単にまだ手をつけていないだけなのです。他のテストもまだしていません。開発のほうに専念しています。私の目標は、他のペアや他のプラットフォームに展開する前に、この1つの事例で安定させることでした。
ぜひ、常識的な範囲で考えてみてください。来週、私が不在の間、私のデモ口座 でこれを実行することを許可します。私たちは明日出発し、週のために消えているので、私は次の火曜日まで、最も可能性の高いスレッドに戻ることはありません。
私はまだ実際のお金を賭けるのに適しているかどうか判断していません......私はただ不安定さが解決されるのを見たいし、その後デモでフォワードテストします。それから、データからどこまで行けるかを見ます。私が不在の間に、特に開発者の方々に精査していただき、データ処理やデータファイルの異常が確認できないか、ぜひともお願いしたいのです。
私は、この差異を説明するような明らかに間違ったコードを見たことがありません。私は以前にも間違っていたことがある......それも間違っているかもしれない。もし誰かがそれを修正する方法や場所を教えてくれるなら、私は間違っていても構わない。
正直に言うと、私はしばらくこの問題から離れることができます。この問題に取り組む間、私は生活のバランスを取る必要があるのです。
しばらくは皆さんにこれをお任せして、何ができるか見てみたいと思います。ただ、もしあなたがこのことについて何か研究したなら、その結果をこのスレッドに報告して、みんながそこから利益を得られるようにしてほしい。
...........
短編と長編を1つのmp4ファイルにまとめてもらえませんか?
同じ設定なのになぜこんなにレポートが違うのでしょうか?
添付のEAを添付のinclude.mqhファイルで使用しています。以下の設定でストラテジーテストを実行しました。
Expert Properties ボタン....
Testngタブ...
1000 USDの初期預金....
ポジションロングとショート
最適化されたパラメータ:バランス
遺伝的アルゴリズムボックスがチェックされていない
入力タブ...
すべてのユーザー入力は、EAに保存されたとおりに使用され、このタブに手動で変更を加えることはありません。
最適化タブ...
このタブでは何もチェックされていません
設定......
Expert Advisorです。GGL3、AaragornとEaglehawk&Maji&Robert C.
シンボルGBPUSD、グレートブリテンポンド対USドル
期間M30
モデルティック毎(全てのティックのフラクタル補間で利用可能な全ての最低時間枠をベースとする)
添付の1分足データファイルを使用しています。
日付を使うにチェックが入っています。2005.09.09 To:今日 (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%)
利益取引 (% of total) 1224 (42.05%)
損失トレード (% of total) 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%)
利益取引 (% of total) 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
******************************************************
なぜ2つのテストはこんなに違うのか?
2回目の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******************************.フォワードテストに協力したいのですが、なぜかチャートに添付できないのです...なぜでしょう?![](https://c.mql5.com/forextsd/smiles/angry_smile.png)
.このフォワードテストをお手伝いしたいのですが、なぜかチャートに添付できません...なぜかわからないのですが...
コンパイルしてみてください。 mqh ファイルを experts フォルダに置いておく必要があります。
コンパイルしてみてください。 また、expertsフォルダにmqhファイルがないと動作しません。
mqhファイルは、"experts "フォルダのサブフォルダである "include "フォルダに格納する必要があります。少なくとも私はそうしています。
添付するのは問題ないのですが、ストラテジーテスターが うまくいかないのです。