Esempio n. 1
0
    def paper(debug, dev, fee):
        """
        trades in real-time on exchange with PAPER money
        """
        validate_cwd()

        # set trading mode
        from jesse.config import config
        config['app']['trading_mode'] = 'papertrade'

        register_custom_exception_handler()

        # debug flag
        config['app']['debug_mode'] = debug

        from plugins.live import init
        from jesse.services.selectors import get_exchange

        # fee flag
        if not fee:
            for e in config['app']['trading_exchanges']:
                config['env']['exchanges'][e]['fee'] = 0
                get_exchange(e).fee = 0

        # inject live config
        init(config)

        # execute live session
        from plugins.live.live_mode import run
        run(dev)
Esempio n. 2
0
    def live(testdrive: bool, debug: bool, dev: bool, fee: bool) -> None:
        """
        trades in real-time on exchange with REAL money
        """
        validate_cwd()

        # set trading mode
        from jesse.config import config
        config['app']['trading_mode'] = 'livetrade'
        config['app']['is_test_driving'] = testdrive

        register_custom_exception_handler()

        # debug flag
        config['app']['debug_mode'] = debug

        from plugins.live import init
        from jesse.services.selectors import get_exchange

        # fee flag
        if not fee:
            for e in config['app']['trading_exchanges']:
                config['env']['exchanges'][e]['fee'] = 0
                get_exchange(e).fee = 0

        # inject live config
        init(config)

        # execute live session
        from plugins.live.live_mode import run
        run(dev)
Esempio n. 3
0
    def paper(debug: bool, dev: bool) -> None:
        """
        trades in real-time on exchange with PAPER money
        """
        validate_cwd()

        # set trading mode
        from jesse.config import config
        config['app']['trading_mode'] = 'papertrade'

        register_custom_exception_handler()

        # debug flag
        config['app']['debug_mode'] = debug

        from plugins.live import init
        from jesse.services.selectors import get_exchange
        live_config = locate('live-config.config')

        # inject live config
        init(config, live_config)

        # execute live session
        from plugins.live.live_mode import run
        run(dev)
Esempio n. 4
0
    def collect():
        """
        fetches streamed market data such as tickers, trades, and orderbook from
        the WS connection and stores them into the database for later research.
        """
        validate_cwd()

        # set trading mode
        from jesse.config import config
        config['app']['trading_mode'] = 'collect'

        register_custom_exception_handler()

        from plugins.live.collect_mode import run

        run()