
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
As mentioned here:
https://www.mql5.com/fa/articles/81
To get the number of candles in the intersection of a line and a price, in MQL5, instead of the ObjectGetShiftByValue function, I used ObjectGetShiftByValueMQL4, the code of which is suggested as follows:
For when the intersection of price and object is in the chart range, a positive number is returned and is not a problem. But when the intersection point is in the empty part of the chart. In MQL4 its value is negative and in MQL5 the number zero is always returned. As shown in the image below:
The expected and logical value is a negative number.
What is your suggestion for solving this problem in MQL5?