Possible Make an indicator not lag or have so much CPU usage?

 

Hello, please can anyone fix or alter this indicator it is TMA bands. I like to use this indicator but the problem is that it really very much lags my mt4 platform and causes it to skip much and often times cause it to freeze entirely. I am using range bars too, whenever market is active and new candles are created at the same time while this indicator is on it will freeze. I am monitoring 6 charts. I am sure it is this particular indicator causing the problem because everything does not skip at all once it is removed. Please help.

Regards, Jtma.ex4tma.mq4

Files:
tma.ex4  35 kb
tma.mq4  14 kb
 
justin7:
Hello, please can anyone fix or alter this indicator it is TMA bands. I like to use this indicator but the problem is that it really very much lags my mt4 platform and causes it to skip much and often times cause it to freeze entirely. I am using range bars too, whenever market is active and new candles are created at the same time while this indicator is on it will freeze. I am monitoring 6 charts. I am sure it is this particular indicator causing the problem because everything does not skip at all once it is removed. Please help. Regards, Jtma.ex4tma.mq4

Corrected the changes that were obvious errors : tma.mq4

Did not correct the multi time frame errors (that I leave to "eni" to correct since none of the additional bands are processed in multi time frame mode). It takes in average 1-2% cpu time on my terminal now

____________________

PS: when you test the cpu overload, do not move the mouse on the chart. Even on an empty chart, that can cause cpu overload (a "present" from mt in new mt4). Try it out and you will be able to block terminal if you drag the mouse around on the chart quickly enough. That does not have anything to do with any indicator

Files:
tma.mq4  13 kb
 
mladen:
Corrected the changes that were obvious errors : tma.mq4

Did not correct the multi time frame errors (that I leave to "eni" to correct since none of the additional bands are processed in multi time frame mode). It takes in average 1-2% cpu time on my terminal now

____________________

PS: when you test the cpu overload, do not move the mouse on the chart. Even on an empty chart, that can cause cpu overload (a "present" from mt in new mt4). Try it out and you will be able to block terminal if you drag the mouse around on the chart quickly enough. That does not have anything to do with any indicator

thankyou mladen I will test this one out. I understand about the mouse moving it was however more than this. The terminal would freeze often as well. Thankyou appreciate it

Regards, J

 

Should interpolate be left on as well?? What does this feature do

 
mladen:
Corrected the changes that were obvious errors : tma.mq4

Did not correct the multi time frame errors (that I leave to "eni" to correct since none of the additional bands are processed in multi time frame mode). It takes in average 1-2% cpu time on my terminal now

____________________

PS: when you test the cpu overload, do not move the mouse on the chart. Even on an empty chart, that can cause cpu overload (a "present" from mt in new mt4). Try it out and you will be able to block terminal if you drag the mouse around on the chart quickly enough. That does not have anything to do with any indicator

hello mladen thankyou for your coding but it still seems to lag Could this be because of it not being able to work well with range bars because so many new candles can be created? :/

 

Here is the range bar indicator I am currently using. Is possible to speed this one or reduce the cpu measure on this one too? It is so difficult to trade with so much lag :/

 
justin7:
Here is the range bar indicator I am currently using. Is possible to speed this one or reduce the cpu measure on this one too? It is so difficult to trade with so much lag :/

Justin7, it's not possible to modify an ex4 file.

 

111range_bars_ea_new_format_1.mq4

Please what about this one? Can be made to reduce cpu measure?

 
justin7:
111range_bars_ea_new_format_1.mq4 Please what about this one? Can be made to reduce cpu measure?

Justin7, maybe try this one here: https://www.mql5.com/en/forum/178540/page29 and instead of the default 8000 MaxBars maybe make it less to around 2000 bars.

 

What seems to happen is everytime that there is a sudden high volume of ticks or a move happens which moves multiple pairs at the same time atleast by a few pips or perhaps 5-10 it suddenly lags completely and freezes up and by the time it unfreezes the move is a bit far off from where price originally was along very suddenly

 

I really wish these were faster and did not make the mt4 freeze so I do not lose pips and get a late entry