def negative_volume_index(close_data, volume):
catch_errors.check_for_input_len_diff(close_data, volume)<EOL>nvi = np.zeros(len(volume))<EOL>nvi[<NUM_LIT:0>] = <NUM_LIT:1><EOL>for idx in range(<NUM_LIT:1>, len(volume)):<EOL><INDENT>if volume[idx] < volume[idx-<NUM_LIT:1>]:<EOL><INDENT>nvi[idx] = volume_index_helper(nvi, idx, close_data)<EOL><DEDENT>else:<EOL><INDENT>nvi[idx] = nvi[idx-<NUM_LIT:1>]<EOL><DEDENT><DEDENT>return nvi<EOL>
Negative Volume Index (NVI).

Formula:
NVI0 = 1
IF Vt < Vt-1
    NVIt = NVIt-1 + (CLOSEt - CLOSEt-1 / CLOSEt-1 * NVIt-1)
ELSE:
    NVIt = NVIt-1