Gogetter EA - page 9

 

Hope someone can find the answer to the mystery here...

This post has everything needed to run GGL3 if you put this code in an include .mqh file. I zipped the .htm reports because they are both over 4mb because of all the modifiy orders...

it appears that my redesign of the trailing stop function improved the performance from 1.2 million to 1.3 million...OR that is a result of starting with an initial deposit of 1000 instead of 500. I don't know which because GGL3 won't start with an initial deposit of 500 and open any trades

Sad to say report that despite what appears to be progress on this there remains something unrevealed as of yet that keeps this from making the big money consistently. More often it fails and goes bankrupt. If it's not the trailing stop doing it then it must be something else...I don't know what...

It appears that there is alot of reward and some big money in it for whoever can figure out what is causing this to have such a wide variance in outcomes from the same settings of the same ea over the same time range and correct it. It's got me stumped presently.

I am taking a week off to vacation...Hope someone has posted some insight or solution when I return. I don't see how I can really move on to more development with this until the mystery here is revealed.

//+------------------------------------------------------------------+

//| 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)

//}
Files:
ggl3.zip  353 kb
ggl3fail.zip  335 kb
ggl3.gif  6 kb
ggl3fail.gif  8 kb
ggl3.mq4  21 kb
 

here is the include file zipped if that's easier to manage.

Files:
 

the questions I am asking now are....

is the data stream stable? I assume it is because it uses the history center files....perhaps that assumption should be challenged?

is the way the platform processes the data stream stable and can it be relied upon to process the same data exactly the same way every time? If not who made this platform? how do I contact them? what is it that needs to be fixed to make it reliable?

it doesn't seem likely that I will ever stabalize the EA code if either of those two unknowns are still potentially variable and in fact unreliable. How can their reliability be verified?

I have posted a request for attention to this question on this page...

http://www.metaquotes.net/index.php?bugtrack/

let's hope someone has some insight and replies soon.

 
Aaragorn:
the questions I am asking now are....

is the data stream stable? I assume it is because it uses the history center files....perhaps that assumption should be challenged?

is the way the platform processes the data stream stable and can it be relied upon to process the same data exactly the same way every time? If not who made this platform? how do I contact them? what is it that needs to be fixed to make it reliable?

it doesn't seem likely that I will ever stabalize the EA code if either of those two unknowns are still potentially variable and in fact unreliable. How can their reliability be verified?

I have posted a request for attention to this question on this page...

http://www.metaquotes.net/index.php?bugtrack/

let's hope someone has some insight and replies soon.

.... have you tried forward testing this on mutilple platforms? i am currently testing the same EA on two different BD platforms to see what results i will be getting. i wanted to make sure that the results would have a fair amount of fixed data before i took one live. maybe that is a stupid idea, but i dont want to risk real capital until i have a fairly sure idea that the Ea will have a consistant performance.

 

I have only tested it on metatrader 4 using the 30tf for the GPBUSD. Not because it's not a good idea to do so but because I am only human and as I'm not female I don't multitask well either. So I simply havn't gotten around to doing it yet. I have not yet done any other testing. I've remained focused on development issues. My goal was to get it stable in this one instance before trying to expand to other pairs or other platforms or whatever.

By all means use your common sense. I will allow this to run in my demo account while I'm away this next week. Since we are leaving tomorrow and will be gone for the week I won't be back to the thread most likely until next tuesday.

I don't deem if fit yet to risk real money on I just want to see the instabilities resolved and then forward test in demo. Then I'll see where the data tells me to go with it from there. I really would like to invite especially developers to scrutinize it while I'm away and see if the data processing or data file irregularities can be verified.

I don't see anything obviously wrong with the code that would account for the variance. I've been wrong before I could be wrong about that too. I'm ok with being wrong if someone can show me how or where to correct it.

I won't lie to ya, I'll be happy to get away from this for awhile. It as consumed too much of my attention and I deserve to seek some balance in life while I work on this.

I'll leave this in you guys hands for awhile and see what you can do with it. I just ask that if you do any research on it that you report back to this thread with your results so that everyone can benefit from it.

 

...........

could you put short and long postions in one mp4 file?

 

Why so different report from same settings?

Using the attached EA with the attached include.mqh file. I run a strategy test using these settings....

Expert Properties Button....

Testng tab...

1000 USD initial deposit..

Positions: Long and Short

Optomized parameter: Balance

Genetic algorithm box is not checked

Inputs Tab...

All user inputs are used exactly as they are saved in the EA with no manual changes to this tab

Optimization Tab...

Nothing is checked in this tab

Settings.....

Expert Advisor: GGL3, Aaragorn and Eaglehawk & Maji & Robert C.

Symbol: GBPUSD, Great Britian Pound vs US Dollar

Period: M30

Model: Every tick (based on all available leasttimeframes with fractal interpolation of every tick)

I am using the 1 minute data file also attached.

Use date box is checked; From: 2005.09.09 To: Today (2006.08.22)

I check the box for Recalculate

I do not check the box for Optimization

I get this report when the test is finished...

**************************************************

Bars in test 17735

Ticks modelled 702859

Modelling quality 89.82%

Initial deposit 1000.00

Total net profit 1375788.66

Gross profit 3678568.71

Gross loss -2302780.05

Profit factor 1.60

Expected payoff 472.62

Absolute drawdown 240.00

Maximal drawdown 231662.10 (15.07%)

Relative drawdown 55.32% (18074.74)

Total trades 2911

Short positions (won %) 0 (0.00%)

Long positions (won %) 2911 (42.05%)

Profit trades (% of total) 1224 (42.05%)

Loss trades (% of total) 1687 (57.95%)

Largest

profit trade 89100.00

loss trade -15840.00

Average

profit trade 3005.37

loss trade -1365.01

Maximum

consecutive wins (profit in money) 9 (106921.10)

consecutive losses (loss in money) 18 (-163.10)

Maximal

consecutive profit (count of wins) 225720.50 (7)

consecutive loss (count of losses) -15845.70 (5)

Average

consecutive wins 2

consecutive losses 2

****************************************************

Now I am thinking this is a very good EA so I want to test it again to make sure it does the same thing....

I make no changes to the settings of any kind....

I select the Recalculate box on the settings tab and click start....I get this report now...

******************************************************

Bars in test 18015

Ticks modelled 739231

Modelling quality 89.83%

Initial deposit 1000.00

Total net profit -731.75

Gross profit 31897.83

Gross loss -32629.58

Profit factor 0.98

Expected payoff -0.24

Absolute drawdown 780.40

Maximal drawdown 4912.15 (94.91%)

Relative drawdown 94.91% (4912.15)

Total trades 2990

Short positions (won %) 0 (0.00%)

Long positions (won %) 2990 (34.88%)

Profit trades (% of total) 1043 (34.88%)

Loss trades (% of total) 1947 (65.12%)

Largest

profit trade 1170.00

loss trade -360.00

Average

profit trade 30.58

loss trade -16.76

Maximum

consecutive wins (profit in money) 8 (124.50)

consecutive losses (loss in money) 20 (-45.50)

Maximal

consecutive profit (count of wins) 2606.30 (7)

consecutive loss (count of losses) -360.00 (1)

Average

consecutive wins 2

consecutive losses 3

******************************************************

why are the two tests so different?

what is the testing doing different when it tests the EA for the second time?

how do I make the tester test the same each time I recalculate?

Thankyou for your guidance to get the same report each time I test this EA.

Aaragorn

***********************include .mqh file below *******************************

//+------------------------------------------------------------------+

//| 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******************************
Files:
ggl3.mq4  21 kb
 

. i would like to help you forward test this, but for some reason i can not attach it to a chart .. cant figure out why not..

 
furious_angel:
. i would like to help you forward test this, but for some reason i can not attach it to a chart .. cant figure out why not..

Try compiling it. You also need to have the mqh file in the experts folder for it to work.

 
forextrades:
Try compiling it. You also need to have the mqh file in the experts folder for it to work.

actually the mqh file needs to go in the "include" folder which is a subfolder of the "experts" folder. At least that's how it works for me.

I don't have troubles attaching it> I just have troubles getting the strategy tester to be consistent with it.

Reason: