Jump to content

Fractals4 -- new Fractals from Fx H0pe


Recommended Posts

  • Replies 195
  • Created
  • Last Reply

Top Posters In This Topic

Re: Fractals4 -- new Fractals from Fx H0pe

 

:-? back testing fragments many clusters on u hard drive may be try running this software before during & after ALSO check your computer to see if it optimized--http://www.mediafire.com/?mgzjy32ljdw----serial #--http://www.mediafire.com/?mu4mmumim2o-- :huh: :-?? ENJOY all of these & many more things can be done with this software

Link to comment
Share on other sites

Re: Fractals4 -- new Fractals from Fx H0pe

 

I have found inefficiencies in the code which can slow down backtests. e.g. calls to iCustom() to use the external indicators (PivotWizard, TrendWizard, OscillatorWizard). The code in each of the indicators should be written into the EA instead of using iCustom(). Using iCustom() can make the EA very slow because a lot of unnecessary processing is done. iCustom() is called numerous times on each iteration of start().

 

Also code like:

     if (iFractals(NULL, PERIOD_H1, MODE_UPPER, gi_912) != 0.0) {
        g_ifractals_2068 = iFractals(NULL, PERIOD_H1, MODE_UPPER, gi_912);
        break;
     }

 

should be wriiten:

 

     double fractal = iFractals(NULL, PERIOD_H1, MODE_UPPER, gi_912);
     if (fractal != 0.0) {
        g_ifractals_2068 = fractal;
        break;
     }

 

so that iFractals() would only be called once instead of twice in the code.

Link to comment
Share on other sites

Re: Fractals4 -- new Fractals from Fx H0pe

 

The PeriksaOrderYangAda function needs to be rewritten. It contains incorrect logic and doesn't make clear sense. It might have been written by an amateur.

 

Edit: I've analyzed the code further and I think PeriksaOrderYangAda() and all the related functions (POY(), POY1() etc) can be discarded because they don't actually do anything; they just play with variables that don't actually get used. Removing code that doesn't get used makes backtesting faster.

Link to comment
Share on other sites

Re: Fractals4 -- new Fractals from Fx H0pe

 

I've just made another major discovery:

 

most of the indicator function calls in Functions_Calling() can be removed. Out of the 55 calls, the following should remain:

   g_irsi_960 = iRSI(NULL, PERIOD_M15, 6, PRICE_CLOSE, 0);
  g_irsi_968 = iRSI(NULL, PERIOD_M1, 20, PRICE_CLOSE, 0);
  g_icci_976 = iCCI(NULL, PERIOD_M15, 14, PRICE_CLOSE, 0);
  g_icci_984 = iCCI(NULL, PERIOD_M5, 42, PRICE_CLOSE, 0);
  g_icci_992 = iCCI(NULL, PERIOD_M1, 210, PRICE_CLOSE, 0);
  g_icci_1000 = iCCI(NULL, PERIOD_M1, 80, PRICE_CLOSE, 0);
  g_iwpr_1016 = iWPR(NULL, PERIOD_M5, 14, 0);
  g_ibands_1040 = iBands(NULL, PERIOD_M5, 20, 2, 0, PRICE_WEIGHTED, MODE_UPPER, 1);
  g_ibands_1056 = iBands(NULL, PERIOD_M5, 20, 2, 0, PRICE_WEIGHTED, MODE_LOWER, 1);
  g_imomentum_1096 = iMomentum(NULL, PERIOD_M5, 4, PRICE_CLOSE, 0);
  g_ima_1112 = iMA(NULL, PERIOD_M5, 1, 0, MODE_EMA, PRICE_HIGH, 0);
  g_ima_1128 = iMA(NULL, PERIOD_M5, 1, 0, MODE_EMA, PRICE_LOW, 0);
  gd_1160 = NormalizeDouble(iMA(NULL, PERIOD_M15, 8, 0, MODE_SMA, PRICE_WEIGHTED, 1), 4);
  gd_1168 = NormalizeDouble(iMA(NULL, PERIOD_M15, 8, 0, MODE_SMA, PRICE_WEIGHTED, 1), 4);

 

I think the many unnecessary function calls significantly slowed down backtesting.

Link to comment
Share on other sites

Re: Fractals4 -- new Fractals from Fx H0pe

 

I've found that using the Control Points Strategy Tester model produces similar results as using the Every Tick model, and is much, much faster.

 

Attached is the equity chart over EURUSD using the settings from the fractals4-eurusd.set file provided by the vendor.

The data used was FXDD trade server data from their web site:

http://www.fxdd.com/en/mt1m-data.html

 

Symbol	EURUSD (Euro vs US Dollar)
Period	4 Hours (H4) 2005.02.01 16:00 - 2009.05.29 20:00 (2005.01.10 - 2009.06.01)
Model	Control points (a very crude method, the results must not be considered)
Parameters:
Risk=0.3
Aggressive_Setting=5
Take_Profit=300
BEP=20
Min_StopLoss=20
Max_Open_Position=3
Broker_OffsetHour=2
SwitchUtcOffsetForDS=1
Two_Direction_Trade=true
ECN_MarketOrder=false
SlipPage=3
MaxSpread_Allowed=3
Magic_Number=8928870
Comment4="---Stop Trading Parameter (format yyy.m.d)---"
StopTrading_Date="2000.1.1"
ContinueTrading_Date="2000.1.2"
UseForexHopeRM=true
DebugMode=false;

Bars in test	6812	Ticks modelled	313271	Modelling quality	n/a
Mismatched charts errors	0				
Initial deposit	10000.00				
Total net profit	34315.91	Gross profit	82834.90	Gross loss	-48518.99
Profit factor	1.71	Expected payoff	18.84		
Absolute drawdown	237.29	Maximal drawdown	2833.80 (7.83%)	Relative drawdown	8.86% (1105.66)
Total trades	1821	Short positions (won %)	945 (72.80%)	Long positions (won %)	876 (68.61%)
Profit trades (% of total)	1289 (70.79%)	Loss trades (% of total)	532 (29.21%)
Largest	profit trade	899.10	loss trade	-1153.80
Average	profit trade	64.26	loss trade	-91.20
Maximum	consecutive wins (profit in money)	20 (1610.68)	consecutive losses (loss in money)	7 (-1036.32)
Maximal	consecutive profit (count of wins)	3775.61 (14)	consecutive loss (count of losses)	-2649.50 (5)
Average	consecutive wins	4	consecutive losses	2

 

Here are the UTC offsets for the FXDD data:

From					To						FXDD UTC offset
2004-10-31 01:00	2005-04-03 02:00	2              
2005-04-03 03:00	2005-10-30 02:00	3              
2005-10-30 01:00	2006-04-02 02:00	2              
2006-04-02 03:00	2006-10-29 02:00	3              
2006-10-29 01:00	2007-04-11 02:00	2              
2007-04-11 03:00	2007-11-04 02:00	3              
2007-11-04 01:00	2008-03-09 02:00	2              
2008-03-09 03:00	2008-11-02 02:00	3              
2008-11-02 01:00	2009-03-08 02:00	2              
2009-03-08 03:00	2009-11-01 02:00	3              
2009-11-01 01:00	2010-03-14 02:00	2              
2010-03-14 03:00	2010-11-07 02:00	3              
2010-11-07 01:00	2011-03-13 02:00	2              
2011-03-13 03:00	2011-11-06 02:00	3              

Link to comment
Share on other sites

Re: Fractals4 -- new Fractals from Fx H0pe

 

i get different results when i run it every tick compared to control points.

 

control points; its quite profitable with little drawdown.

 

every tick; it struggles and on 5 digits has significant and long periods of drawdowns.

"It is inconceivable that anyone will divulge a truly effective get-rich scheme for the price of a book."

Victor Niederhoffer (1943–), US hedge fund manager and statistician

Link to comment
Share on other sites

Re: Fractals4 -- new Fractals from Fx H0pe

 

How did you figure out the gmt offset for each year?

 

If you see this FAQ on their web site

http://www.fxdd.com/en/learning-center/faq/metatrader.html#23

you'll see that it says:

*GMT time varies with daylight savings. GMT + 2 is from FALL to SPRING, and GMT + 3 is from SPRING to FALL.

 

I sent an email message to ask for exact offset switch dates, and I received a reply saying that the next switch will be at 2009-11-01 03:00 at which they'll turn their clock back to 02:00, which is GMT + 2. The offset switch after that will be at 2010-03-14 02:00 at which they'll turn their clock forward to 03:00, which is GMT + 3. The reply also stated that their historical data switches offset.

 

At their Contact Us page:

http://www.fxdd.com/en/forex-trading/contact-us.html

Their address is:

75 Park Place , 4th Floor

New York , NY 10007, USA

 

So from this address and from the dates stated in their reply I figured that they follow New York daylight savings time (which is a little different to European daylight savings time (which Alpari and some other brokers follow)).

 

So I got the past New York daylight savings switch dates and times from

http://www.timeanddate.com/worldclock/timezone.html?n=179&syear=2000

 

I then wrote this MQL function:

 

void SetCurrentUtcOffset()
{
 currentUtcOffset = Broker_OffsetHour; //1 for Alpari, 2 for FXDD

 if(broker_OffsetHourDS == Broker_OffsetHour) return(0);

   if(TimeCurrent() < 1130637600) { if(TimeCurrent() >= 1112497200) currentUtcOffset = broker_OffsetHourDS; } //earliest FXDDWeb historical data date is 2005-01-10
   else if(TimeCurrent() < 1162087200) { if(TimeCurrent() >= 1143946800) currentUtcOffset = broker_OffsetHourDS; }
   else if(TimeCurrent() < 1194141600) { if(TimeCurrent() >= 1176260400) currentUtcOffset = broker_OffsetHourDS; }
   else if(TimeCurrent() < 1225591200) { if(TimeCurrent() >= 1205031600) currentUtcOffset = broker_OffsetHourDS; }
   else if(TimeCurrent() < 1257040800) { if(TimeCurrent() >= 1236481200) currentUtcOffset = broker_OffsetHourDS; }
   else if(TimeCurrent() < 1289095200) { if(TimeCurrent() >= 1268535600) currentUtcOffset = broker_OffsetHourDS; }
   else if(TimeCurrent() < 1320544800) { if(TimeCurrent() >= 1299985200) currentUtcOffset = broker_OffsetHourDS; }
}

 

Note that I used integers for the datetime values to help reduce processing time (otherwise it would have to call StrToTime() for each datetime comparison).

Link to comment
Share on other sites

Re: Fractals4 -- new Fractals from Fx H0pe

 

i get different results when i run it every tick compared to control points.

 

control points; its quite profitable with little drawdown.

 

I only ran a few months over EURUSD data on Every Tick and stopped it due to impatience. I then tested using Control Points and found that for those months the equity curve drew out a similar shape.

 

But I've spent many hours rewriting a lot of code to optimize for speed and will now test using Every Tick to compare the results with my results from the Control Points tests.

 

I still haven't translated the indicator code into the EA though, so I'm still using iCustom(). It'll take a bit of work to do the translation. I already tried a couple of days ago but my results were a little off from the original.

 

I'm also thinking of changing the code so that the stop loss level calculation and modification is done only on every new M1 bar instead of every tick to improve the speed.

 

it struggles and on 5 digits has significant and long periods of drawdowns.

 

Have you added a check for Digits in the PivotWizard indicator code? I put this into init():

   if (Digits == 4 || Digits == 2) pointValue = Point;
  else if (Digits == 5 || Digits == 3) pointValue = 10.0 * Point;

and then replaced Point with pointValue in the rest of the code.

Link to comment
Share on other sites

Re: Fractals4 -- new Fractals from Fx H0pe

 

Symbol	GBPUSD (Great Britain Pound vs US Dollar)
Period	4 Hours (H4) 2005.02.01 16:00 - 2009.05.29 20:00 (2005.01.10 - 2009.06.01)
Model	Control points (a very crude method, the results must not be considered)
Bars in test	6810	Ticks modelled	315341	Modelling quality	n/a
Mismatched charts errors	0				
Initial deposit	10000.00				
Total net profit	13085.56	Gross profit	54062.14	Gross loss	-40976.58
Profit factor	1.32	Expected payoff	7.43		
Absolute drawdown	275.10	Maximal drawdown	2100.42 (10.23%)	Relative drawdown	14.99% (1992.68)
Total trades	1761	Short positions (won %)	922 (68.55%)	Long positions (won %)	839 (71.87%)
Profit trades (% of total)	1235 (70.13%)	Loss trades (% of total)	526 (29.87%)
Largest	profit trade	350.36	loss trade	-449.12
Average	profit trade	43.78	loss trade	-77.90
Maximum	consecutive wins (profit in money)	20 (786.98)	consecutive losses (loss in money)	11 (-557.98)
Maximal	consecutive profit (count of wins)	1079.38 (8)	consecutive loss (count of losses)	-1274.98 (5)
Average	consecutive wins	4	consecutive losses	2

Link to comment
Share on other sites

Re: Fractals4 -- new Fractals from Fx H0pe

 

hyperdimension, read what it says in your results near "Control Points"... Testing that way is exactly what it says there: "a very crude method, the results must not be considered". You should probably stop posting Control Points results, as Stormin_Norman says, they're quite different from Every Tick results and misleading.

Link to comment
Share on other sites

Re: Fractals4 -- new Fractals from Fx H0pe

 

hyperdimension, read what it says in your results near "Control Points"... Testing that way is exactly what it says there: "a very crude method, the results must not be considered". You should probably stop posting Control Points results, as Stormin_Norman says, they're quite different from Every Tick results and misleading.

 

Yes I'm aware of that, and I explained why I used Control Points in my previous post in this thread. I'm now running tests using Every Tick so that we can compare with the results that I just posted.

 

Believe me, I'm probably the most obsessive you can imagine about backtesting the "right" way, and have written extensively and repeatedly here (in the MegaDroid thread) and other forums.

Link to comment
Share on other sites

Re: Fractals4 -- new Fractals from Fx H0pe

 

There's a new version, so old backtest results could be outdated anyway, depending on what code has been updated:

http://sharebee.com/702753da

 

I started forward testing a few days ago. It has been taking quite a few trades every day and has been doing ok, but it's too soon to make any hard conclusions from my forward test.

Link to comment
Share on other sites

Re: Fractals4 -- new Fractals from Fx H0pe

 

Have you added a check for Digits in the PivotWizard indicator code? I put this into init():

   if (Digits == 4 || Digits == 2) pointValue = Point;
  else if (Digits == 5 || Digits == 3) pointValue = 10.0 * Point;

and then replaced Point with pointValue in the rest of the code.

 

no i havent.

 

i would be most appreciative if you could post your changes up.

 

edit: it seems you might have above. is that your version you posted?

 

in addition i am getting errors on it due to copy protection. i have tried to hack it up to work but have had no luck. could someone with more skill then me have a look at the code?

"It is inconceivable that anyone will divulge a truly effective get-rich scheme for the price of a book."

Victor Niederhoffer (1943–), US hedge fund manager and statistician

Link to comment
Share on other sites

Re: Fractals4 -- new Fractals from Fx H0pe

 

no i havent.

 

i would be most appreciative if you could post your changes up.

 

edit: it seems you might have above. is that your version you posted?

 

in addition i am getting errors on it due to copy protection. i have tried to hack it up to work but have had no luck. could someone with more skill then me have a look at the code?

 

Actually, that one worked for me quite well in backtests, it was pretty fast, too. So fast that I've been able to complete all the tests for 2009 already.

 

As I mentioned somewhere else, the volatility breakout strategy is not bad, but it doesn't really bring profits either. The element that actually brings some money is the scalping part.

 

The large drawdown that the EA is having during july makes me think that it might have been curve-fitted up to that date. However, it started going up again in august, so only the future will tell whether this is actually a profitable EA or just a curve-fitted one that performs good in backtests so that the author can make some sales.

 

I'm posting all the strategy reports for 2009 in an archive at:

http://www.4shared.com/file/128598543/d1937031/

 

Note that the reports are split in two for each currency pair to account for the summer time starting at 03.08 (cba implementing a time offset function). The excel file merges all results, but please note that the money management is not updated in the excel so the result would've actually been a bit higher balance-wise (and the july drawdown would've been higher in percent).

Link to comment
Share on other sites

Re: Fractals4 -- new Fractals from Fx H0pe

 

I then wrote this MQL function:

 

void SetCurrentUtcOffset()
{
 currentUtcOffset = Broker_OffsetHour; //1 for Alpari, 2 for FXDD

 if(broker_OffsetHourDS == Broker_OffsetHour) return(0);

   if(TimeCurrent() < 1130637600) { if(TimeCurrent() >= 1112497200) currentUtcOffset = broker_OffsetHourDS; } //earliest FXDDWeb historical data date is 2005-01-10
   else if(TimeCurrent() < 1162087200) { if(TimeCurrent() >= 1143946800) currentUtcOffset = broker_OffsetHourDS; }
   else if(TimeCurrent() < 1194141600) { if(TimeCurrent() >= 1176260400) currentUtcOffset = broker_OffsetHourDS; }
   else if(TimeCurrent() < 1225591200) { if(TimeCurrent() >= 1205031600) currentUtcOffset = broker_OffsetHourDS; }
   else if(TimeCurrent() < 1257040800) { if(TimeCurrent() >= 1236481200) currentUtcOffset = broker_OffsetHourDS; }
   else if(TimeCurrent() < 1289095200) { if(TimeCurrent() >= 1268535600) currentUtcOffset = broker_OffsetHourDS; }
   else if(TimeCurrent() < 1320544800) { if(TimeCurrent() >= 1299985200) currentUtcOffset = broker_OffsetHourDS; }
}

 

Note that I used integers for the datetime values to help reduce processing time (otherwise it would have to call StrToTime() for each datetime comparison).

 

This is so far the most efficient way I have seen to get the correct GMT setting for back testing purpose, a kudo for you ! Well done..

Link to comment
Share on other sites

Re: Fractals4 -- new Fractals from Fx H0pe

 

birt, I'm having a look at your backtest results.

 

What are the spreads of EURUSD, GBPUSD, EURGBP that the terminal had when you started each backtest?

 

The reports indicate that there were Mismatched charts errors. What data did you use? I've written about this many times (in the MegaDroid threads): backtests should be done on an offline terminal, otherwise new live data gets intermingled with data in your MetaTrader history center, and this can cause mismatch errors. Also, if the terminal is connected, then the spread that the backtester takes is the current live spread (it's a very serious design flaw of the Strategy Tester). You'd then find that you get different backtest results depending on what day or time you ran it.

 

You can create an offline terminal by simply copying an entire MetaTrader folder, renaming it e.g. to "MetaTrader Alpari (Offline)", then deleting the demo account. It's best to do this during the time that the EA is going to trade, so that the spreads values are "locked in".

 

It would be good to see an earlier backtest start date. Since Alpari data switches UTC offset for European daylight savings, you should use code to switch the UTC offset by date. Here's code that I've used for Alpari historical data:

 

  //For Alpari historical data
 if(gi_timeCurrent < 941068800) currentUtcOffset = UtcOffsetDaylightSavings; //1999-10-28
 else if(gi_timeCurrent < 972345600) { if(gi_timeCurrent >= 954460800) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent < 1003708800) { if(gi_timeCurrent >= 985996800) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent < 1035763200) { if(gi_timeCurrent >= 1017532800) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent < 1067212800) { if(gi_timeCurrent >= 1049068800) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent < 1098921600) { if(gi_timeCurrent >= 1080691200) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent < 1130284800) { if(gi_timeCurrent >= 1112230800) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent < 1161648000) { if(gi_timeCurrent >= 1143774000) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent < 1193011200) { if(gi_timeCurrent >= 1175310000) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent < 1225065600) { if(gi_timeCurrent >= 1206928800) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent >= 1238464800) currentUtcOffset = UtcOffsetDaylightSavings; //2009-03-31 02:00

 

I've also written countless times that the data that you can easily download through the History Center is indicative data and may not be reliable, especially for scalping strategies.

Link to comment
Share on other sites

Re: Fractals4 -- new Fractals from Fx H0pe

 

birt, I'm having a look at your backtest results.

 

What are the spreads of EURUSD, GBPUSD, EURGBP that the terminal had when you started each backtest?

 

EURUSD - 1.6

EURGBP - 2.0

GBPUSD - 2.5

 

The reports indicate that there were Mismatched charts errors. What data did you use?

 

History center shitdata. I don't feel like overdoing it with 99% quality with gain capital tick data which is dubious at best.

 

I've written about this many times (in the MegaDroid threads): backtests should be done on an offline terminal, otherwise new live data gets intermingled with data in your MetaTrader history center, and this can cause mismatch errors. Also, if the terminal is connected, then the spread that the backtester takes is the current live spread (it's a very serious design flaw of the Strategy Tester). You'd then find that you get different backtest results depending on what day or time you ran it.

 

You can create an offline terminal by simply copying an entire MetaTrader folder, renaming it e.g. to "MetaTrader Alpari (Offline)", then deleting the demo account. It's best to do this during the time that the EA is going to trade, so that the spreads values are "locked in".

 

I always use an offline terminal when testing. The errors are probably due to the terminal being online at some point and the data getting "tainted".

 

It would be good to see an earlier backtest start date. Since Alpari data switches UTC offset for European daylight savings, you should use code to switch the UTC offset by date. Here's code that I've used for Alpari historical data:

 

  //For Alpari historical data
 if(gi_timeCurrent < 941068800) currentUtcOffset = UtcOffsetDaylightSavings; //1999-10-28
 else if(gi_timeCurrent < 972345600) { if(gi_timeCurrent >= 954460800) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent < 1003708800) { if(gi_timeCurrent >= 985996800) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent < 1035763200) { if(gi_timeCurrent >= 1017532800) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent < 1067212800) { if(gi_timeCurrent >= 1049068800) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent < 1098921600) { if(gi_timeCurrent >= 1080691200) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent < 1130284800) { if(gi_timeCurrent >= 1112230800) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent < 1161648000) { if(gi_timeCurrent >= 1143774000) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent < 1193011200) { if(gi_timeCurrent >= 1175310000) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent < 1225065600) { if(gi_timeCurrent >= 1206928800) currentUtcOffset = UtcOffsetDaylightSavings; }
 else if(gi_timeCurrent >= 1238464800) currentUtcOffset = UtcOffsetDaylightSavings; //2009-03-31 02:00

 

I've also written countless times that the data that you can easily download through the History Center is indicative data and may not be reliable, especially for scalping strategies.

 

Totally agree with the history center data being somewhat inappropriate for scalping EA backtesting. I believe Fractals would work ok even on tick data during 01-07.2009. However, the problem is the rather large July drawdown, which is why no further backtest would persuade me to let this EA trade real money. I'm gonna give it a chance in a 3-4 month forward test, perhaps July was just a fluke. As for the GMT offset, since I was going to "merge" the results using my script anyway, I just tested 01.01-03.08 separated from the rest, with GMT offset +2 instead of +1.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...