Support `Forex` in the pp packer
parent
4e5df973a9
commit
cef511092d
|
@ -36,6 +36,7 @@ import tractor
|
|||
from ib_insync.contract import (
|
||||
Contract,
|
||||
Option,
|
||||
Forex,
|
||||
)
|
||||
from ib_insync.order import (
|
||||
Trade,
|
||||
|
@ -88,9 +89,18 @@ def pack_position(
|
|||
# TODO: lookup fqsn even for derivs.
|
||||
symbol = con.symbol.lower()
|
||||
|
||||
# TODO: probably write a mofo exchange mapper routine since ib
|
||||
# can't get it's shit together like, ever.
|
||||
|
||||
# try our best to figure out the exchange / venue
|
||||
exch = (con.primaryExchange or con.exchange).lower()
|
||||
if not exch:
|
||||
|
||||
if isinstance(con, Forex):
|
||||
# bc apparently it's not in the contract obj?
|
||||
exch = 'idealfx'
|
||||
|
||||
else:
|
||||
# for wtv cucked reason some futes don't show their
|
||||
# exchange (like CL.NYMEX) ...
|
||||
entry = _adhoc_symbol_map.get(
|
||||
|
|
Loading…
Reference in New Issue