- Added
createContinuousFuturesContract(symbol, exchange)
createFuturesContract()
accepts @SYMBOL (ie@ES
) and creates continuous contract
- Making
_get_active_account()
(formerly_get_default_account_if_none()
) more fool-proof
- Better hanling of MOO/MOC orders (+ in bracket orders)
- Cancelling orphan orders (stop/target) on same-instrument fills
- Automaticaly rounding order prices to acceptable ticksize for contract
- Added quantity, side, and sub-orders' ids to order metadata
- Setting
outsideRth
toFalse
ifTIF
isOPG
(for MOO orders) - Default target order type changed to
Market if Touched
- Using "ISLAND" exchanged when "NASDAQ" is entered (ISLAND = NASDAQ)
- Misc code refactoring and minor bug fixes
- Support for multiple/FA accounts!
- Get info using
getAccount('DUXXXXXX')
,getPositions('DUXXXXXX')
,getPortfolio('DUXXXXXX')
, orgetOrders('DUXXXXXX')
- Submit order to specific account using by specifing
account=DUXXXXXX
increate*Order()
orplaceOrder()
methods
handleTrailingStops()
checks for on "if touched"
handleNextValidId()
initiates new orderId counter for each session
handleNextValidId()
now handles multiple accounts better
- Fixed bug in
handleNextValidId()
createBracketOrder()
Waits 1ms between orders to ensure order submission
roundClosestValid()
auto-detects res
requestHistoricalData()
data parameter defaults toMIDPOINT
when requesting data for CASH/CFD.
requestHistoricalData()
data parameter defaults toMIDPOINT
when requesting data for CASH/CFD.- Force
int
type for order quantity increateOrder
- Trailing stop uses ticksize from
contractDetails()
- Convert port to
int
by default - Load working orders on startup
- Keep contract info in order data
- Misc bug fixes and code improvements
- Wait for conId in
createComboLeg()
- Ooption to specify the exchange in
createComboContract()
- Better on-demand contract creation (used in
handlePortfolio()
andhandlePositions()
when received contract that isn't found in local database)
totalPNL
(realized + unrealized pnl) is now always available in theportfolio
object
- Keeps Cancelled orders in
orders
object
createBracketOrder()
andmodifyStopOrder()
accepttransmit
parameter. Defaults toTrue
.- Contract collector holds latest contract data
- Error codes #202 (cancelled order) and #2109 (Outside RTH ignored) code added to
BENIGN_ERROR_CODES
- Option to convert historical data to UTC using
requestHistoricalData(..., utc=True)
. Defaults toFalse
.
- Bugfix in log_msg (issue #16)
- Checks for Python >= 3.4
- Better (not perfect) PEP8 compliance
- Cleaner code
- Fixed bug in
handleOrders
logger (bug introduced in version 1.12.47)
- Uses contract symbol in log message instead of contract object string (fix issue #13)
- Added Python 3.6 to
pip
setup
- Added order object to
self.orders
- Updated
createComboLeg
to handle different contract types - Added ability to specify
format_date
inrequestHistoricalData()
(defaults to2
, same as before)
- Properly handling empty
m_exchange
returned by IB inhandlePosition()
andhandlePortfolio()
- Replaced
print()
inhandleHistoricalData()
toself.log.info()
- Added
utils.contract_expiry_from_symbol()
for parsing contract's expiry from symbol - Code improvements and bug fixes in
- Code improvements and bug fixes in
- Returns empty lists in
getExpirations()
andgetStrikes()
for simple contracts
- Fixed bug in
handleContractDetails()
createOptionsContract()
andcreateFuturesContract()
now accepts lists as for expiry, stikes and sides (m_right) parameters to create multiple contracts at once- Options data now holds bid, ask, last and "synthetic" data for each field
handlePortfolio()
andhandlePositions()
creates new contracts as needed- Code improvements and minor bug fixes
- Set limit of 250 requests/sec on
reqMktData()
as per IB rules - Better detection of "multi" contracts
- Misc code improvements and minor bug fixes
- Handling "multi" contracts (when creating FUT/OPT/FOP with no
expiry
and/orstrike
and/orside
) - Added
getStrikes()
andgetExpirations()
to make it easier to list strikes/expiration dates for "multi" contracts - Introduced
createIndexContract()
method to easily create contracts for indices - Misc code improvements and minor bug fixes
- Minor bug fixes
- Introduced
reconnect()
method to re-establish lost connection to TWS/GW - Trying to automatically re-establish connection when connection to TWS/GW is lost
- Logging disconnect errors only once per occurrence until connected
- Misc code improvements and minor bug fixes
- All Futures, Options and Options on Futures contracts are now set to
m_includeExpired=True
by default - Handling
tickSnapshotEnd
event - Misc code improvements and minor bug fixes
- Added
getConId(contract_or_symbol_or_tickerId)
method for getting contract'sconId
- Added support for combo orders
- Added error code
200
to benign error codes (skip logging)
- Brought back (accidently) deleted
tif
functionality (closing issue #5)
- Added
requestContractDetails()
method for calling IB'sreqContractDetails()
. - Added container dict for contract details is stored in
contract_details[tickerId]
- Auto calls
requestContractDetails()
for every created contract - Contract details is availeble via
contract_details[tickerId]
orcontractDetails(contract_or_symbol_or_tickerId)
- No need to pass ticksize to
createTriggerableTrailingStop()
orregisterTriggerableTrailingStop()
(auto-uses data from contract details)
createBracketOrder
now passestif
to parent, target and stop child orders (closing issue #5)
- Switch to standard python logging and log errors to
stderr
by default. - Removed
self.ibConn.register(self.handleErrorEvents, 'Error')
so the code now calls this method from withinhandleServerEvents
- Disabled error callback for benign error codes (
2104
and2106
are not actually problems)
- Fixed bug that casued error when no
logger
specified
- Added two optional parameters to
__init__()
for auto-logging:logger
as the log type (either "stream" for stdout or "file") andlogger_file
as log file path (if logger == "file") - Pass entire message to
handleError
Callback
- Using
IbPy2
installer from PyPI (no need to installIbPy
seperately anymore)
- Added
snapshot
parameter torequestMarketData()
to allow request of single snapshot of market data and have the market data subscription cancel (defaults toFalse
)
- Fixed bug that casued malformed
contractString
for Asian Futures
- Uniformed options symbol construction (eg
AAPL20161028P00115000
,SPX20161024P02150000
) - Misc code improvements and minor bug fixes
- Misc code improvements and minor bug fixes
- Complete Options and Futures Options market data available via
optionsData
- Setting correct
m_includeExpired
for each asset class (solved a problem with historical data request not being acknowledged by TWS)
- Fixed some issues with stop limit and trailing stop orders
- Fixed some issues with stop limit and trailing stop orders
- Added flag for stop limit orders
- Misc code improvements and minor bug fixes
- Misc code improvements and minor bug fixes
- Misc code improvements and minor bug fixes
- Callback now fires on TWS errors and and passes one of IB's error codes.
- Callback fires upon lost connection to IB TWS/GW with the
handleConnectionClosed
event self.connected
holds latest connection status (True
/False
)
- Fixed bug that caused multiple ``clientId``s to be saved in the orderIds cache file. Now forcing saving of unique orderId in cache file.
cancelOrder()
not requiresorderId
- Better hadling of canceled orders
- Removed debugging code
- Caching last
orderId
to keep a persistentorderId
between TWS sessions (may require a one-time resetting of API Order ID Sequence, see Interactive Brokers's API for more information).
- Calls
requestPositionUpdates(...)
andrequestAccountUpdates(...)
upon connecting by default - Calls
requestOrderIds()
before every order submission to prevent conflicts with other programs submitting orders (other instances of ezIBpy included)
- Renamed
createFutureContract(...)
tocreateFuturesContract(...)
(old name still works for backward compatibility)
- Changed default exhange to IDEALPRO in
createCashContract(...)