Exemplo n.º 1
0
    def __init__(self, server, options):
        Connector.__init__(self, "ig.com", server, options)

        self._host = "ig.com"
        self._base_url = "/api/v2/"
        self._timeout = 7
        self._connected = False
        self._server = server

        # config
        self._host = options['connector'].get('host', "ig.com")
        self._account_id = options['connector'].get('accountId', "")
        self.__username = options['connector'].get('username', "")
        self.__password = options['connector'].get('password', "")
        self.__api_key = options['connector'].get('apiKey', "")

        self._session = None
        self._ig_service = None
        self._client_id = None
        self._lightstreamer = None

        self._account_type = "LIVE" if self._host == "api.ig.com" else "DEMO"

        self._cached_tick = {}  # last cached tick when none value
        self._ig_tick_subscriptions = {}  # tick subscriptions id per market id

        # trader capacity, instanciate it
        self._trader = IGTrader(self)
Exemplo n.º 2
0
 def __init__(self):
     Connector.__init__(self)
     sys.stderr.write('Deleter initialized\n')
Exemplo n.º 3
0
 def __init__(self, url):
     Connector.__init__(self, url)
     self.buffers = collections.defaultdict(MockFile)
     self.removed_files = []
Exemplo n.º 4
0
 def __init__(self):
     Connector.__init__(self)
     sys.stderr.write('Deleter initialized\n')
Exemplo n.º 5
0
 def __init__(self, url):
     Connector.__init__(self, url)
     self.buffers = collections.defaultdict(MockFile)
     self.removed_files = []
Exemplo n.º 6
0
 def __init__(self, credentials=None):
     Connector.__init__(self)
     self.credentials = credentials
Exemplo n.º 7
0
 def __init__(self, credentials = None):
     Connector.__init__(self)
     self.credentials = credentials
Exemplo n.º 8
0
 def __init__(self, url):
     Connector.__init__(self, url)
     # recreate all mock objects every time an instance is created
     self.setup()
Exemplo n.º 9
0
 def __init__(self, url):
     Connector.__init__(self, url)
     # recreate all mock objects every time an instance is created
     self.setup()