def on_balance_volume(close_data, volume):
catch_errors.check_for_input_len_diff(close_data, volume)<EOL>obv = np.zeros(len(volume))<EOL>obv[<NUM_LIT:0>] = <NUM_LIT:1><EOL>for idx in range(<NUM_LIT:1>, len(obv)):<EOL><INDENT>if close_data[idx] > close_data[idx-<NUM_LIT:1>]:<EOL><INDENT>obv[idx] = obv[idx-<NUM_LIT:1>] + volume[idx]<EOL><DEDENT>elif close_data[idx] < close_data[idx-<NUM_LIT:1>]:<EOL><INDENT>obv[idx] = obv[idx-<NUM_LIT:1>] - volume[idx]<EOL><DEDENT>elif close_data[idx] == close_data[idx-<NUM_LIT:1>]:<EOL><INDENT>obv[idx] = obv[idx-<NUM_LIT:1>]<EOL><DEDENT><DEDENT>return obv<EOL>
On Balance Volume.

Formula:
start = 1
if CLOSEt > CLOSEt-1
    obv = obvt-1 + volumet
elif CLOSEt < CLOSEt-1
    obv = obvt-1 - volumet
elif CLOSEt == CLOSTt-1
    obv = obvt-1