Recursive indicators adding on Expert Advisor

 

Goor afternoon guys,

I am currently coding an Expert Advisor to automagically trade for me. I already got the indicators, their respective buffers, the names and all of them are on the correct folder. I am using the iCustom() function to read out the buffer values and perform calculations. So far so good.

For a particular reason which I do not understand, whenever I run the Expert Advisor on the Strategy Tester from MT4, no matter how many days/months/hours, it inputs an ABSURD amount of indicators on the chart. For instance, if 20 minutes have passed, there will be at least 20 indicators and that crashes my computer after letting it run for a few minutes.

Is there a way to fix this in my code?

I share the Expert Advisor code so you can check on it!

Please advise!!

 

Place the situation of the terminal on the chart using TerminalInfoInteger().

If you would use MT5 you would have more options...

Could it be that you change the parameters of the indicators called by iCustom(..)? It would mean that again and again new indicators are created until your free ram was eaten up.
Client Terminal Properties - Environment State - Constants, Enumerations and Structures - MQL4 Reference
Client Terminal Properties - Environment State - Constants, Enumerations and Structures - MQL4 Reference
  • docs.mql4.com
Client Terminal Properties - Environment State - Constants, Enumerations and Structures - MQL4 Reference
 

Hi

There might be also the problem with the custom indicators themselves – they may have somewhere in the code the recurrence calling and everytime the calculation s made they call a new instance of the indicator with slightly different settings.

If possible chech also the code from indicators.

Have a nice weekend

Reason: