My guess would be that it has something to do with the boxheight (highest high – lowest low) needing to be <= 0.002 or the fact that line 15 expects the length of the box to be >= period which I am guessing is very unlikely.
… but you are finding the highest high and lowest low in the last 20 bars and then if they are have a difference of less than or equal to 20 pips then line 15 has a condition that only lets you draw a rectangle if the HH and LL are 20 or more bars apart. Surely this condition is very rarely going to be hit as they cannot be over 20 bars apart as that is your look back period to find them within! So in reality we are looking for a HH and LL less than 20 pips in difference where the HH and LL are exactly 20 bars apart.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue