Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Script | ToClearObjectsByTypeByTime

MetaTrader Experts, Indicators, Scripts and Libraries

The script removes old objects of the selected type from all charts, if the time coordinates of these objects are outside of the trigger level.

//+-----------------------------------------------+
//|  SCRIPT INPUT PARAMETERS                      |
//+-----------------------------------------------+
input ENUM_OBJECT OBJ_TYPE=-1;    //The type of objects to delete
input uint TimeLevel=10;          //Trigger level in days

So, the TimeLevel input determines the number of days back from the current one. Objects before that day will be deleted.

17998

Best MetaTrader Indicators + Profitable Expert Advisors