How do you delete arrows and small dash lines that an ea would leave on your screen?

 

How do you delete arrows and small dash lines that an ea would leave on your screen?

USING CODE; I TRIED THIS BUT DOES NOT WORK

ObjectDelete (OBJ_ARROW); 
 
string name;
  for(int i=0; i < ObjectsTotal(); i++)
    {
    name = ObjectName(i);
    if(ObjectType(name) == OBJ_ARROW)
    ObjectDelete (name);
    }
didn't checked
 
int deinit()
  {
//----
  ObjectsDeleteAll(); 
//----
   return(0);
  }
 

SDC:

int deinit()
  {
//----
  ObjectsDeleteAll(); 
//----
   return(0);
  }



u maybe right but if he doesn't want to delete other objects than arrows?
 
they are order sign you can't delete by code except manually
 
qjol:
didn't checked


I tried this. it only deletes one arrow per script drop on chart. i want it to delete maybe 15 arrows at the same time... any idea??

 
ikhlas_08:
they are order sign you can't delete by code except manually


Only in fantasy land.

There is no such thing as "order sign" or some kind of special objects. All objects that can ever be in the chart are one of one of the types that can be manipulated with the ObjectXxxx() functions. They are listed in the documentation. Orders are plotted into the chart using two ordinary OBJ_ARROW and an OBJ_TREND between them.

 
gavin:


I tried this. it only deletes one arrow per script drop on chart. i want it to delete maybe 15 arrows at the same time... any idea??

Count backwards or decrease the loop variable by one after each deletion. Same problem as closing orders by looping through their position numbers: the position numbers of all following objects decrease by one each time you delete one in front of of them.
 
Count down when deleting
 

7bit & WHRoeder u both right

string name;
  for(int i = ObjectsTotal(); i >= 0; i--)
    {
    name = ObjectName(i);
    if(ObjectType(name) == OBJ_ARROW)
    ObjectDelete (name);
    }

here we go

 
qjol:

7bit & WHRoeder u both right

here we go


Ah that works sweet... Thanks to all,,
Reason: