Example #1
0
 def ByISIN():
     contract = Contract()
     contract.secIdType = "ISIN"
     contract.secId = "US45841N1072"
     contract.exchange = "SMART"
     contract.currency = "USD"
     contract.secType = "STK"
     return contract
Example #2
0
    def make_contract(self, symbol):
        """Create a contract for the given symbol.
        Arguments:
        symbol (str): Ticker symbol
        """
        contract_info = self.get_contract_details(symbol)
        contract = Contract()
        contract.symbol = symbol
        contract.currency = contract_info['currency']
        contract.exchange = contract_info['exchange']
        contract.primaryExchange = contract_info['primaryExchange']
        contract.secType = contract_info['secType']
        contract.secId = contract_info['secId']

        return contract