How to close a function within the EA
Results 1 to 5 of 5

Thread: How to close a function within the EA

  1. #1
    Hi there I am still new to programming MQL4 , I am useing an iCustom() function and it has initialised in the start of my code. . Now if it receives initialised , how can I deinitialise it without having to restart my EA...

    I need to do this because everytime it lots (with every tick) it has saved in memory and no matter how much memory you have this will eventiually run out and your stuck with the error:

    Memory handler : can't devote 630892 bytes of memory

    any ideas how to overcome this?

    Thank you a bunch!

  2. #2
    You may only acquire a value, never to call it from your EA
    I've told you to use a factor to acquire certain value from the purpose
    Inserted Code dual whatever_it_is = iCustom(parameters)

  3. #3
    It seems like you are in a situation that is nasty. You can look at restructuring your code so that iCustom isn't called for every single tick. If that is not possible, then you have to incorporate the indior's code.

  4. #4
    hey xlr8er.... We've got a saying over here you might find interesting....

    what happens in vegas stays in vegas....

    Likewise, what is initialized in the init stays in the init....

    Should you put in a value in the init section and don't reassign it at the start function, it keeps it's first startup worth....

    Have a look at the code.... Slowly run an visual backtest and observe the comments.... Both the macd and ask variables change.... Both the initask and initmacd, that have been assigned in the init department keep their very first value....


    //--
    we're really only imagining without more specific information.... And that are my very best guess at a solution....

    Assign the icustom variable in the init section just...h
    https://www.nigeriaforextrading.com/...6636562454.mq4

  5. #5
    I really do believe your premise isn't accurate. (External) Function code has loaded once on it's first call, then it stays in memory and isn't reloaded again. It may get paged out, but this is out of your hands. If you are currently running out of memory, there is most likely a different problem. Processing tick-by-tick is a waste of CPU unless it is necessary, but this is a separate problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.