Data mismatch between EA and Chart Data after server downtime... PLEASE HELP!! :\

 

In my EA I built an Array called 'TickData' which saves incoming bid price and time information for each incoming tick (skipping ticks with changes in Ask price only):

double TickData[][4];

int start() {
   UpdateTickData();
}

int UpdateTickData() {
   int arSize = ArrayRange(TickData,0);
   if (TickData[arSize-1][1]==Bid) return(0);
   
   ArrayResize(TickData, arSize+1);
   int arIndex = arSize; // 'arSize' serves as the array index after array has been resized by 1
      TickData[arIndex][0] = MarketInfo(Symbol(),MODE_TIME); // Tick Time
      TickData[arIndex][1] = Bid; // Bid Price
      TickData[arIndex][2] = Ask; // Ask Price
      TickData[arIndex][3] = Volume; // Volume
   return(0);
}

(Yes, I realize that I am saving the datetime as double, but that is not relevant to this issue).

Lately my broker had some problems with the DEMO server being down, resulting in GAPS in the price chart.

When this happens, once price data starts incoming again, a new bar is formed with Time[] and Open[] values.

Naturally that bar's price position will be significantly different that the previous bar in the chart because of the time gap between them:

Here is the strange problem:


The Price values saved inside internal EA Array 'TickData', after time of new bar opening, are totally different than the data shown on the chart for that bar!!!

Example from the above picture (debug info):

2012.02.28 17:45:03     NEXUS-1 EURUSD,M15: Alert:
Bar Time[]/Open[] Value: 1330443000-1.34146 <-- Time of 1330443000 is open time of new bar after the price gap, with Open[] price value of 1.34146
TickData Array entries from that time onward:
1330443000-1.33980 <-- Price mismatch in internal TickData Array for that same time period, continuing on...
1330443001-1.33983
1330443002-1.33987
1330443002-1.33994
1330443003-1.34003
1330443003-1.34000
1330443004-1.34001
1330443005-1.33999 <-- How can it be that even 5 seconds later into that bar, the price recorded by EA internal 'TickData' array is 1.33999, when the 'Low' value for that WHOLE bar is 1.34132 ?!?!?!?!?!?!?

It seems that even 5 seconds AFTER open time of NEW bar (at time of 1330443000), the EA somehow is still receiving prices of the previous bar which came BEFORE the data gap (i.e. 17 minutes earlier)!!!

Can anyone tell me how this is possible??

i.e. the function MarketInfo(Symbol(), MODE_TIME) and the Bid price inside the EA do not match, when compared to the data on the chart!!!

Any takers?

Thanks,

nanquan

 

http://www.onlineconversion.com/unix_time.htm

1330443005 = Tue, 28 Feb 2012 15:30:05 GMT not 15:40:05 Your chart and your values don't correspond.

 
WHRoeder:

http://www.onlineconversion.com/unix_time.htm

1330443005 = Tue, 28 Feb 2012 15:30:05 GMT not 15:40:05 Your chart and your values don't correspond.



Wow you are correct! I didn't even notice that... very strange indeed!

So according to the chart it seems that between 15:24 and 15:40 there is no data at all, and yet the EA has recorded price information from around 15:30...

Then, according to the chart, open time of new bar at 1.34146 is 15:40, when according to EA internal series array Time[0] it is 15:30, and on the chart NO BAR EXISTS AT 15:30!!!

This is very bizarre indeed!!!

Does anyone have any ideas as to what the heck is going on here??? :|

 

It's not very strange actually. The new "trend" (actually it started approx. in 2008-2009, during the sharp wave of the crysis) is that some Dealing centres started to send ticks by "packets" (5-10 or even more ticks in a pack), and the inconsistency in actual ticks and their bars representation is very common.

It's absolutely no good for the trader but who cares?! It's very profitably for the DC not to provide the actual tick history to the trader.

Maybe in some future the missing bar will appear, and the history will be "normal". Remaking history retroactively is so common, and it also means that there is no reliable history to be tested on...

I don't know the contemptuous English name for such DCs but we Russians call these "cooking rooms". This term goes for the "broker" which doesn't have any relation to the real FOREX, and all "deals" are accomplished inside.

So the only thing you can do here is to Refresh the chart.

 
Mathemat:

It's not very strange actually. The new "trend" (actually it started approx. around 2008-2009, during the sharp wave of the crysis) is that some Dealing centres started to send ticks by "packets" (5-10 or even more ticks in a pack), and the inconsistency in actual ticks and their bars representation is very common. I don't know the contemptuous name for such DCs but we Russians call these "cooking rooms".

It's absolutely no good for the trader but who cares?! It's very profitably for the DC not to provide the actual tick history to the trader.

Maybe in some future the missing bar will appear, and the history will be "normal". Remaking history retroactively is so common...

So the only thing you can do here is to Refresh the chart.

Thanks for your input, Mathemat, but from what you said I don't think this is what's happening here, for a few reasons:

1. Firstly, hitting "refresh", or restarting MT4 for that matter does nothing. Suggesting these are actually price gaps on the server side as well.

2. My broker (FXCM) is a non-dealing desk broker, so they would have no reason to manipulate the data in such a way.

3. Even if they had a dealing desk, this is still only a demo account. Such practices would only benefit the DC on a live account. On a demo account it would actually scare potential customers away.

4. I already contacted FXCM about this, and apparently this is caused due to an overload on the demo server, as they have all demo accounts setup on a single server (unlike live accounts spread over many many servers).

5. The REAL question here is the inconsistency between internal EA functions, and the data that is being displayed in the chart, after prices resume incoming.

So here is this strange problem:

Inside the EA, the value of Open[0] is correct and corresponds with the open value of the bar on the chart (after prices resume incoming).

However, at the same time the corresponding value of Time[0] is incorrect, and indicates a bar that doesn't even exist which "opened" 10 minutes before.

So only Time[0] is incorrect. Open[0] returns the correct value! This whole problem is a result of error in Time[0].

So what is it in the way Time[0] is calculated that can explain this behavior?

Thank you!!!!!

nanquan

 

I FIGURED OUT THE ANSWER!!! IT'S SO SIMPLE (AND STUPID)!!!

I actually forgot to mention this KEY piece of information!!

My EA is operating on the M15 time frame. Therefor any call to internal series array Time[] on time frame M15 will result in it returning time for bar range of 15 minutes!

In the above example, the chart is from time frame M1. While price data resumed @ 15:40 if looking on M1, in time frame of M15 it would still be considered as part of bar which "opened" at 15:30!!!

This is why Time[0] returned the value of 15:30, while actual prices resumed incoming only at 15:40!!

However, that still doesn't explain how at 15:30 the EA recorded Price changes, when according to the chart on M1 time frame there is no data between 15:23-15:40 at all.

Is the chart lying???

 

OK, I see, FXCM has some problem. I can't help you, only FXCM will.

Let's assume it's simply a bug on the server side. I don't think they will explain you the real thing in all details. They will simply try to fix it.

Reason: