TestGenerator: unmatched data error (volume limit 240778 at 2012.10.25 00:00 exceeded)

 

Hi there

I can´t get my EA work on GOLD at an ECN trader (FX Open for instance).

The EA managed to open 1 order but after short time, when there is the need to open another order (in this case an opposite one)

The Tester shuts down an displays the following message on the diary

2012.11.04 23:26:06    TestGenerator: unmatched data error (volume limit 240778 at 2012.10.25 00:00 exceeded)

My EA works fine on forex pairs (USDJPY, EURUSD an others) but for some reason it will not last on GOLD after it tries to open its second order.

Maybe there are some rules that does apply for Metals that I Don´t know yet.

Can anybody help me?

best regards

RDV

 
Justhavingfun:

Hi there

I can´t get my EA work on GOLD at an ECN trader (FX Open for instance).

The EA managed to open 1 order but after short time, when there is the need to open another order (in this case an opposite one)

The Tester shuts down an displays the following message on the diary

2012.11.04 23:26:06    TestGenerator: unmatched data error (volume limit 240778 at 2012.10.25 00:00 exceeded)

My EA works fine on forex pairs (USDJPY, EURUSD an others) but for some reason it will not last on GOLD after it tries to open its second order.

Maybe there are some rules that does apply for Metals that I Don´t know yet.

Can anybody help me?

best regards

RDV

Please search the forum before posting https://www.mql4.com/search#!keyword=unmatched%20data%20error&module=mql4_module_forum
 
Justhavingfun:
My EA works fine on forex pairs (USDJPY, EURUSD an others) but for some reason it will not last on GOLD after it tries to open its second order.
Maybe there are some rules that does apply for Metals that I Don´t know yet.
  1. No mind readers here, we need to see your code or we are just guessing.
  2. You have assumptions in your code that aren't valid for metals. Pips2dbl
  3. TickSize != Point. See PointValuePerLot
  4. Pending orders NormalizePrice
    double NormalizePrice(double p, string pair=""){
        // https://forum.mql4.com/43064#515262 zzuegg reports for non-currency DE30:
        // MarketInfo(chart.symbol,MODE_TICKSIZE) returns 0.5
        // MarketInfo(chart.symbol,MODE_DIGITS) return 1
        // Point = 0.1
        // Prices to open must be a multiple of ticksize
        if (pair == "") pair = Symbol();
        double ts = MarketInfo(pair, MODE_TICKSIZE)
        return( MathRound(p/ts) * ts );
    }
    double NormalizeLots(double lots, string pair=""){
        if (pair == "") pair = Symbol();
        double  lotStep     = MarketInfo(pair, MODE_LOTSTEP),
                minLot      = MarketInfo(pair, MODE_MINLOT);
        lots    = MathRound(lots/ls) * ls;
        if (lots < minLot) lots = 0;    // or minLot
        return(lots);
    }
    


 
phi.nuts:
Please search the forum before posting https://www.mql4.com/search#!keyword=unmatched%20data%20error&module=mql4_module_forum


thanks phi.nuts

I didn´t realize there was a search engine...

I am downloading Dukascoy data, but it looks like i will have to learn a lot regarding how to create your own set of data from 1 min info. I guess I will have a lot of work for the next weekend.

thanks a lot again.

 
WHRoeder:
  1. No mind readers here, we need to see your code or we are just guessing.
  2. You have assumptions in your code that aren't valid for metals. Pips2dbl
  3. TickSize != Point. See PointValuePerLot
  4. Pending orders NormalizePrice


Hi WHRoeder

Phi.nuts showed me the link to a similar problem that was reviewed before on the forum, so I learned that this error is related to wrong historical data.

But you pointed out another problem that I am experiencing with my EA, which is how to deal with different pairs and calculate a proper lot size for every order. So, if you are still interested, I will appreciate very much if  you can see my code and help to calculate the lot size properly:

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
{
//----inicializa variables locales

int digits=MarketInfo("EURUSD",MODE_DIGITS);
int StopMultd=10;
int Slippage=Slip*StopMultd;
 
int i=0,closesell=0,closebuy=0,haltb,halts;

 

//-------------------------------------------------------------------
// Money Management
//-------------------------------------------------------------------

double Lots=NormalizeDouble(Risk/100*AccountBalance()/Trail_Stop/0.001/100000*10,2);
 
//-------------------------------------------------------------------+
// time check - debe trabajar dentro de la hora de inicio y fin
//-------------------------------------------------------------------
if((Hour()>=StartHour)&&(Hour()<=EndHour))
{
int TradeTimeOk=1;
Comment(" works well on EURUSD H4");
}
else
{ TradeTimeOk=0; }


//-------------------------------------------------------------------+
//Check open orders
//-------------------------------------------------------------------+

if(OrdersTotal()>0)
 {
 for(i=1; i<=OrdersTotal(); i++)          // Cycle searching in orders
     {
      if(OrderSelect(i-1,SELECT_BY_POS)==true) // If there is an order
        {
          if(OrderMagicNumber()==MagicNumber1) {haltb=haltb+1;}  //if there is an open buy order halt1=increase on 1
          if(OrderMagicNumber()==MagicNumber2) {halts=halts+1;}  //if there is an open sell order halt2=increase on 1
 
        }
      }
   }

note: Risk=the maximum percentage of my Account´s Balance I am willing to risk on each trade. Normally I set it to 3 or 4. I run several backtesting scenarios and choose the one that gives me the highest end Balance with a relative drawdown less than 20%.
my native language is spanish but I tried to comment my code inenglish so it should be clear enough.


 
Justhavingfun:

Hi WHRoeder

Phi.nuts showed me the link to a similar problem that was reviewed before on the forum, so I learned that this error is related to wrong historical data.

But you pointed out another problem that I am experiencing with my EA, which is how to deal with different pairs and calculate a proper lot size for every order. So, if you are still interested, I will appreciate very much if  you can see my code and help to calculate the lot size properly:

<SNIP>

note: Risk=the maximum percentage of my Account´s Balance I am willing to risk on each trade. Normally I set it to 3 or 4. I run several backtesting scenarios and choose the one that gives me the highest end Balance with a relative drawdown less than 20%.
my native language is spanish but I tried to comment my code inenglish so it should be clear enough.

Please edit your post . . . 


Please use this to post code . . . it makes it easier to read.