this code is untested use at your own risk...
applying timed price change over the square to predict price expansion or contraction of the range, it is not predicting the future price only the range that is possible for the price to be in within a margin of error of possibility, with that said i think its very unlikely for price to fall outside the range, due to virtual constraint applied by the auto corrective/cyclical nature of price action.