Hi all, I would like to program my EA to detect if an object appears (an arrow... put there by an indicator) on the current bar of my chart. Is this possible?
Have a look at
Thanks Viffer... can this find it on the current bar? Any thoughts on how I would do that?
Normally, to have drawn the arrow in the first place, it will have been given a name and ObjectFind() will look for the name. Presumably some where in your code, there will be the code that created the object. Normally it would be some combination of label and time to generate the name. You can then reference this with ObjectFind(). AFAIK, the only automatically drawn arrow would be the ones with order send. and you could reference these points with OrderSelect.
Does that help any?
Well, the thing is there could be several of these arrows drawn on the chart and I only want to check to see if there is one drawn on the current bar only. Do you know if there's a way to check that?
(I don't care about the arrows drawn with "OrderSend"... they're not the ones I'm looking for. It's the big up and down pointing arrow objects that I want to detect)
So if you right click on your chart, and select objects list, you will see that each of the arrows will have a name. It is this name that you need to detect it with ObjectFind. Afaik, there is no other way.. Normally, when programs name an object they use a consistant method, normally consisting of a lable and a time. The name might look like "Arrow" and a string of numbers. Normally that string of numbers would be the time for the bar where the arrow is drawn. It si wholly dependent on the code that was used to create and name the arrow in the first place. If it is a standardazed approach then you could use Objectfind() like this...
As I say, this will be wholly dependent on the method used to name the arrow in the first place.
Thanks Viffer, I think with "ObjectFind("Arrow"+Time)" I should be able to do it!