# Path: nowtrade/logger.py
# CRITICAL = logging.CRITICAL
# ERROR = logging.ERROR
# WARNING = logging.WARNING
# INFO = logging.INFO
# DEBUG = logging.DEBUG
# class Logger(object):
#     def __init__(self, name, log_file=configuration.LOG_FILE, \
#                  console_lvl=configuration.LOGGING_DEFAULT_CONSOLE, \
#                  file_lvl=configuration.LOGGING_DEFAULT_FILE):
#     def get_logger_level(self, name, default, out):
#     def get_console_level(self, name, default):
#     def get_file_level(self, name, default):
#     def set_file_level(self, lvl):
#     def set_console_level(self, lvl):
#     def debug(self, message):
#     def info(self, message):
#     def warning(self, message):
#     def error(self, message):
#     def critical(self, message):
#     def exception(self, message):
#     def __getstate__(self):
#     def __setstate__(self, data):
# 
# Path: nowtrade/action.py
# LONG = 1
# 
# SHORT = 2
# 
# NO_ACTION = 0
# 
# LONG_EXIT = -1
# 
# SHORT_EXIT = -2
# 
# ACTIONS_MAP = {1: 'LONG',
#                2: 'SHORT',
#                0: 'NO_ACTION',
#                -1: 'LONG_EXIT',
#                -2: 'SHORT_EXIT'}
# 
# Path: nowtrade/report.py
# class InvalidExit(Exception):
# class Report(object):
#     def __init__(self, strategy, trading_profile):
#     def add_preprocess_metrics(self, symbol, data_frame):
#     def handle_action(self, symbol, data_frame):
#     def long(self, data, datetime, symbol):
#     def short(self, data, datetime, symbol):
#     def long_exit(self, data, datetime, symbol):
#     def short_exit(self, data, datetime, symbol):
#     def finalize_calculations(self):
#     def get_sharpe_ratio(self, periods=252, benchmark=None):
#     def get_average_bars(self, data_frame):
#     def overview(self):
#     def pretty_overview(self):
# def _new_trade(data_frame, symbol, trading_profile, available_money):
# def _ongoing_trade(data_frame, trade):
# def _exiting_ongoing_trade(data_frame, trade, action):


import pandas as pd
from nowtrade import logger
from nowtrade.action import LONG, SHORT, NO_ACTION, LONG_EXIT, SHORT_EXIT, ACTIONS_MAP
from nowtrade import report
            action = self.upcoming_actions[symbol]
            estimated_enter_value = self.realtime_data_frame['%s_Open' %symbol][-1]
            estimated_shares = self.trading_profile.trading_amount.get_shares(\
                               estimated_enter_value, self.report.available_money)
            actions[symbol] = {'action': action,
                               'action_name': ACTIONS_MAP[action],
                               'enter_on': 'OPEN',
                               'estimated_enter_value': estimated_enter_value,
                               'estimated_shares': estimated_shares,
                               'estimated_fees': self.trading_profile.trading_fee.get_fee(\
                                                 estimated_enter_value, estimated_shares),
                               'estimated_money_required': estimated_enter_value * estimated_shares}
        return actions

    def _determine_action(self, values):
        """
        Handles any conflicting actions based on multiple criteria groups.
        """
        # Can supply a pd.Series or a list
        try:
            values = values.values
        except AttributeError:
            pass
        if LONG in values and SHORT in values or \
           LONG_EXIT in values and SHORT_EXIT in values:
            return NO_ACTION
        if LONG_EXIT in values:
            return LONG_EXIT
        if SHORT_EXIT in values:
            return SHORT_EXIT

# Path: nowtrade/logger.py
# CRITICAL = logging.CRITICAL
# ERROR = logging.ERROR
# WARNING = logging.WARNING
# INFO = logging.INFO
# DEBUG = logging.DEBUG
# class Logger(object):
#     def __init__(self, name, log_file=configuration.LOG_FILE, \
#                  console_lvl=configuration.LOGGING_DEFAULT_CONSOLE, \
#                  file_lvl=configuration.LOGGING_DEFAULT_FILE):
#     def get_logger_level(self, name, default, out):
#     def get_console_level(self, name, default):
#     def get_file_level(self, name, default):
#     def set_file_level(self, lvl):
#     def set_console_level(self, lvl):
#     def debug(self, message):
#     def info(self, message):
#     def warning(self, message):
#     def error(self, message):
#     def critical(self, message):
#     def exception(self, message):
#     def __getstate__(self):
#     def __setstate__(self, data):
# 
# Path: nowtrade/action.py
# LONG = 1
# 
# SHORT = 2
# 
# NO_ACTION = 0
# 
# LONG_EXIT = -1
# 
# SHORT_EXIT = -2
# 
# ACTIONS_MAP = {1: 'LONG',
#                2: 'SHORT',
#                0: 'NO_ACTION',
#                -1: 'LONG_EXIT',
#                -2: 'SHORT_EXIT'}
# 
# Path: nowtrade/report.py
# class InvalidExit(Exception):
# class Report(object):
#     def __init__(self, strategy, trading_profile):
#     def add_preprocess_metrics(self, symbol, data_frame):
#     def handle_action(self, symbol, data_frame):
#     def long(self, data, datetime, symbol):
#     def short(self, data, datetime, symbol):
#     def long_exit(self, data, datetime, symbol):
#     def short_exit(self, data, datetime, symbol):
#     def finalize_calculations(self):
#     def get_sharpe_ratio(self, periods=252, benchmark=None):
#     def get_average_bars(self, data_frame):
#     def overview(self):
#     def pretty_overview(self):
# def _new_trade(data_frame, symbol, trading_profile, available_money):
# def _ongoing_trade(data_frame, trade):
# def _exiting_ongoing_trade(data_frame, trade, action):


# Path: nowtrade/strategy.py
import pandas as pd
from nowtrade import logger
from nowtrade.action import LONG, SHORT, NO_ACTION, LONG_EXIT, SHORT_EXIT, ACTIONS_MAP
from nowtrade import report

            action = self.upcoming_actions[symbol]
            estimated_enter_value = self.realtime_data_frame['%s_Open' %symbol][-1]
            estimated_shares = self.trading_profile.trading_amount.get_shares(\
                               estimated_enter_value, self.report.available_money)
            actions[symbol] = {'action': action,
                               'action_name': ACTIONS_MAP[action],
                               'enter_on': 'OPEN',
                               'estimated_enter_value': estimated_enter_value,
                               'estimated_shares': estimated_shares,
                               'estimated_fees': self.trading_profile.trading_fee.get_fee(\
                                                 estimated_enter_value, estimated_shares),
                               'estimated_money_required': estimated_enter_value * estimated_shares}
        return actions

    def _determine_action(self, values):
        """
        Handles any conflicting actions based on multiple criteria groups.
        """
        # Can supply a pd.Series or a list
        try:
            values = values.values
        except AttributeError:
            pass
        if LONG in values and SHORT in values or \
           LONG_EXIT in values and SHORT_EXIT in values:
            return NO_ACTION
        if LONG_EXIT in values:
            return LONG_EXIT
        if SHORT_EXIT in values:
            return SHORT_EXIT

        if LONG in values: