Indicator getting corrupted - page 3

 
AnkaSoftware:

JIC, Please note the problem does not occur on 32 bit platforms. I have provided some code in one of the earlier posts.

You've got two (or more) separate machines which are not necessarily receiving exactly the same data. For example, the 64-bit system could be on a busy VPS node which occasionally loses traffic and/or connections, e.g. because the physical node is operating at extremes of processor usage or bandwidth. (Many other possible explanations; that's just one.)

Until you understand why the drawing of whatever the purple lines are stops when there's a gap in the M1 bars, then I'd treat everything else as coincidence.

I'll close by returning to my opening statement: there's no reason why 64-bit Windows should cause any problems like the ones you are describing. Many people have raised reports on this forum that MT4 doesn't work properly on platforms x, y, and z, only for it eventually to turn out that the problem was with their code. You have either discovered the first bona-fide MQL4 bug in several years in a mature piece of software used by literally millions of people, or the problem is with your code. It is overwhelmingly likely from the evidence so far - e.g. separate reports from you that the problem occurs either after 16 hours or after 3-4 hours - that the problem is caused by occasional fluctuations in the data which you are not catering for properly.
 

AnkaSoftware:

a) Corruption of indicators happens only on Windows 64 bit platform

d) Code use is as follows

Declarations

<code>

#property indicator_chart_window



  1. Don't install in \Program Files* on Vista/Win7
  2. void DrawMoveEx(double& serie[], int start, int end, double startlevel, double endlevel) {
    double a = (endlevel - startlevel) / (start - end);
    double y;
    int bar;
    for(int x = 0; x <= start - end; x++) {
    y = a * x;
    bar = start - x;
    serie[bar] = startlevel + y;
    }
    }
    Not sure what you're trying to do here. For one you're computing a lot of values (start..end) but only storing ONE (serie[bar]) I'd code it:
    void DrawMoveEx(double& serie[], int start, int end, double startlevel, double endlevel) {
       double a = (endlevel - startlevel) / (start - end);
       for(int x = start; x <= end; x++) serie[x] = a * x + startlevel;
    }

 
Enclosed is sample indicator, which will reproduce the problem. On 64 bit Windows platform, attach indicator to a M1 chart, and let it run for 4+ hrs.
Files:
 
AnkaSoftware:
Enclosed is sample indicator, which will reproduce the problem. On 64 bit Windows platform, attach indicator to a M1 chart, and let it run for 4+ hrs.
Sorry, don't have the patience to allocate a clean 64-bit machine to this and then wait 4 or more hours.

However, if this indicator really does reproduce the problem then I must agree that it's interesting. I can't immediately see where any internal problem could be hiding. (Assuming, as before, that you have definitely ruled out things like a correlation between the problem occurring and a recent blip in connection between MT4 and the broker. You've mentioned your faith in CNS; you haven't actually confirmed that the MT4 journal contains no mention of connection problems, which in turn could be causing back-filling of the bar history.)

If you want to pursue the route of an MT4 problem, then it seems most likely to be related to passing the indicator arrays by reference. Arrays in MQL4 have strange properties such as always being static, and I suppose it is just possible that there is a weird latent issue with passing the special indicator-buffer arrays by reference which only triggers problems on Win64. Though why the operating system should make a difference in a context such as this remains a complete mystery.

I would try altering DrawMoveEx() so that it no longer takes a reference to the indicator array, and instead there are separate functions such as DrawMoveEx_Down1(), DrawMoveEx_Up1() etc which simply address the buffers as global variables. If that makes a difference then, congratulations, you've almost certainly found yourself an MT4 bug. Possibly the second one today.
 
AnkaSoftware:
Enclosed is sample indicator, which will reproduce the problem. On 64 bit Windows platform, attach indicator to a M1 chart, and let it run for 4+ hrs.
Been running for over 5hrs on Windows 7 Ultimate 64 bit, no problems.
 
RaptorUK:
Been running for over 5hrs on Windows 7 Ultimate 64 bit, no problems.

JIC a) As suggested by you modified the code remove passing the reference, does not fix the problem. Modified code enclosed.

b) The missing bars which you are referring to, most probably due to no trade condition, hence broker sent no bars. IMHO, in case of loss of connectivity, the missing bars are available once the connection is restored. If you see my sample code, there is no dependency on bars being contiguous

Raptor, Thanks for testing. Maybe you need to joom in to see the error. I am able to reproduce the problem on Windows Server 2008 R2 Enterprise. So could be an O/S issue. Any idea, from where to get a list of MT4 recommended patches, for a particular platform.

.

Files:
 
AnkaSoftware:

Any idea, from where to get a list of MT4 recommended patches, for a particular platform.

No such thing exists. There is simply one version of MT4 which runs on all versions of Windows, and there is no particular reason why there should need to be more than one. There are no OS-specific versions or patches.
 
AnkaSoftware:
Enclosed is sample indicator, which will reproduce the problem. On 64 bit Windows platform, attach indicator to a M1 chart, and let it run for 4+ hrs.
Still running OK as far as I can tell . . . how do I reproduce the error ?
 
RaptorUK:
Still running OK as far as I can tell . . . how do I reproduce the error ?
You dont have to do anything. Other than zoom into the chart to see if the error has occurred.
 
AnkaSoftware:
You dont have to do anything. Other than zoom into the chart to see if the error has occurred.

If I'm looking for lines that seem to be disconnected from the chart bars (as per your first post) then I'm not getting any problems.

Reason: