• Please try to select the correct prefix when making a new thread in this folder.

    Discuss is for general discussions of a financial company or issues related to companies.

    Info is for things like "Has anyone heard of Company X?" or "Is Company X legit or not?"

    Compare is for things like "Which of these 2 (or more) companies is best?"

    Searching is for things like "Help me pick a broker" or "What's the best VPS out there for trading?"

    Problem is for reporting an issue with a company. Please don't just scream "CompanyX is a scam!" It is much more useful to say "I can't withdraw my money from Company X" or "Company Y is not honoring their refund guarantee" in the subject line.
    Keep Problem discussions civil and lay out the facts of your case. Your goal should be to get your problem resolved or reported to the regulators, not to see how many insults you can put into the thread.

    More info coming soon.

Discuss EA Makes MetaTrader slow after sometime

General discussions of a financial company

shanmugapradeep

Corporal
Messages
88
Hello,

I engage in algo trading with the assistance of an EA using Metatrader 4. However, I've encountered an issue where my MT4 becomes extremely slow after a few weeks due to the accumulation of temporary files from Metrader 4 and the EA. The EA consistently places a large number of objects on the chart.

Could you please provide a solution for this?

1. How can I clear the temporary files and caches of Metatrader 4, as well as remove objects from charts?
2. If I regularly clear temporary files and caches, will this affect the operation of the running EA?

Thank you.
 
Hello,

I engage in algo trading with the assistance of an EA using Metatrader 4. However, I've encountered an issue where my MT4 becomes extremely slow after a few weeks due to the accumulation of temporary files from Metrader 4 and the EA. The EA consistently places a large number of objects on the chart.

Could you please provide a solution for this?

1. How can I clear the temporary files and caches of Metatrader 4, as well as remove objects from charts?
2. If I regularly clear temporary files and caches, will this affect the operation of the running EA?

Thank you.
Which system are you using?
Windows, Mac or Linux?
 
Hello,

I engage in algo trading with the assistance of an EA using Metatrader 4. However, I've encountered an issue where my MT4 becomes extremely slow after a few weeks due to the accumulation of temporary files from Metrader 4 and the EA. The EA consistently places a large number of objects on the chart.

Could you please provide a solution for this?

Is this an EA you purchased? Or do you own the source code of the EA / program it yourself?

1. How can I clear the temporary files and caches of Metatrader 4, as well as remove objects from charts?

If you program yourself, you can create an option to delete objects after xx days or hours. and 0 would mean deleting the object immediately after the object is created. This should also be done when running tester mode also. But when running in visual mode, you could turn this on so you can see the objects. But try to limit it to just a couple of days or weeks....especially if you are making 20+ trades per day and have many complex functions that need to be recalculated onTick()

Now if you DO NOT own the EA, you could create some AutoHotKey or AutoIT script to interact with the terminal and clear out the chart objects daily or as often as you like. But this is not very ideal....this should be done at the source code level.

2. If I regularly clear temporary files and caches, will this affect the operation of the running EA?
you could run a CMD script to delete and/or zip these files to keep the hard drive space lite. Now the current day's logs would be locked. But other days would zip or delete just fine. If you need to preserve logs for a period of time (like 2-4 weeks), zipping is a good compromise that saves space.

also, always run your metatrader terminal in /portable mode. And keep everything in the install folder. And install mt4 outside of program_files folder. This keeps everything organized and in one place, with as little Windows OS interference as possible.


FPA forum is usually not the best for technical problems on programming EA. MQL4 , ForexFactory, and even stackexchange would be better solutions.
 
Is this an EA you purchased? Or do you own the source code of the EA / program it yourself?
Freelancer programmer created for me based on my requirement. I have source file.

If you program yourself
I am not a coder but i can understand a little

you can create an option to delete objects after xx days or hours.
I did but it not working, Here is my code


Code:
// Timer function to clear all objects on the chart
void Timer()
{
    // Iterate through all objects on the chart and delete them
    for (int i = ObjectsTotal(); i >= 0; i--)
    {
        string objName = ObjectName(i);
        if (StringLen(objName) > 0)
        {
            ObjectDelete(objName);
        }
    }
}

// Initialization function
int Init()
{
    // Set a timer to call OnTimer() function every 5 min
    EventSetMillisecondTimer(5 * 60 * 1000);
   
    return(0);
}

// Deinitialization function
void deinit(const int reason)
{
    // Clear the timer when the script is removed
    EventKillTimer();
}

// Main execution function (not used in this example)
int Start()
{
    return(0);
}
 
Back
Top