- When you post code please use the SRC button! Please edit your post.
General rules and best pratices of the Forum. - General - MQL5 programming forum - The highest time will always be now. The lowest time will always be then.
int iLL = iLowest(NULL, 0, MODE_LOW,WaveLength, i); int iHH = iHighest(NULL, 0, MODE_HIGH,WaveLength, i) double LL = Low[iLL]; double HH = High[iHH]; // datetime TimeLL = Time[iLowest(NULL, 0, MODE_TIME,WaveLength, i)]; // datetime TimeHH = Time[iHighest(NULL, 0, MODE_TIME,WaveLength, i)]; datetime TimeLL = Time[iLL]; datetime TimeHH = Time[iHH];
Thanks for your response whroeder1, much appreciated, have a nice day.
reacto

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 wrote the code below that, in my mind, should move the endpoint of the trend line to the high of the highest bar, or the low of the lowest bar, but it doesn't.
The end of the trend line is moved to the correct level, but not to the right bar, instead it is moved to the most recent bar. How do I get it to be moved to the bar corresponding with the highest high or lowest low?