# Path: pyti/catch_errors.py
# def check_for_period_error(data, period):
# def check_for_input_len_diff(*args):
# 
# Path: pyti/simple_moving_average.py
# def simple_moving_average(data, period):
#     """
#     Simple Moving Average.
# 
#     Formula:
#     SUM(data / N)
#     """
#     catch_errors.check_for_period_error(data, period)
#     # Mean of Empty Slice RuntimeWarning doesn't affect output so it is
#     # supressed
#     with warnings.catch_warnings():
#         warnings.simplefilter("ignore", category=RuntimeWarning)
#         sma = [np.mean(data[idx-(period-1):idx+1]) for idx in range(0, len(data))]
#     sma = fill_for_noncomputable_vals(data, sma)
#     return sma


from pyti import catch_errors
from pyti.simple_moving_average import simple_moving_average as sma
from __future__ import absolute_import


def volume_oscillator(volume, short_period, long_period):
    """
    Volume Oscillator.

    Formula:
    vo = 100 * (SMA(vol, short) - SMA(vol, long) / SMA(vol, long))
    """
    catch_errors.check_for_period_error(volume, short_period)

# Path: pyti/catch_errors.py
# def check_for_period_error(data, period):
# def check_for_input_len_diff(*args):
# 
# Path: pyti/simple_moving_average.py
# def simple_moving_average(data, period):
#     """
#     Simple Moving Average.
# 
#     Formula:
#     SUM(data / N)
#     """
#     catch_errors.check_for_period_error(data, period)
#     # Mean of Empty Slice RuntimeWarning doesn't affect output so it is
#     # supressed
#     with warnings.catch_warnings():
#         warnings.simplefilter("ignore", category=RuntimeWarning)
#         sma = [np.mean(data[idx-(period-1):idx+1]) for idx in range(0, len(data))]
#     sma = fill_for_noncomputable_vals(data, sma)
#     return sma


# Path: pyti/volume_oscillator.py
from pyti import catch_errors
from pyti.simple_moving_average import simple_moving_average as sma

from __future__ import absolute_import


def volume_oscillator(volume, short_period, long_period):
    """
    Volume Oscillator.

    Formula:
    vo = 100 * (SMA(vol, short) - SMA(vol, long) / SMA(vol, long))
    """
    catch_errors.check_for_period_error(volume, short_period)

    catch_errors.check_for_period_error(volume, long_period)