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
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
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 :-)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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