MT4 platform freezes when I try to remove one of my custom indicators!
Here is the deinit(). Could this be the problem?
int deinit()
{
ObjectsDeleteAll(0, 23);
for(int a = ObjectsTotal(); a >= 0; a--)
{
string name = ObjectName(a);
if(ObjectType(name) == OBJ_TREND && (StringFind(name,"DP_Line") >= 0 ||
StringFind(name,"SW_Line") >= 0))
ObjectDelete(name);
}
return(0);
}
#define OBJ_NAME_PREFIX "Mike_" int OnInit() { string dpLinePrefix = OBJ_NAME_PREFIX + "DP_Line"; string swLinePrefix = OBJ_NAME_PREFIX + "SW_Line"; //... return(INIT_SUCCEEDED); } void OnDeinit(const int reason) { ObjectsDeleteAll(0, OBJ_NAME_PREFIX, EMPTY, EMPTY); }
(That's the ABCs of programming.)
I tried the Comment() idea - and now it works! Meaning, it will properly delete the lines I need it to delete and doesn't freeze the platform. I really have no idea what is going on. It might have problems again tomorrow/ But thanks for your help.
Here is the deinit(). Could this be the problem?
int deinit()
{
ObjectsDeleteAll(0, 23);
for(int a = ObjectsTotal(); a >= 0; a--)
{
string name = ObjectName(a);
if(ObjectType(name) == OBJ_TREND && (StringFind(name,"DP_Line") >= 0 ||
StringFind(name,"SW_Line") >= 0))
ObjectDelete(name);
}
return(0);
}