Fibo, Trendline, Horizontal line Alerts

 
Hi,
I wonder if you could help me in writing MQL4 code. I wanted to get an alert if the price touches the following indicators/objects which I draw myself on the charts.

1- Fibonacci levels ( 38.2, 50, 61.8)
2- Trendlines
3- Horizontal lines (Support and resistance).

Thanks in advance
 

Use ObjectGet(..., OBJPROP_PRICE1) to find the value of a horizontal line

Use ObjectGetValueByShift(..., barNumber) to find the value of a point on a trendline

For Fibo, take the difference of OBJPROP_PRICE1 and OBJPROP_PRICE2 found with ObjectGet(. ..) and calculate the fib levels
if you are trying to get values of the Fib tool

 
phy:

Use ObjectGet(..., OBJPROP_PRICE1) to find the value of a horizontal line

Use ObjectGetValueByShift(..., barNumber) to find the value of a point on a trendline

For Fibo, take the difference of OBJPROP_PRICE1 and OBJPROP_PRICE2 found with ObjectGet(. ..) and calculate the fib levels
if you are trying to get values of the Fib tool

Thanks for your timely help. Well I have done the programming for Horizontal and Trendline. But Im unable to do any thing for the fibo retracements. I want to get an alert when price touches any of the fibo retracement line e.g. 61.8 line. I would appreciate if you can give the code for this. Thanks

Regards,
Ali Nasir
 

Hmm, looks like its mostly there. Use ObjectGet (OBJPROP_PRICE1...etc) then something like if ((price2-price1)*0.618)==close[0] {

Alert( yaketa, yaketa);

}

good luck :-)