• Sign up >>

MQ4-How to know buffer signal on the chart which the indicator is attached?

To add comments, please log in or register
Cromo
289
Cromo  

I have a question.

If I attach the indicator on the chart.

This indicator has arrow with buffer signal.

I want to read this arrow or buffer signal from EA.

But I don't want to use iCustom.

How can I read signal from the attached indicator?

Any good idea?

Keith Watford
Moderator
21012
Keith Watford  
Cromo:

But I don't want to use iCustom.

Why not?

Cromo:

How can I read signal from the attached indicator?

Use iCustom.

Cromo
289
Cromo  
Keith Watford:

Why not?

Use iCustom.

Keith、thanks.

Can you teach me?

If the indicator has no buffer and it has only arrow object, how can I read signal from the arrow object?

Like..... If the buy arrow  appear on the current bar, how can I detect it without buffer signal?

Enrique Dangeroux
683
Enrique Dangeroux  
Cromo:

Keith、thanks.

Can you teach me?

If the indicator has no buffer and it has only arrow object, how can I read signal from the arrow object?

Like..... If the buy arrow  appear on the current bar, how can I detect it without buffer signal?

Modify the indicator to put signals in buffers.

andrew
465
andrew  
Cromo:

I have a question.

If I attach the indicator on the chart.

This indicator has arrow with buffer signal.

I want to read this arrow or buffer signal from EA.

But I don't want to use iCustom.

How can I read signal from the attached indicator?

Any good idea?

It depends on the indicator,  but your EA can look at the objects the indicator creates, in this case an arrow, if you can't get the value through iCustom.

Don't know if this helps, but this code printed out all the objects on my chart, and next, I would probably try to access the object properties, color etc to work out what the object is telling me..but its not much good if you're coding for mulitiple symbols, periods etc. and you can't use iCustom...

 string objname,txt;
 for(int i=0;i<ObjectsTotal(0,0);i++){
   objname=ObjectName(0,i);
    txt+=objname;
    txt+="\n";
 }
 Comment(txt);
Cromo
289
Cromo  
andrew:

It depends on the indicator,  but your EA can look at the objects the indicator creates, in this case an arrow, if you can't get the value through iCustom.

Don't know if this helps, but this code printed out all the objects on my chart, and next, I would probably try to access the object properties, color etc to work out what the object is telling me..but its not much good if you're coding for mulitiple symbols, periods etc. and you can't use iCustom...

Thank you!

But how can I know the object arrow is on current bar?

How to detect?

Cromo
289
Cromo  
Enrique Dangeroux:

Modify the indicator to put signals in buffers.

Thanks, but sometimes I have no source file.

Do you know how to detect object arrow on current bar?


If I use buffer, it is easy. Just check AAA!=EMPTY_Value,

but if it is arrow object, how can I know the arrow object showed on current bar?

andrew
465
andrew  
Cromo:

Thank you!

But how can I know the object arrow is on current bar?

How to detect?

Well, you could try something like this. I just placed an arrow on a chart, and this code identified that it was at bar0. If there's more than one object or arrow, you'd need to loop thru each one. 

And then, to identify the direction (up or down) you might be able to use the wingding number, which is just OBJPROP_ARROWCODE instead of time. Search "Object" in MT4 reference for more info on this....

But this would be no good if you wanted to loop through different periods or symbols....

string objname=ObjectName(0,0);
datetime tme  =(datetime)ObjectGetInteger(0,objname,OBJPROP_TIME);
int bar       =iBarShift(_Symbol,_Period,tme,true);
 
 if(bar==0)Print("At bar0");
      else
           Print("NOT at bar0");


arrow

Cromo
289
Cromo  
andrew:

Well, you could try something like this. I just placed an arrow on a chart, and this code identified that it was at bar0. If there's more than one object or arrow, you'd need to loop thru each one. 

And then, to identify the direction (up or down) you might be able to use the wingding number, which is just OBJPROP_ARROWCODE instead of time. Search "Object" in MT4 reference for more info on this....

But this would be no good if you wanted to loop through different periods or symbols....


Thank you.

datetime tme  =(datetime)ObjectGetInteger(0,objname,OBJPROP_TIME);

I have never know this code.

Is this for reading current bar object time stamp?

If time stamp is zero , that means there is a object on the current bar?

andrew
465
andrew  
Cromo:

Thank you.

I have never know this code.

Is this for reading current bar object time stamp?

If time stamp is zero , that means there is a object on the current bar?

If you think about it, time=0 is 1970.01.01 00:00, so no. In the code above, an easier way would be, if  tme==Time[0] then the arrow would be at Bar 0.

The best thing is to do your own investigations, that way you can solve other similar problems in the future.

Like I did, put an arrow on a random chart and look at MT4 guide, checking out OBJECT and OBJPROP.  Then write code to identify ALL the properties of the arrow.

(Think about Time and Price as the x & y axis values on your chart.)  

Cromo
289
Cromo  
andrew:

If you think about it, time=0 is 1970.01.01 00:00, so no. In the code above, an easier way would be, if  tme==Time[0] then the arrow would be at Bar 0.

The best thing is to do your own investigations, that way you can solve other similar problems in the future.

Like I did, put an arrow on a random chart and look at MT4 guide, checking out OBJECT and OBJPROP.  Then write code to identify ALL the properties of the arrow.

(Think about Time and Price as the x & y axis values on your chart.)  

Hi, andrew

Thank you for your replay.

I will try that. You give me good hints. If I made success I will upload the result. Thank you!

To add comments, please log in or register