Okay. So what is your implementation? Your explanation clearly shows you understand our approach. Scan both left and right bars. What do you suggest you do in your case? That will help others as well if you have a better approach. Thanks.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Serious future functions, this is pure and simple cheating, not sure what you are aiming for.
const int limit = 20; int curr_bar = limit; // = 20
for (int j=1; j<=length; j++){ right_index = curr_bar - j; // left: historical bar (correct) left_index = curr_bar + j; // right: future bar (seriously wrong!!!)
if ( (high(curr_bar) <= high(right_index)) || (high(curr_bar) < high(left_index)) ){ isSwingHigh = false; } if ( (low(curr_bar) >= low( right_index)) || (low(curr_bar) > low(left_index)) ){ isSwingLow = false; } }