class SymbolList(object):
class Symbol(object):
    def __init__(self, symbols):
    def get(self, symbol):
    def __repr__(self):
    def __str__(self):
    def __iter__(self):
    def __init__(self, symbol):
    def __repr__(self):
    def __str__(self):
    def __hash__(self):
    def __eq__(self, other):
    def custom(self, name): class NoDataException(Exception):
class DataConnection(object):
class YahooConnection(DataConnection):
class GoogleConnection(DataConnection):
class OandaConnection(DataConnection):
class ForexiteConnection(DataConnection):
class MySQLConnection(DataConnection):
class MongoDatabaseConnection(DataConnection):
    def __init__(self):
    def __str__(self):
    def get_data(self, symbol, start, end):
    def _request(self, url):
    def get_data(self, symbol, start, end, symbol_in_column=True):
    def get_ticks(self, symbol, period='15d', interval=60, symbol_in_column=True):
    def __init__(self, account_id, access_token, environment='practice'):
    def __str__(self):
    def __repr__(self):
    def get_data(self, symbol, granularity='H1', periods=5000, \
                       realtime=False, symbol_in_column=True):
    def get_data(self, start, end):
    def __init__(self, host='localhost', port=3306, database='symbol_data', \
                 username='root', password=''):
    def get_data(self, symbol, start, end, volume=False,
                 date_column='date', custom_cols=None):
    def __init__(self, host='127.0.0.1', port=27017, database='symbol-data', \
                 username=None, password=None):
    def get_data(self, symbol, start, end, symbol_in_column=True):
    def set_data(self, data_frame, symbols, volume=True, adj_close=True):
def populate_mongo_day(symbols, start, end, database='symbol-data'):
def populate_mongo_minute(symbols, period='15d', database='symbol-data-1min'):
def populate_currency_minute(start, end, sleep=None, database='symbol-data-1min-currency'):
def populate_oanda_currency(account_id, access_token, symbols, granularity='M5', \
                            periods=5000, database='symbol-data-5min-currency'):
def convert_1min_to_5min(db_name_1min, db_name_5min, symbols, start, end, volume=False):
def convert_5min_to_15min(db_name_5min, db_name_15min, symbols, start, end, volume=False):
    URL = "http://www.forexite.com/free_forex_quotes/%s/%s/%s%s%s.zip" class Dataset(object):
    def __init__(self, symbol_list, data_connection, start_datetime=None, \
                 end_datetime=None, periods=None, granularity=None):
    def __str__(self):
    def __repr__(self):
    def load_data(self, realtime=False, **kwargs):
    def resample(self, timeframe, volume=True, adjusted_close=False, symbol=None):
    def _resample(self, timeframe, volume, adjusted_close, symbol):
    def add_technical_indicator(self, technical_indicator):
    def update_technical_indicators(self): class TechnicalIndicator(object):
class Pair(TechnicalIndicator):
class Addition(TechnicalIndicator):
class Subtraction(TechnicalIndicator):
class Multiplication(TechnicalIndicator):
class Division(TechnicalIndicator):
class PercentChange(TechnicalIndicator):
class Max(TechnicalIndicator):
class Min(TechnicalIndicator):
class InvalidShift(Exception):
class Shift(TechnicalIndicator):
class SMA(TechnicalIndicator):
class EMA(TechnicalIndicator):
class RSI(TechnicalIndicator):
class ATR(TechnicalIndicator):
class BBANDS(TechnicalIndicator):
class DX(TechnicalIndicator):
class ADX(TechnicalIndicator):
class ULTOSC(TechnicalIndicator):
class STOCH(TechnicalIndicator):
class STOCHF(TechnicalIndicator):
class NeuralNetwork(TechnicalIndicator):
class Ensemble(TechnicalIndicator):
    def __init__(self):
    def results(self, data_frame):
    def __init__(self, y_data, x_data, lookback):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, data1, data2):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, data1, data2):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, data1, data2):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, data1, data2):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, data1, data2):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, data, period):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, data, period):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, data, period):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, data, period):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, data, period):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, data, period):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, symbol, period):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, data, period, devup=2, devdown=2, ma_type=talib.MA_Type.T3):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, symbol, period):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, symbol, period):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, symbol, period1, period2, period3):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, symbol, fast_k_period=5, slow_k_period=3,
                 slow_k_ma_type=talib.MA_Type.SMA, slow_d_period=3,
                 slow_d_ma_type=talib.MA_Type.SMA):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, symbol, fast_k_period=5, fast_d_period=3,
                 fast_d_ma_type=talib.MA_Type.SMA):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, network, name=None):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame):
    def __init__(self, ensemble, name=None):
    def __str__(self):
    def __repr__(self):
    def results(self, data_frame): class Criteria(object):
class BarsSinceAction(Criteria):
class BarsSinceLong(BarsSinceAction):
class BarsSinceShort(BarsSinceAction):
class BarsSinceLongExit(BarsSinceAction):
class BarsSinceShortExit(BarsSinceAction):
class InMarket(Criteria):
class IsLong(Criteria):
class IsShort(Criteria):
class StopLoss(Criteria):
class TakeProfit(Criteria):
class TrailingStop(Criteria):
class IsYear(Criteria):
class IsMonth(Criteria):
class IsDay(Criteria):
class IsWeekDay(Criteria):
class Above(Criteria):
class Below(Criteria):
class Equals(Criteria):
class InRange(Criteria):
class Not(Criteria):
class CrossingAbove(Criteria):
class CrossingBelow(Criteria):
    def __init__(self):
    def __init__(self, symbol, action, periods, condition=None):
    def __str__(self):
    def __repr__(self):
    def apply(self, data_frame):
    def __init__(self, symbol, periods, condition=None):
    def __str__(self):
    def __init__(self, symbol, periods, condition=None):
    def __str__(self):
    def __init__(self, symbol, periods, condition=None):
    def __str__(self):
    def __init__(self, symbol, periods, condition=None):
    def __str__(self):
    def __init__(self, symbol):
    def __str__(self):
    def __repr__(self):
    def apply(self, data_frame):
    def __init__(self, symbol):
    def __str__(self):
    def __repr__(self):
    def apply(self, data_frame):
    def __init__(self, symbol):
    def __str__(self):
    def __repr__(self):
    def apply(self, data_frame):
    def __init__(self, symbol, value, short=False, percent=False):
    def __str__(self):
    def __repr__(self):
    def apply(self, data_frame):
    def __init__(self, symbol, value, short=False):
    def __str__(self):
    def __repr__(self):
    def apply(self, data_frame):
    def __init__(self, symbol, value, short=False, percent=False):
    def __str__(self):
    def __repr__(self):
    def apply(self, data_frame):
    def __init__(self, year):
    def __str__(self):
    def __repr__(self):
    def apply(self, data_frame):
    def __init__(self, month):
    def __str__(self):
    def __repr__(self):
    def apply(self, data_frame):
    def __init__(self, day):
    def __str__(self):
    def __repr__(self):
    def apply(self, data_frame):
    def __init__(self, weekday):
    def __str__(self):
    def __repr__(self):
    def apply(self, data_frame):
    def __init__(self, param1, param2, lookback=1):
    def __str__(self):
    def __repr__(self):
    def apply(self, data_frame):
    def __init__(self, param1, param2, lookback=1):
    def __str__(self):
    def __repr__(self):
    def apply(self, data_frame):
    def __init__(self, param1, param2, lookback=1):
    def __str__(self):
    def __repr__(self):
    def apply(self, data_frame):
    def __init__(self, ti, min_range, max_range):
    def __str__(self):
    def __repr__(self):
    def apply(self, data_frame):
    def __init__(self, criteria):
    def __str__(self):
    def __repr__(self):
    def apply(self, data_frame):
    def __init__(self, param1, param2):
    def __repr__(self):
    def __str__(self):
    def apply(self, data_frame):
    def __init__(self, param1, param2):
    def __repr__(self):
    def __str__(self):
    def apply(self, data_frame): class InvalidAction(Exception):
class CriteriaGroup(object):
    def __init__(self, criteria_list, action, symbol):
    def __str__(self):
    def __repr__(self):
    def get_result(self, data_frame): class TradingProfile(object):
    def __init__(self, capital, trading_amount, trading_fee, slippage=0.0):
    def __str__(self):
    def __repr__(self): class TradingAmount(object):
class StaticAmount(TradingAmount):
class NumberOfShares(TradingAmount):
class CapitalPercentage(TradingAmount):
class KellyCriterion(TradingAmount):
    def __init__(self):
    def __init__(self, amount, round_up=False):
    def __str__(self):
    def __repr__(self):
    def get_shares(self, price, available_money): # pylint: disable=unused-argument
    def __init__(self, shares):
    def __str__(self):
    def __repr__(self):
    def get_shares(self, price, available_money): # pylint: disable=unused-argument
    def __init__(self, percent):
    def __str__(self):
    def __repr__(self):
    def get_shares(self, price, available_money):
    def __init__(self, win_probability, average_gains, average_losses):
    def __str__(self):
    def __repr__(self):
    def get_shares(self, price, available_money): # pylint: disable=unused-argument class TradingFee(object):
class StaticFee(TradingFee):
    def __init__(self):
    def __init__(self, fee):
    def __str__(self):
    def __repr__(self):
    def get_fee(self, price, shares): # pylint: disable=unused-argument class Strategy(object):
    def __init__(self, dataset, criteria_groups, trading_profile):
    def __str__(self):
    def __repr__(self):
    def simulate(self):
    def process_new_data(self, data):
    def get_next_action(self):
    def _determine_action(self, values):
    def _get_status(self, symbol):
    def _create_actions_status_columns(self, data_frame, symbol): class Long(Action):
    """
    Long Action represents going long in the market.
    """
    def __init__(self):
        Action.__init__(self, 'long')
    def raw(self):
        """
        A raw (int) representation of the action.
        """
        return LONG class Short(Action):
    """
    Short Action represents shorting in the market.
    """
    def __init__(self):
        Action.__init__(self, 'short')
    def raw(self):
        """
        A raw (int) representation of the action.
        """
        return SHORT class LongExit(Action):
    """
    Long Exit Action represents exiting a long position from the market.
    """
    def __init__(self):
        Action.__init__(self, 'longexit')
    def __eq__(self, other):
        other = str(other).replace(' ', '').replace('_', '').replace('-', '').lower()
        return other == 'longexit' or other == 'exitlong'
    def raw(self):
        """
        A raw (int) representation of the action.
        """
        return LONG_EXIT class ShortExit(Action):
    """
    Short Exit Action represents exiting a short position from the market.
    """
    def __init__(self):
        Action.__init__(self, 'shortexit')
    def __eq__(self, other):
        other = str(other).replace(' ', '').replace('_', '').replace('-', '').lower()
        return other == 'shortexit' or other == 'exitshort'
    def raw(self):
        """
        A raw (int) representation of the action.
        """
        return SHORT_EXIT
import datetime
from nowtrade import symbol_list, data_connection, dataset, technical_indicator, \
                     criteria, criteria_group, trading_profile, trading_amount, \
                     trading_fee, strategy
from nowtrade.action import Long, Short, LongExit, ShortExit

dc = data_connection.YahooConnection()
sl = symbol_list.SymbolList(['GOOGL'])
symbol = sl.get('GOOGL')
start = datetime.datetime(2010, 01, 01)
end = datetime.datetime(2015, 01, 01)
d = dataset.Dataset(sl, dc, start, end)
d.load_data()
sma100 = technical_indicator.SMA(symbol.close, 100)
d.add_technical_indicator(sma100)
high7 = technical_indicator.Max(symbol.close, 7)
d.add_technical_indicator(high7)
low7 = technical_indicator.Min(symbol.close, 7)
d.add_technical_indicator(low7)
# Enter Long
enter_crit_long1 = criteria.Above(symbol.close, sma100.value)
enter_crit_long2 = criteria.Equals(symbol.close, low7.value)
enter_crit_short1 = criteria.Below(symbol.close, sma100.value)
enter_crit_short2 = criteria.Equals(symbol.close, high7.value)
# Exit Long
exit_crit_long1 = criteria.StopLoss(symbol, 5)
exit_crit_long2 = criteria.TakeProfit(symbol, 10)
exit_crit_short1 = criteria.StopLoss(symbol, 5)
exit_crit_short2 = criteria.TakeProfit(symbol, 10)
# Criteria Groups
enter_crit_group1 = criteria_group.CriteriaGroup([enter_crit_long1, enter_crit_long2], Long(), symbol)
enter_crit_group2 = criteria_group.CriteriaGroup([enter_crit_short1, enter_crit_short2], Short(), symbol)
exit_crit_group1 = criteria_group.CriteriaGroup([exit_crit_long1], LongExit(), symbol)
exit_crit_group2 = criteria_group.CriteriaGroup([exit_crit_long2], LongExit(), symbol)
exit_crit_group3 = criteria_group.CriteriaGroup([exit_crit_short1], ShortExit(), symbol)

exit_crit_group4 = criteria_group.CriteriaGroup([exit_crit_short2], ShortExit(), symbol)