# Path: pyti/catch_errors.py
# def check_for_period_error(data, period):
# def check_for_input_len_diff(*args):
# 
# Path: pyti/exponential_moving_average.py
# def exponential_moving_average(data, period):
#     """
#     Exponential Moving Average.
# 
#     Formula:
#     p0 + (1 - w) * p1 + (1 - w)^2 * p2 + (1 + w)^3 * p3 +...
#                 /   1 + (1 - w) + (1 - w)^2 + (1 - w)^3 +...
# 
#     where: w = 2 / (N + 1)
#     """
#     catch_errors.check_for_period_error(data, period)
#     emas = [exponential_moving_average_helper(
#             data[idx - period + 1:idx + 1], period) for idx in range(period - 1, len(data))]
#     emas = fill_for_noncomputable_vals(data, emas)
#     return emas


from pyti import catch_errors
from pyti.exponential_moving_average import (
    exponential_moving_average as ema
    )
from __future__ import absolute_import


def price_oscillator(data, short_period, long_period):
    """
    Price Oscillator.

    Formula:
    (short EMA - long EMA / long EMA) * 100
    """
    catch_errors.check_for_period_error(data, short_period)

# Path: pyti/catch_errors.py
# def check_for_period_error(data, period):
# def check_for_input_len_diff(*args):
# 
# Path: pyti/exponential_moving_average.py
# def exponential_moving_average(data, period):
#     """
#     Exponential Moving Average.
# 
#     Formula:
#     p0 + (1 - w) * p1 + (1 - w)^2 * p2 + (1 + w)^3 * p3 +...
#                 /   1 + (1 - w) + (1 - w)^2 + (1 - w)^3 +...
# 
#     where: w = 2 / (N + 1)
#     """
#     catch_errors.check_for_period_error(data, period)
#     emas = [exponential_moving_average_helper(
#             data[idx - period + 1:idx + 1], period) for idx in range(period - 1, len(data))]
#     emas = fill_for_noncomputable_vals(data, emas)
#     return emas


# Path: pyti/price_oscillator.py
from pyti import catch_errors
from pyti.exponential_moving_average import (
    exponential_moving_average as ema
    )

from __future__ import absolute_import


def price_oscillator(data, short_period, long_period):
    """
    Price Oscillator.

    Formula:
    (short EMA - long EMA / long EMA) * 100
    """
    catch_errors.check_for_period_error(data, short_period)

    catch_errors.check_for_period_error(data, long_period)