Re: MT4 Indicators with alerts/signals

4351
srinarayani13 wrote: Wed Oct 29, 2025 10:11 pm Thank you so much for perfect coding, God bless you.

When applying this indicator on chart its taking too long to come on chart and mt4 get hanged if I shift time frame, normally all indicator get applied instantly

if possible can you please check, does any part of code is calculating to much ???
Try reducing the number of bars it uses to calculate by simply changing Maximum Bars from 0 to 250 and see if that solves the problem.
These users thanked the author global for the post:
srinarayani13


Re: MT4 Indicators with alerts/signals

4352
srinarayani13 wrote: Wed Oct 29, 2025 10:11 pm Thank you so much for perfect coding, God bless you.

When applying this indicator on chart its taking too long to come on chart and mt4 get hanged if I shift time frame, normally all indicator get applied instantly

if possible can you please check, does any part of code is calculating to much ???
Try now!
These users thanked the author mrtools for the post (total 2):
srinarayani13, ashdays

Re: MT4 Indicators with alerts/signals

4353
srinarayani13 wrote: Wed Oct 29, 2025 10:11 pm Thank you so much for perfect coding, God bless you.

When applying this indicator on chart its taking too long to come on chart and mt4 get hanged if I shift time frame, normally all indicator get applied instantly

if possible can you please check, does any part of code is calculating to much ???
Also, you can reduce the "Max bars in chart" to 5000 or even 1000, which is what I use. That will significantly reduce the CPU load and memory MT4 uses. To change the "Max bars in chart", from the top MT4 menu, just click on Tools->Options->Charts then select or type in the smaller value into the "Max bars in chart" field. Whatever smaller value you use, make sure that all the indicators you use don't need more than that number of bars.
These users thanked the author global for the post:
srinarayani13

Re: MT4 Indicators with alerts/signals

4355
global wrote: Thu Oct 30, 2025 1:39 am Hi Mr. Tools, I always thought that one loop is always faster than 3 loops but maybe that's only in theory but not in practice.
Yes, I think one loop is better but from my experience IMAOnArray() must be on a separate loop from the main loop. Far as I am aware that applies to other built in OnArray()'s as well. A lot of times will just use custom indicator functions as a way around that.
These users thanked the author mrtools for the post (total 2):
global, srinarayani13