Multicurrency advisor question - page 6

 

Well that's not the complaint here.

It's as if you've just seen the rules for the first time.... This issue has already been discussed - in the first championship threads - see the home page

 

I am testing and optimizing my Expert Advisor on Metaquotes history. At first I worked with the 208 build (installation for Alpari) - I need counter points, but 209 does not have them. Later I have tested the Expert Advisor with the same parameters and on the same history downloaded from Metaquotes in the same way in the build 209 (installation by Metaquotes). The results are very much different. Also the number of bars in history and amount of simulated ticks are different, even if the testing is of the same quality. Please, tell me the reason of different operation algorithm of builds 208 and 209 or maybe it is because of settings of symbols (spread, swap, deposit, stop levels etc.) in one case they are Alpari ones, in the other - Metakvotes ones? Or the reason is something else? And how do I do proper testing and optimization on Metakvotes data - history having a 208 build from Alpari? Where can I download the 208 build (Metakvotes installation)?

I downloaded the history using Renat's recipe 'Automated Trading Championship 2007: Common Errors in EAs' previously deleted all the .hst-files.

Strategy Tester Report
worker
MetaQuotes-Demo (Build 208)


Symbol EURUSD (Euro vs US Dollar)
Period 15 Minutes (M15) 1999.01.05 13:00 - 2007.09.07 22:45
Model All ticks (based on all smallest available periods with fractal interpolation of each tick)
Parameters
Bars in history 215177 Modelled ticks 13375536 Modeling quality 89.96%
Initial deposit 10000.00
Net profit 3484.57 Total profit 14828.81 Total loss -11344.24
Profitability 1.31 Expectation of winning 7.20
Absolute drawdown 896.44 Maximum drawdown 1255.96 (12.12%) Relative drawdown 12.12% (1255.96)
Total trades 484 Short positions (% win) 249 (47.79%) Long positions (% win) 235 (52.77%)
Profitable trades (% of all) 243 (50.21%) Loss trades (% of all) 241 (49.79%)
Largest profitable trade 426.34 losing deal -99.96
Average profitable deal 61.02 losing trade -47.07
Maximum number continuous wins (profit) 6 (466.42) Continuous losses (loss) 7 (-275.39)
Maximum Continuous Profit (number of wins) 653.20 (4) Continuous loss (number of losses) -286.62 (3)
Average continuous winnings 2 Continuous loss 2

Strategy Tester Report
worker
MetaQuotes-Demo (Build 209)


Symbol EURUSD (Euro vs US Dollar)
Period 15 Minutes (M15) 1999.01.05 13:00 - 2007.09.07 22:45 (1970.01.01 - 2007.09.08)
Model All ticks (based on all smallest available periods with fractal interpolation of each tick)
Parameters
Bars in history 215437 Modelled ticks 15419309 Modeling quality 89.96%
Initial deposit 10000.00
Net profit 1882.77 Total profit 13653.61 Total loss -11770.84
Profitability 1.16 Expected payoff 3.82
Absolute drawdown 896.21 Maximum drawdown 1331.85 (12.52%) Relative drawdown 12.52% (1331.85)
Total trades 493 Short positions (% win) 263 (48.67%) Long positions (% win) 230 (51.30%)
Profitable trades (% of all) 246 (49.90%) Loss trades (% of all) 247 (50.10%)
Largest profitable trade 426.34 losing deal -99.96
Average profitable deal 55.50 losing trade -47.66
Maximum continuous wins (profit) 6 (466.42) Continuous losses (loss) 7 (-275.39)
Maximum Continuous Profit (number of wins) 522.72 (3) Continuous loss (number of losses) -318.74 (5)
Average continuous winnings 2 continuous loss 2

 

Apparently, it's the quote feed itself. For example, the open/close prices of the different historical versions are slightly different and hence the price movement within a bar will be modelled slightly differently! And with stops =40/50 this will already have an impact.

Also, it's not quite clear - did you do the test both times on mt4 Alpari? (With different quotes).

Or the second time using mt4 MQ? Maybe, the spreads are different there. And for 500 trades - already 1 pip is "-500".

And the swaps are the same...

 
rid:

Apparently, it's the price feed itself. For example, the open/close prices of the different historical versions are slightly different and hence the price movement within the bar will be modelled slightly differently! And with stops =40/50 this will already have an impact.

Also, it's not quite clear - did you do the test both times on mt4 Alpari? (With different quotes).

Or the second time using mt4 MQ? Maybe, the spreads are different there. And for 500 trades - already 1 pip is "-500".

And swaps are the same...


What's the pitch here? Quotes are uploaded to both terminals from the Metacvotecs History Centre. The first terminal was created from the Alpari installation (build 208), the second from the Metakvotes installation (build 209). Both were in turn logged into a test account (issued by Metakvotes to participate in the championship) and quotes were uploaded according to Renat's recipe. The first 300 or so trades go almost 1:1 (which confirms the identity of the quotes, spreads, swaps...), then differently (see the statements). Bafflingly the same quality of modelling :(

And another surprising thing: the Expert Advisor is not complex, it uses only one built-in indicator and shows 2-3 times better results on Alpari data than on Metakvotes History Center data. And no optimization allows it to come even close to Alpari results. This despite the fact that when trading with constant 0.1 lot MOL about 35, PF = 2.5, deals last sometimes for several days, ie TS clearly not scalper / scalper.

Files:
test.zip  278 kb
 

Another thing I can guess is this.

I've had problems with history too, when I've logged one MT4 terminal to different DCs. At first everything seemed fine. And then I must have clicked somewhere and pieces of one brokerage company's history (for one and the same pair) started to creep into history of another one. Or the chunks started to fall out altogether. Finally, everything got so messed up that I refuse to open accounts of different brokerage companies on one terminal.

Now I have four Mt4 accounts in my copm from different brokerage companies, but I fixed the problem with this mess! Try to do it in the same way.

P.S I also noticed. There is a brokerage company Masterforex (do not consider it an advertisement - just saying ...) . So with its quotes, my EAs for some reason show excellent results on history. But on Lite or Alpari - with the same parameters and quality - somewhat worse.

 
rid:

Another thing I can guess is this.

I have had problems with history too, when I have logged one MT4 terminal to different DCs. At first everything seemed fine. And then I must have clicked somewhere and pieces of one brokerage company's history (for one and the same pair) started to creep into history of another one. Or the chunks started to fall out altogether. Finally, everything got so messed up that I refuse to open accounts of different brokerage companies on one terminal.

Now I have four Mt4 accounts in my copm from different brokerage companies, but I fixed the problem with this mess! Try to do the same.


Thanks, but I am aware of this problem. I wrote above that I took clean installations, installed them, deleted all .hst files, logged each of the two terminals to only one account issued by Metacvotes, deleted all other terminals from config folder, so there could not be any confusion and foreign pieces of history have nowhere to come from. And purely the tester terminal Alpari, on which I got 2-3 times better results earlier, never logged to any brokerage company or account at all. It's loaded with Alpari .hst files.
 
The question remains why the same simulation quality is given for different number of bars and simulated ticks? And also, where is the guarantee that the download folder with a greater volume of history without omissions? It turns out, the quantitative assessment of the simulation quality given by the tester cannot be trusted?
 

You can't trust anyone!

I don't think the tester reacts to the number of bars.

And as for the quality evaluation, we can see that the quantity of quality is evaluated by the following criteria : - How completely the tested timeframe is filled with the minute quotations inside it. If it is full, then =90%. If it is not completely filled then the quality is lower.

But I've got inexplicable dips in quotes (from September till October/November 2006) for all TFs in Fuj and Kiwi (when loading). But the tester doesn't notice it and gives =90%, as all other bars in any timeframe are completely filled with minutes.

And the fact that the bars are missing - the tester does not see.

Maybe you are missing a week or two of history somewhere. Hence the difference.

Z

 

The question of a multi-currency Expert Advisor has come up again. There is a need to make one of the pairs work in the open price mode! I found an example of such a design in the articles. I first pasted it into the single version. Everything worked.

int start()
//ждем открытия нового бара. Если появл. новый бар - проверяем возможность сделки
 {if(Time[0] == prevtime) 
       return(0);
   prevtime = Time[0];

Then I inserted it into my multi currency Expert Advisor in the same way. And all pairs worked with the opening prices. But I do not need all of them. I need only one - the second pair. I have done it like this:

I have declared in global - static int prevtime = 0;

ЗАДАЕМ ВНЕШНИЕ ПАРАМЕТРЫ ПО КАЖДОЙ ПАРЕ
 static int prevtime = 0;
int init()
  {
   return(0);
  }
int deinit()
  {
   return(0);
  }
 
int start()
  {  
 int Orders=OrdersTotal ();     //получаем кол-во открытых ордеров
if (Orders<3)                 //если  открытых ордеров <3
  { 
if (выключатель 1 вкл) {РАСЧЕТ ИНДЮКОВ И ОТКРЫВАЕМ ПЕРВУЮ ПАРУ } 
if (выключатель 2 вкл) 
{
if(Time[0] == prevtime) 
       return(0);
   prevtime = Time[0]; 
 
РАСЧЕТ ИНДЮКОВ И ОТКРЫВАЕМ ВТОРУЮ ПАРУ } 
  }
//========================================================================
for (int x=0; x<OrdersTotal(); x++)                                             {
    if (OrderSelect(x, SELECT_BY_POS, MODE_TRADES)) 
{       
if (UseTrailing 1) - ТРЕЙЛИНГ ПЕРВОЙ ПАРЫ
... ... ...
if (UseTrailing 2) - Трейлинг второй пары
}
//======================================================================
   return(0);
  }

Besides after each ticket of the second pair inserted :

ticket=OrderSend("EURUSD", OP_BUY,Lots,_ask ,3,_bid-SL_long*_point,
                       _ask +TP_long*_point,"M_4",MagicEURUSD,0,CLR_NONE);
 
                        Sleep(30000);
                       if(ticket < 0)   {
                           prevtime = Time[1];
                         }

Nothing works! The EA continues working by the second pair through all ticks!

I tried another construction. I tried another one.

bool isNewBar=false;
if (ExpertBars !=Bars) {ExpertBars=Bars; isNewBar=true; }
//-------------------------------------------------------
 
if (isNewBar) {

I set variables beforehand:

int         ExpertBars;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
ExpertBars = Bars;
//----------------
   return(0);

But .... Same story. When I put it in the beginning - all pairs work by opening prices. But when I want to apply it to one pair, it does not work! I am struggling for the third day.

I will be glad for any advice and recommendations....

 
rid:
The names highlighted in red by ME refer to the instrument to which the EA is attached. Try using iTime() instead of Time[].