Not sure why you need an expert advisor for what iHighest function does.
So my advice for searching the lowest price within a given time range would be using the iLowest function.
p.s. Also I checked your code, and I find strange usage of ObjectCreate function. Are you sure with arguments senfing to that function?
So my advice for searching the lowest price within a given time range would be using the iLowest function.
p.s. Also I checked your code, and I find strange usage of ObjectCreate function. Are you sure with arguments senfing to that function?
iLowest - Timeseries and Indicators Access - MQL4 Reference
- docs.mql4.com
iLowest - Timeseries and Indicators Access - MQL4 Reference
double lowestClose = -DBL_MAX; // make it a global variable if (lowestClose < closePrice){ lowestClose = closePrice; }
it could work like that, might not be the best approach, but if lowestClose was initialized as zero than this condition wouldn't work if the close price was ever zero.
There's also MathMax and MathMin that you could use. How come you use iOpen for close prices instead of iClose?
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
Hello, everyone.
I coded this EA to determine the highest and lowest price during a specified time range. Unlike some similar EAs, my EA could calculate the highest Close price, which I believe provides a more realistic picture. The only issue I have is that my EA works OK for determining the highest price, but I don't know how to code the calculation of the lowest price within a given time range.
Any advice would be greatly appreciated.
Here's the code