Page 436 of 436

Re: MT4 Indicators with alerts/signals

Posted: Wed Oct 29, 2025 11:58 pm
by global
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.

Re: MT4 Indicators with alerts/signals

Posted: Thu Oct 30, 2025 12:28 am
by mrtools
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!

Re: MT4 Indicators with alerts/signals

Posted: Thu Oct 30, 2025 1:34 am
by global
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.

Re: MT4 Indicators with alerts/signals

Posted: Thu Oct 30, 2025 1:39 am
by global
mrtools wrote: Thu Oct 30, 2025 12:28 am Try now!
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.

Re: MT4 Indicators with alerts/signals

Posted: Thu Oct 30, 2025 2:04 am
by mrtools
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.