# 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):


from math import ceil
from nowtrade import logger
    A TradingAmount that always returns the number of shares to most closely
    approximate a certain amount in dollars to be put in a trade.
    """
    def __init__(self, amount, round_up=False):
        TradingAmount.__init__(self)
        self.amount = amount
        self.round_up = round_up
        self.logger.info('Initialized - %s' %self)
    def __str__(self):
        return 'StaticAmount(amount=%s, round_up=%s)' %(self.amount, self.round_up)
    def __repr__(self):
        return 'StaticAmount(amount=%s, round_up=%s)' %(self.amount, self.round_up)
    def get_shares(self, price, available_money): # pylint: disable=unused-argument
        """
        Return the number of shares to purchase based on the current symbol
        price and the amount of capital available to your trading profile.
        """
        if self.round_up:
            shares = ceil(self.amount / price)
        else:
            shares = round(self.amount / price)
        return shares

class NumberOfShares(TradingAmount):
    """
    A TradingAmount that always returns the same number of shares to be traded.
    """
    def __init__(self, shares):
        TradingAmount.__init__(self)
        self.shares = shares

# 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/trading_amount.py
from math import ceil
from nowtrade import logger

    A TradingAmount that always returns the number of shares to most closely
    approximate a certain amount in dollars to be put in a trade.
    """
    def __init__(self, amount, round_up=False):
        TradingAmount.__init__(self)
        self.amount = amount
        self.round_up = round_up
        self.logger.info('Initialized - %s' %self)
    def __str__(self):
        return 'StaticAmount(amount=%s, round_up=%s)' %(self.amount, self.round_up)
    def __repr__(self):
        return 'StaticAmount(amount=%s, round_up=%s)' %(self.amount, self.round_up)
    def get_shares(self, price, available_money): # pylint: disable=unused-argument
        """
        Return the number of shares to purchase based on the current symbol
        price and the amount of capital available to your trading profile.
        """
        if self.round_up:
            shares = ceil(self.amount / price)
        else:
            shares = round(self.amount / price)
        return shares

class NumberOfShares(TradingAmount):
    """
    A TradingAmount that always returns the same number of shares to be traded.
    """
    def __init__(self, shares):
        TradingAmount.__init__(self)
        self.shares = shares

        self.logger.info('Initialized - %s' %self)