CreateObject only create one OBJ_ARROW ...

 

Hi,

I have a interresant EA but I will debbug trade entries using ObjectCreate instead Ctrade. I will draw in graph all entries with ObjectCreate(chart_ID,name,OBJ_ARROW_SELL,sub_window,time,price)) Itried to do "OBJ_ARROW_SELL" or

"OBJ_ARROW_BUY" but only draw one time.If I try to copy paste differents times code that creates  Object only do one time.

Exempel:

int chart_ID=0;
  string name="Test Arrow 1 ";
  int sub_window=0;
  int time=TimeCurrent();
  double price=SymbolInfoDouble(Symbol(),SYMBOL_BID);
  Print(" time--> ",time," price -->",price);
     if(!ObjectCreate(chart_ID,name,OBJ_ARROW_BUY,sub_window,time,price))
     {
      Print(__FUNCTION__,
            ": failed to create \"Buy\" sign! Error code = ",GetLastError());
      return(false);

     }

    // For see if create second Arrow

     price = price - 500;

    Print(" time--> ",time," price -->",price);

     if(!ObjectCreate(chart_ID,name,OBJ_ARROW_SELL,sub_window,time,price))

     {
      Print(__FUNCTION__,
            ": failed to create \"Buy\" sign! Error code = ",GetLastError());
      return(false);

     }

Anybody know because do that ?

Thanks every body,

Andrei Darie

 
One name for both objects? Try different names.
 

Hi,

Was problem with subtract I need to do  "price = price - 0.00300" because price is float :). I can see bought objects.  I do -500 is out of graph ...

Thanks.