# Path: pyti/catch_errors.py
# def check_for_period_error(data, period):
# def check_for_input_len_diff(*args):
# 
# Path: pyti/function_helper.py
# def fill_for_noncomputable_vals(input_data, result_data):
#     non_computable_values = np.repeat(
#         np.nan, len(input_data) - len(result_data)
#         )
#     filled_result_data = np.append(non_computable_values, result_data)
#     return filled_result_data
# 
# Path: pyti/typical_price.py
# def typical_price(close_data, high_data, low_data):
#     """
#     Typical Price.
# 
#     Formula:
#     TPt = (HIGHt + LOWt + CLOSEt) / 3
#     """
#     catch_errors.check_for_input_len_diff(close_data, high_data, low_data)
#     tp = [(high_data[idx] + low_data[idx] + close_data[idx]) / 3 for idx in range(0, len(close_data))]
#     return np.array(tp)
# 
# Path: pyti/money_flow.py
# def money_flow(close_data, high_data, low_data, volume):
#     """
#     Money Flow.
# 
#     Formula:
#     MF = VOLUME * TYPICAL PRICE
#     """
#     catch_errors.check_for_input_len_diff(
#         close_data, high_data, low_data, volume
#         )
#     mf = volume * tp(close_data, high_data, low_data)
#     return mf


import numpy as np
import warnings
from pyti import catch_errors
from pyti.function_helper import fill_for_noncomputable_vals
from pyti.typical_price import typical_price
from pyti.money_flow import money_flow
from six.moves import range
from __future__ import absolute_import


def money_flow_index(close_data, high_data, low_data, volume, period):
    """
    Money Flow Index.

    Formula:
    MFI = 100 - (100 / (1 + PMF / NMF))
    """
    catch_errors.check_for_input_len_diff(
        close_data, high_data, low_data, volume
        )

# Path: pyti/catch_errors.py
# def check_for_period_error(data, period):
# def check_for_input_len_diff(*args):
# 
# Path: pyti/function_helper.py
# def fill_for_noncomputable_vals(input_data, result_data):
#     non_computable_values = np.repeat(
#         np.nan, len(input_data) - len(result_data)
#         )
#     filled_result_data = np.append(non_computable_values, result_data)
#     return filled_result_data
# 
# Path: pyti/typical_price.py
# def typical_price(close_data, high_data, low_data):
#     """
#     Typical Price.
# 
#     Formula:
#     TPt = (HIGHt + LOWt + CLOSEt) / 3
#     """
#     catch_errors.check_for_input_len_diff(close_data, high_data, low_data)
#     tp = [(high_data[idx] + low_data[idx] + close_data[idx]) / 3 for idx in range(0, len(close_data))]
#     return np.array(tp)
# 
# Path: pyti/money_flow.py
# def money_flow(close_data, high_data, low_data, volume):
#     """
#     Money Flow.
# 
#     Formula:
#     MF = VOLUME * TYPICAL PRICE
#     """
#     catch_errors.check_for_input_len_diff(
#         close_data, high_data, low_data, volume
#         )
#     mf = volume * tp(close_data, high_data, low_data)
#     return mf


# Path: pyti/money_flow_index.py
import numpy as np
import warnings
from pyti import catch_errors
from pyti.function_helper import fill_for_noncomputable_vals
from pyti.typical_price import typical_price
from pyti.money_flow import money_flow
from six.moves import range

from __future__ import absolute_import


def money_flow_index(close_data, high_data, low_data, volume, period):
    """
    Money Flow Index.

    Formula:
    MFI = 100 - (100 / (1 + PMF / NMF))
    """
    catch_errors.check_for_input_len_diff(
        close_data, high_data, low_data, volume
        )

    catch_errors.check_for_period_error(close_data, period)