Quote:
Originally Posted by shanyang
i have downloaded an indicator,which shows green/red arrow when the buy/sell signal come.
now i want to program my own EA based on this indicator.
but i have only the ex4 file of this indicator(no source code)
I want my EA read the indicator arrow on the mainchart and send the buy/sell order(green arrow==>buy, red arrow==>sell)
is there any approach to get indicator arrow information on the main chart?
thanks
|
An arrow can be drawn as a value of one of the indicator's buffers; in this case, the color in the indicator's properties should give you the buffer's number, which is enough to call it by "ICustom()" function; You also need to fill all the values of the "Input" tab as parametres of the ICustom() call.
If the arrow is not a value of a buffer, it is an object. Select it to see its properties. Most of the time, it's easy to understand how the names are generate and then it will be possible to use ObjectFind().
The EA should watch ObjectsTotal(), and only when it is incremented it may try to recognize the last object. If the name is unknow, the EA cannot use OjectFind() and has to scan all objects to identify the last one. The last object is not obviously the one with the highest index (ObjectsTotal() - 1), but it's better to start to scan from the higest index as you probably can break faster. Now you have to compare the OBJPROP_TIME1 get by ObjectGet() to Time[0] or Time[1] for exemple, and check the color or the arrow type, or a substring of the name, to identify a buy or a sell signal.
It seems complex but it is not. Try to write it and dont hesitate to ask more precisions if needed.