Ejemplo n.º 1
0
    def log_start_data(self):
        self.log('PARAM', 'BEGIN')
        self.log('PARAM', 'trade_in', self.options.trade_in)
        self.log('PARAM', 'trade_pub', self.options.trade_pub)
        self.log('PARAM', 'trade_log', self.options.trade_log)
        self.log('PARAM', 'session_timeout_limit',
                 self.options.session_timeout_limit)
        self.log('PARAM', 'db_echo', self.options.db_echo)
        self.log('PARAM', 'sqlalchemy_engine', self.options.sqlalchemy_engine)
        self.log('PARAM', 'sqlalchemy_connection_string',
                 self.options.sqlalchemy_connection_string)
        self.log('PARAM', 'test_mode', self.options.test_mode)
        self.log('PARAM', 'dev_mode', self.options.dev_mode)
        self.log('PARAM', 'satoshi_mode', self.options.satoshi_mode)
        self.log('PARAM', 'order_matcher_disabled',
                 self.order_matcher_disabled)
        self.log('PARAM', 'global_email_language',
                 self.options.global_email_language)
        self.log('PARAM', 'END')

        from models import User, Deposit, DepositMethods, Order, Withdraw, Broker, Currency, Instrument, Ledger

        currencies = self.db_session.query(Currency)
        for currency in currencies:
            self.log('DB_ENTITY', 'CURRENCY', currency)

        instruments = self.db_session.query(Instrument)
        for instrument in instruments:
            self.log('DB_ENTITY', 'INSTRUMENT', instrument)

        users = self.db_session.query(User)
        for user in users:
            self.log('DB_ENTITY', 'USER', user)

        # log all users on the replay log
        brokers = self.db_session.query(Broker)
        for broker in brokers:
            Broker.cache_broker(broker.id, broker)
            self.log('DB_ENTITY', 'BROKER', broker)

        deposit_options = self.db_session.query(DepositMethods)
        for deposit_option in deposit_options:
            self.log('DB_ENTITY', 'DEPOSIT_OPTION', deposit_option)

        deposits = self.db_session.query(Deposit)
        for deposit in deposits:
            self.log('DB_ENTITY', 'DEPOSIT', repr(deposit))

        withdraws = self.db_session.query(Withdraw)
        for withdraw in withdraws:
            self.log('DB_ENTITY', 'WITHDRAW', withdraw)

        ledgers = self.db_session.query(Ledger)
        for ledger in ledgers:
            self.log('DB_ENTITY', 'LEDGER', ledger)

        orders = self.db_session.query(Order).filter(
            Order.status.in_(("0", "1"))).order_by(Order.created)
        for order in orders:
            self.log('DB_ENTITY', 'ORDER', order)
Ejemplo n.º 2
0
  def log_start_data(self):
    self.log('PARAM','BEGIN')
    self.log('PARAM','trade_in'                     ,self.options.trade_in)
    self.log('PARAM','trade_pub'                    ,self.options.trade_pub)
    self.log('PARAM','trade_log'                    ,self.options.trade_log)
    self.log('PARAM','session_timeout_limit'        ,self.options.session_timeout_limit)
    self.log('PARAM','db_echo'                      ,self.options.db_echo)
    self.log('PARAM','sqlalchemy_engine'            ,self.options.sqlalchemy_engine)
    self.log('PARAM','sqlalchemy_connection_string' ,self.options.sqlalchemy_connection_string)
    self.log('PARAM','test_mode'                    ,self.options.test_mode)
    self.log('PARAM','dev_mode'                     ,self.options.dev_mode)
    self.log('PARAM','satoshi_mode'                 ,self.options.satoshi_mode)
    self.log('PARAM','order_matcher_disabled'       ,self.order_matcher_disabled)
    self.log('PARAM','global_email_language'        ,self.options.global_email_language)
    self.log('PARAM','END')


    from models import User, Deposit, DepositMethods, Order, Withdraw, Broker, Currency, Instrument, Ledger


    currencies = self.db_session.query(Currency)
    for currency in currencies:
      self.log('DB_ENTITY', 'CURRENCY', currency)

    instruments = self.db_session.query(Instrument)
    for instrument in instruments:
      self.log('DB_ENTITY', 'INSTRUMENT', instrument)

    users = self.db_session.query(User)
    for user in users:
      self.log('DB_ENTITY', 'USER', user)

    # log all users on the replay log
    brokers = self.db_session.query(Broker)
    for broker in brokers:
      Broker.cache_broker(broker.id, broker)
      self.log('DB_ENTITY', 'BROKER', broker)

    deposit_options = self.db_session.query(DepositMethods)
    for deposit_option in deposit_options:
      self.log('DB_ENTITY', 'DEPOSIT_OPTION',  deposit_option)

    deposits = self.db_session.query(Deposit)
    for deposit in deposits:
      self.log('DB_ENTITY', 'DEPOSIT',  repr(deposit))

    withdraws = self.db_session.query(Withdraw)
    for withdraw in withdraws:
      self.log('DB_ENTITY', 'WITHDRAW', withdraw )

    ledgers = self.db_session.query(Ledger)
    for ledger in ledgers:
      self.log('DB_ENTITY', 'LEDGER', ledger )

    orders = self.db_session.query(Order).filter(Order.status.in_(("0", "1"))).order_by(Order.created)
    for order in orders:
      self.log('DB_ENTITY','ORDER',order)
Ejemplo n.º 3
0
    def log_start_data(self):
        self.log("PARAM", "BEGIN")
        self.log("PARAM", "trade_in", self.options.trade_in)
        self.log("PARAM", "trade_pub", self.options.trade_pub)
        self.log("PARAM", "trade_log", self.options.trade_log)
        self.log("PARAM", "session_timeout_limit", self.options.session_timeout_limit)
        self.log("PARAM", "db_echo", self.options.db_echo)
        self.log("PARAM", "sqlalchemy_engine", self.options.sqlalchemy_engine)
        self.log("PARAM", "sqlalchemy_connection_string", self.options.sqlalchemy_connection_string)
        self.log("PARAM", "test_mode", self.options.test_mode)
        self.log("PARAM", "dev_mode", self.options.dev_mode)
        self.log("PARAM", "satoshi_mode", self.options.satoshi_mode)
        self.log("PARAM", "order_matcher_disabled", self.order_matcher_disabled)
        self.log("PARAM", "global_email_language", self.options.global_email_language)
        self.log("PARAM", "END")

        from models import (
            User,
            Deposit,
            DepositMethods,
            Order,
            Withdraw,
            Broker,
            Currency,
            Instrument,
            ApiAccess,
            Balance,
            Position,
            GreenAddresses,
        )

        green_address_list = self.db_session.query(GreenAddresses)
        for green_address_entity in green_address_list:
            self.log("DB_ENTITY", "GREEN_ADDRESS", green_address_entity)

        currencies = self.db_session.query(Currency)
        for currency in currencies:
            self.log("DB_ENTITY", "CURRENCY", currency)

        instruments = self.db_session.query(Instrument)
        for instrument in instruments:
            self.log("DB_ENTITY", "INSTRUMENT", instrument)

        users = self.db_session.query(User)
        for user in users:
            self.log("DB_ENTITY", "USER", user)

        api_access_list = self.db_session.query(ApiAccess)
        for api_access_entity in api_access_list:
            self.log("DB_ENTITY", "API_ACCESS", api_access_entity)

        # log all users on the replay log
        brokers = self.db_session.query(Broker)
        for broker in brokers:
            Broker.cache_broker(broker.id, broker)
            self.log("DB_ENTITY", "BROKER", broker)

        deposit_options = self.db_session.query(DepositMethods)
        for deposit_option in deposit_options:
            self.log("DB_ENTITY", "DEPOSIT_OPTION", deposit_option)

        deposits = self.db_session.query(Deposit)
        for deposit in deposits:
            self.log("DB_ENTITY", "DEPOSIT", repr(deposit))

        withdraws = self.db_session.query(Withdraw)
        for withdraw in withdraws:
            self.log("DB_ENTITY", "WITHDRAW", withdraw)

        balance_list = self.db_session.query(Balance)
        for balance_entity in balance_list:
            self.log("DB_ENTITY", "BALANCE", balance_entity)

        position_list = self.db_session.query(Position)
        for position_entity in position_list:
            self.log("DB_ENTITY", "POSITION", position_entity)

        orders = self.db_session.query(Order).filter(Order.status.in_(("0", "1"))).order_by(Order.created)
        for order in orders:
            self.log("DB_ENTITY", "ORDER", order)
Ejemplo n.º 4
0
    def log_start_data(self):
        self.log('PARAM', 'BEGIN')
        self.log('PARAM', 'trade_in', self.options.trade_in)
        self.log('PARAM', 'trade_pub', self.options.trade_pub)
        self.log('PARAM', 'trade_log', self.options.trade_log)
        self.log('PARAM', 'session_timeout_limit',
                 self.options.session_timeout_limit)
        self.log('PARAM', 'db_echo', self.options.db_echo)
        self.log('PARAM', 'sqlalchemy_engine', self.options.sqlalchemy_engine)
        self.log('PARAM', 'sqlalchemy_connection_string',
                 self.options.sqlalchemy_connection_string)
        self.log('PARAM', 'test_mode', self.options.test_mode)
        self.log('PARAM', 'dev_mode', self.options.dev_mode)
        self.log('PARAM', 'satoshi_mode', self.options.satoshi_mode)
        self.log('PARAM', 'order_matcher_disabled',
                 self.order_matcher_disabled)
        self.log('PARAM', 'global_email_language',
                 self.options.global_email_language)
        self.log('PARAM', 'END')


        from models import User, Deposit, DepositMethods, Order, Withdraw, Broker, \
          Currency, Instrument, ApiAccess, Balance, Position, GreenAddresses

        green_address_list = self.db_session.query(GreenAddresses)
        for green_address_entity in green_address_list:
            self.log('DB_ENTITY', 'GREEN_ADDRESS', green_address_entity)

        currencies = self.db_session.query(Currency)
        for currency in currencies:
            self.log('DB_ENTITY', 'CURRENCY', currency)

        instruments = self.db_session.query(Instrument)
        for instrument in instruments:
            self.log('DB_ENTITY', 'INSTRUMENT', instrument)

        users = self.db_session.query(User)
        for user in users:
            self.log('DB_ENTITY', 'USER', user)

        api_access_list = self.db_session.query(ApiAccess)
        for api_access_entity in api_access_list:
            self.log('DB_ENTITY', 'API_ACCESS', api_access_entity)

        # log all users on the replay log
        brokers = self.db_session.query(Broker)
        for broker in brokers:
            Broker.cache_broker(broker.id, broker)
            self.log('DB_ENTITY', 'BROKER', broker)

        deposit_options = self.db_session.query(DepositMethods)
        for deposit_option in deposit_options:
            self.log('DB_ENTITY', 'DEPOSIT_OPTION', deposit_option)

        deposits = self.db_session.query(Deposit)
        for deposit in deposits:
            self.log('DB_ENTITY', 'DEPOSIT', repr(deposit))

        withdraws = self.db_session.query(Withdraw)
        for withdraw in withdraws:
            self.log('DB_ENTITY', 'WITHDRAW', withdraw)

        balance_list = self.db_session.query(Balance)
        for balance_entity in balance_list:
            self.log('DB_ENTITY', 'BALANCE', balance_entity)

        position_list = self.db_session.query(Position)
        for position_entity in position_list:
            self.log('DB_ENTITY', 'POSITION', position_entity)

        orders = self.db_session.query(Order).filter(
            Order.status.in_(("0", "1"))).order_by(Order.created)
        for order in orders:
            self.log('DB_ENTITY', 'ORDER', order)