Indicator getting corrupted - page 2

 
jjc:

For example, if it's currently 8am, anything in the code which assumes that (a) the bar for 7am is 60 bars ago, or even (b) that a bar for 07:00 exists at all.

Good point, I hadn't appreciated that the charts were M1 when I first looked at them . . . it's quite common for M1 bars to be missing at quiet times, overnight for example.
 
RaptorUK:
Good point, I hadn't appreciated that the charts were M1 when I first looked at them . . . it's quite common for M1 bars to be missing at quiet times, overnight for example.
In this instance I think it's more likely to be a temporary loss of connection to the broker, but the principle and implications are the same.
 
jjc:
In this instance I think it's more likely to be a temporary loss of connection to the broker, but the principle and implications are the same.
...It's also notable in the "Move Error" screenshot that the purple lines stop getting drawn at the point where it looks as though there's a missing M1 bar.
 
AnkaSoftware:

Hmm, "new historical data isadded to the chart ", how? The indicator is started and left undisturbed. We have a fixed lookback of 1000 bars. The indicator is not loading any historical data.

Can somebody from development team have a look at this?

You said . . . "
I have developed an indicator which runs fine for the first 16 hrs or so" . . . 16 hrs x 60 mins = 960 bars . . . what happens if you reduce your lookback to 500 bars, do you get problems after 8 hrs ?
 

Jic, Thanks for the observations.

The tests are being done on a CNS VPS server with reliable connection and the Demo account used for testing are with brokers IBFX and VantageFX

I do a RefreshRates() at every tick and use normal timeseries functions to access the bar data. The code used to update the indicators is given in my earlier post see function DrawMoveEx. I believe the TimeSeries does not have missing bars from 0 to 'Bars -1'. Let me know if this assumption is incorrect.

An enclosing another snapshot, with correct time scale, and no scrolling to the right (with current IBFX data).

Did you get a chance to look at the excel file enclosed in post 2011.10.07 15:30

 

AnkaSoftware:
I believe the TimeSeries does not have missing bars from 0 to 'Bars -1'. Let me know if this assumption is incorrect.

That assumption certainly appears to be incorrect because your original "Move Error" screenshot has 16 bars between each X-axis marker - you can count them for yourself - but one of the periods covers 21 rather than 16 minutes. And, as RaptorUK says, it's not an assumption which you can safely make in your code. There isn't necessarily going to be a trade every single minute of the day - though I'd be surprised if there wasn't on GBPUSD outside of major holidays - and therefore there isn't necessarily going to be an M1 bar for every single minute.

If you believe that there are no missing bars - when it's demonstrably the case that there are missing bars in one of your screenshots - then you are probably coding based on that assumption/belief. I wouldn't regard your latest screenshot as counter-evidence, because there could be (a) missing data prior to the period shown on the screenshot which (b) is somehow affecting the calculations for the bars which are shown in the screenshot.

The single most suspicious thing is that the purple lines stop in the original screenshot during the period where there's clearly a missing bar. I couldn't comment further, or make analysis of your spreadsheets, without seeing the full code.

 
AnkaSoftware:

Jic, Thanks for the observations.

The tests are being done on a CNS VPS server with reliable connection and the Demo account used for testing are with brokers IBFX and VantageFX

I do a RefreshRates() at every tick and use normal timeseries functions to access the bar data.

Probably not a cause of your issue, but . . RefreshRates() makes no difference if you are using these Functions: https://docs.mql4.com/series RefreshRates only refreshes these variables: https://docs.mql4.com/predefined/variables
 
jjc:

That assumption certainly appears to be incorrect because your original "Move Error" screenshot has 16 bars between each X-axis marker - you can count them for yourself - but one of the periods covers 21 rather than 16 minutes. And, as RaptorUK says, it's not an assumption which you can safely make in your code. There isn't necessarily going to be a trade every single minute of the day - though I'd be surprised if there wasn't on GBPUSD outside of major holidays - and therefore there isn't necessarily going to be an M1 bar for every single minute.

If you believe that there are no missing bars - when it's demonstrably the case that there are missing bars in one of your screenshots - then you are probably coding based on that assumption/belief. I wouldn't regard your latest screenshot as counter-evidence, because there could be (a) missing data prior to the period shown on the screenshot which (b) is somehow affecting the calculations for the bars which are shown in the screenshot.

The single most suspicious thing is that the purple lines stop in the original screenshot during the period where there's clearly a missing bar. I couldn't comment further, or make analysis of your spreadsheets, without seeing the full code.

Raptor, Will check on "what happens if you reduce your lookback to 500 bars, do you get problems after 8 hrs ?" and revert.

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

 
AnkaSoftware:
I believe the TimeSeries does not have missing bars from 0 to 'Bars -1'. Let me know if this assumption is incorrect.

Of course not, there are Bars candles numbered 0 through Bars-1. ArraySize(Close) == Bars always.

However there are always skipped bars. from Fri 21:59z the next bar is Sun 22:00z. Weekends and Holidays and minutes with no activity.

You can not assume that Time[x] == Time[x+1] + 60*Period() it won't be on a skipped bar.

If you want help with YOUR indicator, post YOUR code - no mind readers here.

 
AnkaSoftware:

Some further info -

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

b) I have taken a dump of the indicator array before corruption and after corruption - the same are available in the enclosed xls file with comments.

Take a look at the Unix time values in your spreadsheet, the gaps between each adjacent values should be 60, 60 seconds, there are a few 240 second gaps and at least one 120 second gap. Is your code designed to handle missing M1 bars ?