# Path: crumpet/constants.py
# MINIMUM_AMOUNT = 0.0001
# 
# Path: crumpet/wallet.py
# class Wallet(object):
#     '''
#     This class keeps track of the current funds that a bot can utilize in trading.
#     '''
# 
#     def __init__(self, assets: float, currency: float, instrument: str, fee: float = 0.25):
#         '''
#         This function initializes a Classification object.
#         :param fee: The maximum percentage fee taken by the exchange per order.
#         :param currency: The amount of currency (USD/ZAR) you have available to buy coins with.
#         :param assets: The amount of the cypro-currency coins you have in your wallet ready to sell.
#         :param instrument: The crypto-currency the bot will use to trade against BTC.
#         '''
#         self.instrument = instrument
#         self.assets = assets
#         self.currency = currency
#         self.fee = fee
#         self.starting_assets = assets
#         self.starting_currency = currency
#         self.initial_investment = 0
# 
#     def record_buy(self, buy_amount, price):
#         '''
#         Records the buy order transaction in the wallet.
#         :param price: The current or closing price of the instrument.
#         :param buy_amount: The amount to buy.
#         '''
#         self.assets += buy_amount
#         self.currency -= (buy_amount * price)
# 
#     def record_sell(self, sell_amount, price):
#         '''
#         Records the sell order transaction in the wallet.
#         :param price: The current or closing price of the instrument.
#         :param sell_amount: The amount to sell.
#         '''
#         self.assets -= sell_amount
#         self.currency += (sell_amount * price)
# 
#     def max_buy_amount(self, price):
#         '''
#         The maximum amount of a coin the bot can buy.
#         :param price: The current or closing price of the instrument.
#         '''
#         return (self.currency / price) * (1 - (self.fee / 100))
# 
#     def max_sell_amount(self):
#         '''
#         The maximum amount of a coin the bot can sell.
#         '''
#         return self.assets * (1 - (self.fee / 100))
# 
#     def calculate_initial_investment(self, price: float):
#         '''
#         The initial investment made.
#         :param price: The current or closing price of the instrument.
#         '''
#         self.initial_investment = (self.starting_assets * price) + self.starting_currency
# 
#     def percent_btc_profit(self, price):
#         return ((((self.assets * price) + self.currency) - self.initial_investment) / self.initial_investment) * 100
# 
#     def total_btc(self, price):
#         return (self.assets * price) + self.currency


import datetime
import math
import numpy
import talib
from crumpet.constants import MINIMUM_AMOUNT
from crumpet.utils import bcolors
from crumpet.wallet import Wallet
              '|===================================================================|' + bcolors.ENDC)
        print(bcolors.OKGREEN + str(timestamp) +
              '|-------------------- To The Moon And Back v0.1 --------------------|' + bcolors.ENDC)
        print(bcolors.OKGREEN + str(timestamp) +
              '|===================================================================|' + bcolors.ENDC)
        self.sma_period = sma_period
        self.ema_period = ema_period
        self.sma = []
        self.ema = []
        super(ToTheMoonStrategy, self).__init__()

    @property
    def guard(self):
        if len(self.ema) <= 1 and len(self.sma) <= 1:
            return False

        if math.isnan(float(self.sma[-1])) or math.isnan(float(self.ema[-1])):
            return False

        return True

    @property
    def crosses_up(self):
        if self.ema[-2] > self.sma[-2] and self.ema[-1] < self.sma[-1]:
            return 'sma'
        elif self.ema[-2] < self.sma[-2] and self.ema[-1] > self.sma[-1]:
            return 'ema'

        return ''


# Path: crumpet/constants.py
# MINIMUM_AMOUNT = 0.0001
# 
# Path: crumpet/wallet.py
# class Wallet(object):
#     '''
#     This class keeps track of the current funds that a bot can utilize in trading.
#     '''
# 
#     def __init__(self, assets: float, currency: float, instrument: str, fee: float = 0.25):
#         '''
#         This function initializes a Classification object.
#         :param fee: The maximum percentage fee taken by the exchange per order.
#         :param currency: The amount of currency (USD/ZAR) you have available to buy coins with.
#         :param assets: The amount of the cypro-currency coins you have in your wallet ready to sell.
#         :param instrument: The crypto-currency the bot will use to trade against BTC.
#         '''
#         self.instrument = instrument
#         self.assets = assets
#         self.currency = currency
#         self.fee = fee
#         self.starting_assets = assets
#         self.starting_currency = currency
#         self.initial_investment = 0
# 
#     def record_buy(self, buy_amount, price):
#         '''
#         Records the buy order transaction in the wallet.
#         :param price: The current or closing price of the instrument.
#         :param buy_amount: The amount to buy.
#         '''
#         self.assets += buy_amount
#         self.currency -= (buy_amount * price)
# 
#     def record_sell(self, sell_amount, price):
#         '''
#         Records the sell order transaction in the wallet.
#         :param price: The current or closing price of the instrument.
#         :param sell_amount: The amount to sell.
#         '''
#         self.assets -= sell_amount
#         self.currency += (sell_amount * price)
# 
#     def max_buy_amount(self, price):
#         '''
#         The maximum amount of a coin the bot can buy.
#         :param price: The current or closing price of the instrument.
#         '''
#         return (self.currency / price) * (1 - (self.fee / 100))
# 
#     def max_sell_amount(self):
#         '''
#         The maximum amount of a coin the bot can sell.
#         '''
#         return self.assets * (1 - (self.fee / 100))
# 
#     def calculate_initial_investment(self, price: float):
#         '''
#         The initial investment made.
#         :param price: The current or closing price of the instrument.
#         '''
#         self.initial_investment = (self.starting_assets * price) + self.starting_currency
# 
#     def percent_btc_profit(self, price):
#         return ((((self.assets * price) + self.currency) - self.initial_investment) / self.initial_investment) * 100
# 
#     def total_btc(self, price):
#         return (self.assets * price) + self.currency


# Path: crumpet/strategy.py
import datetime
import math
import numpy
import talib
from crumpet.constants import MINIMUM_AMOUNT
from crumpet.utils import bcolors
from crumpet.wallet import Wallet

              '|===================================================================|' + bcolors.ENDC)
        print(bcolors.OKGREEN + str(timestamp) +
              '|-------------------- To The Moon And Back v0.1 --------------------|' + bcolors.ENDC)
        print(bcolors.OKGREEN + str(timestamp) +
              '|===================================================================|' + bcolors.ENDC)
        self.sma_period = sma_period
        self.ema_period = ema_period
        self.sma = []
        self.ema = []
        super(ToTheMoonStrategy, self).__init__()

    @property
    def guard(self):
        if len(self.ema) <= 1 and len(self.sma) <= 1:
            return False

        if math.isnan(float(self.sma[-1])) or math.isnan(float(self.ema[-1])):
            return False

        return True

    @property
    def crosses_up(self):
        if self.ema[-2] > self.sma[-2] and self.ema[-1] < self.sma[-1]:
            return 'sma'
        elif self.ema[-2] < self.sma[-2] and self.ema[-1] > self.sma[-1]:
            return 'ema'

        return ''


    def decide(self, timer: str, tick, wallet: Wallet):