示例#1
0
def main():
    # Load settings and create the config object

    config = conf.Configuration()
    settings = config.fetch_settings()

    # Set up logger
    logs.configure_logging(settings['loglevel'], settings['log_mode'])

    behaviour_manager = Behaviour(config)
    behaviour = behaviour_manager.get_behaviour(settings['selected_task'])

    # set up async
    behaviour.run(settings['market_pairs'], settings['update_interval'])
示例#2
0
def main():
    """Initializes the application
    """
    # Load settings and create the config object
    config = conf.Configuration()
    settings = config.get_settings()

    # Set up logger
    logs.configure_logging(settings['loglevel'], settings['log_mode'])

    # Configure and run configured behaviour.
    behaviour_manager = Behaviour(config)
    behaviour = behaviour_manager.get_behaviour(settings['selected_task'])

    while True:
        behaviour.run(settings['market_pairs'])
        time.sleep(settings['update_interval'])
示例#3
0
def main():
    # Load settings and create the config object

    config = conf.Configuration()
    settings = config.fetch_settings()
    exchange_config = config.fetch_exchange_config()
    notifier_config = config.fetch_notifier_config()
    behaviour_config = config.fetch_behaviour_config()

    # Set up logger
    logs.configure_logging(settings['loglevel'], settings['app_mode'])

    exchange_interface = ExchangeInterface(exchange_config)
    strategy_analyzer = StrategyAnalyzer(exchange_interface)
    notifier = Notifier(notifier_config)
    behaviour_manager = Behaviour(behaviour_config)

    behaviour = behaviour_manager.get_behaviour(settings['selected_task'])

    behaviour.run(settings['symbol_pairs'], settings['update_interval'],
                  exchange_interface, strategy_analyzer, notifier)
示例#4
0
def main():
    """Initializes the application
    """
    # Load settings and create the config object
    config = conf.Configuration()
    settings = config.settings

    # Set up logger
    logs.configure_logging(settings['loglevel'], settings['log_mode'])
    logger = structlog.get_logger()

    # Configure and run configured behaviour.
    behaviour_manager = Behaviour(config)
    behaviour = behaviour_manager.get_behaviour(settings['selected_task'])

    if isinstance(behaviour, ServerBehaviour):
        behaviour.run(debug=False)
    else:
        while True:
            behaviour.run(settings['market_pairs'])
            logger.info("Sleeping for %s seconds", settings['update_interval'])
            time.sleep(settings['update_interval'])
示例#5
0
def main():
    """Initializes the application
    """
    # Load settings and create the config object
    config = conf.Configuration()
    settings = config.settings

    # Set up logger
    logs.configure_logging(settings['loglevel'], settings['log_mode'])
    logger = structlog.get_logger()

    # Configure and run configured behaviour.
    exchange_interface = ExchangeInterface(config.exchanges)
    strategy_analyzer = StrategyAnalyzer()
    notifier = Notifier(config.notifiers)

    behaviour = Behaviour(config.behaviour, exchange_interface,
                          strategy_analyzer, notifier)

    while True:
        behaviour.run(settings['market_pairs'])
        logger.info("Sleeping for %s seconds", settings['update_interval'])
        time.sleep(settings['update_interval'])