Discussing the article: "A Step-by-Step Guide on Trading the Break of Structure (BoS) Strategy" - page 2

 
fengbao88 #:
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; } }

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.