MQL4 - automated forex trading   /  

Forum

Removing Arrows or Xs etc from the Chart

Back to topics list To post a new topic, please log in or register

avatar
28
brave0heart 2006.10.11 07:14 
I am using an EA that places arrows on the screen--which indicate buys orders--and an indicator which places some yellow Xs on the screen as well. My problem is, how can I remove these. Once I remove the EA and the indicator, these arrows and Xs remain on the chart. They are a special kind of arrow. If I place my mouse over them, a message pops up, telling me the order number, buy limit, and price.
Thanks
Steve
Testing Visualization: Trade History

Testing Visualization: Trade History

The article describes the possibilities of convenient viewing the trade history when visualizing tests.


avatar
27
flag 2006.10.11 12:47 
Steve you have to go to Charts-Objects-Object List or just type CTRL B.
Then select all Objects you want to delete (cleck on first one, press Shift, click on last one) and choose delete.

You can also delete them onto the Chart : Double click on the arrow or Xs then press Delete on the keyboard.

Francois

avatar
597
irusoh1 2006.10.11 20:51 
when you create your objects use a function like follows:

void SetArrow(datetime time1, double price1, ... other parms ...)
{
static int objcount;
 
objcount++;
 
ObjectCreate("myepxertobject"+objcount,....);
 
....
 
}

(by the way fine and about the only use of the keyword static that I can think of).
this will ensure that all your objects start with same name

then insert in deinit()

   if(UninitializeReason()!=REASON_RECOMPILE)
      DeleteAllObjects();

(if recompiling while expert is working it will not delete arrows).
deleteallobjects function looks something like this:

void DeleteAllObjects()
{
   string objname;
   string ident="myexpertobject";
   int cnt=0;
   while(cnt<ObjectsTotal())
   {
      objname=ObjectName(cnt);
      if(StringSubstr(objname,0,StringLen(ident))==ident)
         ObjectDelete(objname);
      else
         cnt++;
   }
}




Back to topics list  

To add comments, please log in or register