MT4/MT5 conversion, what is wrong with the code?

 

I'm attempting to convert the indicator below from MT4/MT5.  Most of the MT5 I'm sure is correct, but something is wrong.

The MT4 file below is how the MT5 should work; why does the MT5 file plot incorrectly and generate a zero divide error?  Thanks.

 
  1. You'd better go through you code with the debugger.
  2. Place a Comment(..) with the relevant variables on the line right before the zero devide error.
  3. Make it easier for us to help you and post the relevant log entry: what line, ..?
 
Carl Schreiber:
  1. You'd better go through you code with the debugger.
  2. Place a Comment(..) with the relevant variables on the line right before the zero devide error.
  3. Make it easier for us to help you and post the relevant log entry: what line, ..?

Sure.  It is line 73, column 19, where the difference of "H" and "L" is zero.  It is not an issue on the MT4 version; somehow the plot is different on MT5 and results in this error.  Where is the mis-translation?