The indicator is too slow, rewrite the indicator

 

Hi !

Here's the error message I get using and indicator on a EA. It worked perfectly, then show that.

Unfortunately, I restarted the terminal so I can't copy past the exact log.

Anyone has experienced such an error ?

PS : it worked 'til now.

 
blouf:

Hi !

Here's the error message I get using and indicator on a EA. It worked perfectly, then show that.

Unfortunately, I restarted the terminal so I can't copy past the exact log.

Anyone has experienced such an error ?

PS : it worked 'til now.

Maybe the indicator need any pair of currency that doesn't available in your broker?
 
blouf:

Hi !

Here's the error message I get using and indicator on a EA. It worked perfectly, then show that.

Unfortunately, I restarted the terminal so I can't copy past the exact log.

Anyone has experienced such an error ?

PS : it worked 'til now.

I saw that message, for a well working indicator, on a very slow computer.
 
angevoyageur:
I saw that message, for a well working indicator, on a very slow computer.

Hi angevoyageur !

I couldn't see any topics related to such an error message. Good news that I don't have to rewrite the thing.

Thanks for your precision, I was desperatly wondering how to quick up an indicator :p

 
blouf:

Hi angevoyageur !

I couldn't see any topics related to such an error message. Good news that I don't have to rewrite the thing.

Thanks for your precision, I was desperatly wondering how to quick up an indicator :p

If there are things that dont need to be calculated with every tick , you can restrict those to be processed on every new candle.

For instance , if you are peeking at the H1 MA from M1 , you only need to do it at every M1 candle close , or (if you rely on candle 1 data) from H1 candle close
 

This error occur when you have not enough memory. Even if you process only after bar closed. It's not an "every ticks" issue (may be with a slow computer).

If you have many indicators, and many graphics the key param is "Max bars in chart". May be you are used to set a big number because of back testing requirement.

When you are not testing, i.e. production with a VPS, you dont need a high max bars in chart.

Usualy you test an develop on a PC with, 2,4, 8GB memory.

Then you go to a VPS with 1 or 2 GB memory. 

If you forgot to lower max bar in chart, memory used by indicators are pagined. Then when the bar is closed, your EAs call indicators and Windows load from pagined memory the buffers used by indicators. And it takes 1,2 ... 4 seconds if you have several graphics who share memory in competition. Unfortunately, bars are close at the same time from differents symbols :-)

Then the warning message come.

So rather than rent more memory on your VPS, check the Max bars in chart parameters. 

 
JFB:

This error occur when you have not enough memory. Even if you process only after bar closed. It's not an "every ticks" issue (may be with a slow computer).

If you have many indicators, and many graphics the key param is "Max bars in chart". May be you are used to set a big number because of back testing requirement.

When you are not testing, i.e. production with a VPS, you dont need a high max bars in chart.

Usualy you test an develop on a PC with, 2,4, 8GB memory.

Then you go to a VPS with 1 or 2 GB memory. 

If you forgot to lower max bar in chart, memory used by indicators are pagined. Then when the bar is closed, your EAs call indicators and Windows load from pagined memory the buffers used by indicators. And it takes 1,2 ... 4 seconds if you have several graphics who share memory in competition. Unfortunately, bars are close at the same time from differents symbols :-)

Then the warning message come.

So rather than rent more memory on your VPS, check the Max bars in chart parameters. 

Hum I see ! Since I found a workaround, rewriting the indicator algorithms inside the EA shows better performances. Anyway, thanks, I never thought of the max bars parameters.
 
blouf:
Hum I see ! Since I found a workaround, rewriting the indicator algorithms inside the EA shows better performances. Anyway, thanks, I never thought of the max bars parameters.

On a VPS, it now shows this error with an other indicator (should I rewrite it to ?!), but it worked 'til now, it worked during optimization test ... This may be because of the server speed ?

Array out of Range
 
blouf:

On a VPS, it now shows this error with an other indicator (should I rewrite it to ?!), but it worked 'til now, it worked during optimization test ... This may be because of the server speed ?

This is definitely an error in your code. The error message contains line number where it happens.
 
marketeer:
This is definitely an error in your code. The error message contains line number where it happens.
Hm ..  it happens that the chart goes out of standard patterns. does it unload something ? the indicator ? or the ea go along ?
 
angevoyageur:
I saw that message, for a well working indicator, on a very slow computer.
thx.