Need help with EA

 

I have a custom indicator that gives trade signals on the chart, arrows and stop signs. Is it possible for the EA to look on the chart to find the symbols and open and close trades from the symbols. I do not want the EA to use the custom indicator or call on it.

I have tried many variations and cannot make it work. Is it possible, if so how?

 

I do not want the EA to use the custom indicator or call on it.

If the symbols are created using ObjectCreate(), you can query them by name.

If the symbols are created using indicator index, you have to query the indicator with iCustom().

 
phy wrote >>

If the symbols are created using ObjectCreate(), you can query them by name.

If the symbols are created using indicator index, you have to query the indicator with iCustom().

The symbols are created using ObjectCreate(), how do you query them by name.

 
for(int index = ObjectsTotal()-1; index >= 0; index--){
  string theObjectName = ObjectName(index);
  if(StringFind(theObjectName, "myObjectName", 0) >= 0){  // assuming your object is named myObjectNamexxxxxxxx
     Print("Object Found with name of ", theObjectName);
 
phy wrote >>

Thank you.

I’m assuming I can use this for all 4 names, “up”, “down”, “longexit”, and “shortexit”.

 

I guess so. Object name must be unique within the scope of a single chart.

Objets up1 up2 up3 and so on, for example.

 
phy wrote >>

I guess so. Object name must be unique within the scope of a single chart.

Objets up1 up2 up3 and so on, for example.

phy
wrote
>>

I guess so. Object name must be unique within the scope of a single chart.

Objets up1 up2 up3 and so on, for example.

What if the Object name is the same for all the Arrows and the arrow names are numbered, arrowname1, arrowname2, arrowname3, and so on.
 

Names must be unique, you can create thim like this whe you need them:

name = "arrowname"

for(i = 0; i < 100; i++){

ObjectCreate(name+i, OBJ_ARROW, ...,...,...)