Download MetaTrader 5
To add comments, please log in or register
Do you want to learn MQL5? 300 articles will help you!
Jeysun
104
Jeysun 2014.03.08 06:19 

An indicator I've used to show currency slope strength has stopped working after the market closed today. The indicator is the type that opens up separately below the main chart. I've used this indicator for months on two different computers and for the first time ever, it has stopped showing anything on both. I've tried rebooting to no avail. I have multiple MT4 instances installed on the same computer and the indicator doesn't show up on any of them- even with different broker's MT4 platforms. The data window shows no data for the indicator. I'm using MT4 version 4.0 build 610 which I updated to a few weeks ago. The indicator does require a lot of CPU power and usually takes a few seconds to read the history of currency pairs.

Has there been a change to the way MT4 operates?

A bug in MT4? A bug in the indicator? (attached)

Files:
Alain Verleyen
Moderator
28651
Alain Verleyen 2014.03.08 12:16  
jeysun:

An indicator I've used to show currency slope strength has stopped working after the market closed today. The indicator is the type that opens up separately below the main chart. I've used this indicator for months on two different computers and for the first time ever, it has stopped showing anything on both. I've tried rebooting to no avail. I have multiple MT4 instances installed on the same computer and the indicator doesn't show up on any of them- even with different broker's MT4 platforms. The data window shows no data for the indicator. I'm using MT4 version 4.0 build 610 which I updated to a few weeks ago. The indicator does require a lot of CPU power and usually takes a few seconds to read the history of currency pairs.

Has there been a change to the way MT4 operates?

A bug in MT4? A bug in the indicator? (attached)

Hi,

I can't see a problem with this indicator.


Jeysun
104
Jeysun 2014.03.08 14:53  
angevoyageur:

Hi,

I can't see a problem with this indicator.




This is how mine looks.

Alain Verleyen
Moderator
28651
Alain Verleyen 2014.03.08 15:52  
jeysun:


This is how mine looks.

Is there any output in the logs (Experts tab or Journal tab) ?
Jeysun
104
Jeysun 2014.03.09 05:08  
angevoyageur:
Is there any output in the logs (Experts tab or Journal tab) ?

I do get a zero divide error. I'm not sure, but I think it has always had that error and the indicator still worked.


I have a suspicion that it has something to do with daylight savings time starting this weekend and the connection to brokers. Maybe it will fix itself when the market re-opens.

Alain Verleyen
Moderator
28651
Alain Verleyen 2014.03.09 09:40  
jeysun:

I do get a zero divide error. I'm not sure, but I think it has always had that error and the indicator still worked.


I have a suspicion that it has something to do with daylight savings time starting this weekend and the connection to brokers. Maybe it will fix itself when the market re-opens.

The new mql4 doesn't allow this kind of error any more.

The error is in this line (583) :

currencyValues[i] /= currencyOccurrences[i];

In some cases you have currencyOccurrences[i]=0 and so you are trying to divide by 0.

Jeysun
104
Jeysun 2014.03.09 18:35  
angevoyageur:

The new mql4 doesn't allow this kind of error any more.

The error is in this line (583) :

In some cases you have currencyOccurrences[i]=0 and so you are trying to divide by 0.



Thank you for your help.

I eliminated the error in the code by doing the following:

A. Changed all occurrences of StringSubstr to StringSubstrOld

B. Added the function

string StringSubStrOld(string x,int a,int b=-1)
{
if (a < 0) a= 0; // Stop odd behaviour
if (b<=0) b = -1; // new MQL4 EOL flag
return StringSubstr(x,a,b);
}

This eliminated the zero divide error, but unfortunately the indicator still does not show anything at this time. I attached the revised indicator.

In fact, it seems that all indicators I have that looks at multiple pairs, have stopped working at the same time.

Alain Verleyen
Moderator
28651
Alain Verleyen 2014.03.09 18:51  
jeysun:


Thank you for your help.

I eliminated the error in the code by doing the following:

A. Changed all occurences of StringSubstr to StringSubstrOld

B. Added the function

This eliminated the zero divide error, but unfortunately the indicator still does not show anything at this time. I attached the revised indicator.

In fact, it seems that all indicators I have that looks at multiple pairs, have stopped working at the same time.

Sorry but I don't see how the change you made are related to the "zero divide" error ? I pointed you to the line where the error is.

Also as previously stated your indicator is working for me, but I use the default settings.

Jeysun
104
Jeysun 2014.03.09 22:27  
angevoyageur:

Sorry but I don't see how the change you made are related to the "zero divide" error ? I pointed you to the line where the error is.

Also as previously stated your indicator is working for me, but I use the default settings.



It was as I suspected. The problem fixed itself once the market re-opened and holds true across different brokers. I do not even get the "zero divide" error anymore. This indicator has always worked before when the market is closed until this weekend, which leads me to believe it is due to daylight savings time beginning.

It is definitely hard to diagnose something when you're not having the same problem. The changes I made were suggested on another site for code to be compatible with Build 610, though the modified indy does not work.

I use an EA I programmed which trades using the original indicator posted, so it was important to me to get this working again.

I would hope this thread would help others that come across this issue even though it is a very temporary issue.

And thanks to angevoyageur (although I'm still not sure why the indicator worked for you and mine did not while the market was closed)

/
To add comments, please log in or register