Skip to content

Commit

Permalink
fix "symol"
Browse files Browse the repository at this point in the history
  • Loading branch information
meltingscales committed May 4, 2022
1 parent 63305de commit 9499673
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions quanttrader/brokerage/ib_brokerage.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def symbol_to_contract(symbol):
ib_contract.currency = 'USD'
ib_contract.exchange = symbol_fields[2]
elif symbol_fields[1] == 'CASH':
ib_contract.symol = symbol_fields[0][0:3] # EUR
ib_contract.symbol = symbol_fields[0][0:3] # EUR
ib_contract.secType = symbol_fields[1] # CASH
ib_contract.currency = symbol_fields[0][3:] # GBP
ib_contract.exchange = symbol_fields[2] # IDEALPRO
Expand Down Expand Up @@ -474,7 +474,7 @@ def contract_to_symbol(ib_contract):
if ib_contract.secType == 'STK':
full_symbol = ' '.join([ib_contract.localSymbol, 'STK', 'SMART']) # or ib_contract.primaryExchange?
elif ib_contract.secType == 'CASH':
full_symbol = ' '.join([ib_contract.symol+ib_contract.currency, 'CASH', ib_contract.exchange])
full_symbol = ' '.join([ib_contract.symbol+ib_contract.currency, 'CASH', ib_contract.exchange])
elif ib_contract.secType == 'FUT':
full_symbol = ' '.join([ib_contract.localSymbol.replace(' ', '_'), 'FUT',
ib_contract.primaryExchange if ib_contract.primaryExchange != ''
Expand Down

0 comments on commit 9499673

Please sign in to comment.