Alireza Boroumand #: Your suggestions helped me a lot. Sure, I'll follow your instructions.
Hey Alireza, I know this is an old post but how would you go about deleting the button. I tried creating a loop in the DeInt where I loop through all the orders and delete the objects that matches the open orders which kind of work but if I decide to close the normal way I have no way of checking to see if the ticket matches the button
Johansson K Thompson #: Hey Alireza, I know this is an old post but how would you go about deleting the button. I tried creating a loop in the DeInt where I loop through all the orders and delete the objects that matches the open orders which kind of work but if I decide to close the normal way I have no way of checking to see if the ticket matches the button
I understand that this is old thread, but I have the same concern like you. And after a little time to digging and trying, I can solve it now.
All we need is going to loop through the button, and delete it OnDeInit() Event of the EA/ Script.
void DeInit()
{
// Delete all related buttonsfor(int i=ObjectsTotal(0)-1; i >= 0; --i) // Loop through all object
{
string sparam = ObjectName(0,i); // Get param of that objectif(ObjectGetInteger(0, sparam, OBJPROP_TYPE) == OBJ_BUTTON) // Check for type is Button
{
int pos = StringFind(sparam, "DongTatCa"); // This's my special name for my buttonif(pos>=0)
{ButtonDelete(0,sparam);} // I make a delete function here
pos = StringFind(sparam, "BtnClose"); // Do it again for another buttonif(pos>=0)
{
ButtonDelete(0,sparam);
}
pos = StringFind(sparam, "MoveBEButton");
if(pos>=0)
{
ButtonDelete(0,sparam);
}
pos = StringFind(sparam, "CloseHalfButton");
if(pos>=0)
{
ButtonDelete(0,sparam);
}
}
}
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I understand why you wouldn't want the terminal open.
I always have it open with the Experts tab.
I don't actually trade that much and only in the higher time-frames so I rarely need to check the chart.
Funnily enough, when I am trading I don't use any EAs or Indicators.
I understand why you wouldn't want the terminal open.
I always have it open with the Experts tab.
I don't actually trade that much and only in the higher time-frames so I rarely need to check the chart.
Funnily enough, when I am trading I don't use any EAs or Indicators.
I agree with you. Higher timeframes are the best. Less screen time, more accurate signals and Less spread given to the broker.
Cheers
Your suggestions helped me a lot. Sure, I'll follow your instructions.
Hey Alireza, I know this is an old post but how would you go about deleting the button. I tried creating a loop in the DeInt where I loop through all the orders and delete the objects that matches the open orders which kind of work but if I decide to close the normal way I have no way of checking to see if the ticket matches the button
I understand that this is old thread, but I have the same concern like you. And after a little time to digging and trying, I can solve it now.
All we need is going to loop through the button, and delete it OnDeInit() Event of the EA/ Script.