コード例 #1
0
    def __init__(self, time_provider=None, config_filepath=None):
        # Time manager
        self.time_provider = time_provider if time_provider else TimeProvider()
        # Set timezone
        set(pytz.all_timezones_set)

        # Load configuration
        self.config = Configuration.from_filepath(config_filepath)

        # Setup the global logger
        self.setup_logging()

        # Init trade services and create the broker interface
        # The Factory is used to create the services from the configuration file
        self.broker = Broker(BrokerFactory(self.config))

        # Create strategy from the factory class
        self.strategy = StrategyFactory(self.config,
                                        self.broker).make_from_configuration()

        # Create the market provider
        self.market_provider = MarketProvider(self.config, self.broker)
コード例 #2
0
def config():
    config = Configuration.from_filepath("test/test_data/config.json")
    config.config["strategies"]["active"] = "simple_macd"
    config.config["stocks_interface"]["active"] = "alpha_vantage"
    config.config["stocks_interface"]["alpha_vantage"]["api_timeout"] = 0
    return config
コード例 #3
0
def config():
    config = Configuration.from_filepath("test/test_data/config.json")
    config.config["strategies"]["active"] = "weighted_avg_peak"
    return config
コード例 #4
0
def config():
    """
    Returns a dict with config parameter for strategy and simpleMACD
    """
    return Configuration.from_filepath("test/test_data/config.json")
コード例 #5
0
def config():
    return Configuration.from_filepath("test/test_data/config.json")