Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _createEvents(self):
self.connectedEvent = Event('connectedEvent')
self.disconnectedEvent = Event('disconnectedEvent')
self.updateEvent = Event('updateEvent')
self.pendingTickersEvent = Event('pendingTickersEvent')
self.barUpdateEvent = Event('barUpdateEvent')
self.newOrderEvent = Event('newOrderEvent')
self.orderModifyEvent = Event('orderModifyEvent')
self.cancelOrderEvent = Event('cancelOrderEvent')
self.openOrderEvent = Event('openOrderEvent')
self.orderStatusEvent = Event('orderStatusEvent')
self.execDetailsEvent = Event('execDetailsEvent')
self.commissionReportEvent = Event('commissionReportEvent')
self.updatePortfolioEvent = Event('updatePortfolioEvent')
self.positionEvent = Event('positionEvent')
self.accountValueEvent = Event('accountValueEvent')
self.accountSummaryEvent = Event('accountSummaryEvent')
self.pnlEvent = Event('pnlEvent')
self.pnlSingleEvent = Event('pnlSingleEvent')
self.scannerDataEvent = Event('scannerDataEvent')
self.tickNewsEvent = Event('tickNewsEvent')
self.newsBulletinEvent = Event('newsBulletinEvent')
self.errorEvent = Event('errorEvent')
self.timeoutEvent = Event('timeoutEvent')
self.pendingTickersEvent = Event('pendingTickersEvent')
self.barUpdateEvent = Event('barUpdateEvent')
self.newOrderEvent = Event('newOrderEvent')
self.orderModifyEvent = Event('orderModifyEvent')
self.cancelOrderEvent = Event('cancelOrderEvent')
self.openOrderEvent = Event('openOrderEvent')
self.orderStatusEvent = Event('orderStatusEvent')
self.execDetailsEvent = Event('execDetailsEvent')
self.commissionReportEvent = Event('commissionReportEvent')
self.updatePortfolioEvent = Event('updatePortfolioEvent')
self.positionEvent = Event('positionEvent')
self.accountValueEvent = Event('accountValueEvent')
self.accountSummaryEvent = Event('accountSummaryEvent')
self.pnlEvent = Event('pnlEvent')
self.pnlSingleEvent = Event('pnlSingleEvent')
self.scannerDataEvent = Event('scannerDataEvent')
self.tickNewsEvent = Event('tickNewsEvent')
self.newsBulletinEvent = Event('newsBulletinEvent')
self.errorEvent = Event('errorEvent')
self.timeoutEvent = Event('timeoutEvent')
self.cancelOrderEvent = Event('cancelOrderEvent')
self.openOrderEvent = Event('openOrderEvent')
self.orderStatusEvent = Event('orderStatusEvent')
self.execDetailsEvent = Event('execDetailsEvent')
self.commissionReportEvent = Event('commissionReportEvent')
self.updatePortfolioEvent = Event('updatePortfolioEvent')
self.positionEvent = Event('positionEvent')
self.accountValueEvent = Event('accountValueEvent')
self.accountSummaryEvent = Event('accountSummaryEvent')
self.pnlEvent = Event('pnlEvent')
self.pnlSingleEvent = Event('pnlSingleEvent')
self.scannerDataEvent = Event('scannerDataEvent')
self.tickNewsEvent = Event('tickNewsEvent')
self.newsBulletinEvent = Event('newsBulletinEvent')
self.errorEvent = Event('errorEvent')
self.timeoutEvent = Event('timeoutEvent')
import datetime
import logging
import math
import sys
import signal
import asyncio
import time
from typing import Iterator, AsyncIterator, Callable, Union
import eventkit as ev
globalErrorEvent = ev.Event()
"""
Event to emit global exceptions.
"""
UNSET_INTEGER = 2 ** 31 - 1
UNSET_DOUBLE = sys.float_info.max
def df(objs, labels=None):
"""
Create pandas DataFrame from the sequence of same-type objects.
When a list of labels is given then only retain those labels and
drop the rest.
"""
import pandas as pd
def __init__(self, *args, **kwargs):
Object.__init__(self, *args, **kwargs)
self.statusEvent = Event('statusEvent')
self.modifyEvent = Event('modifyEvent')
self.fillEvent = Event('fillEvent')
self.commissionReportEvent = Event('commissionReportEvent')
self.filledEvent = Event('filledEvent')
self.cancelEvent = Event('cancelEvent')
self.cancelledEvent = Event('cancelledEvent')
def __init__(self, *args, **kwargs):
Object.__init__(self, *args, **kwargs)
self.startingEvent = Event('startingEvent')
self.startedEvent = Event('startedEvent')
self.stoppingEvent = Event('stoppingEvent')
self.stoppedEvent = Event('stoppedEvent')
self.softTimeoutEvent = Event('softTimeoutEvent')
self.hardTimeoutEvent = Event('hardTimeoutEvent')
if not self.controller:
raise ValueError('No controller supplied')
if not self.ib:
raise ValueError('No IB instance supplied')
if self.ib.isConnected():
raise ValueError('IB instance must not be connected')
assert 0 < self.appTimeout < 60
assert self.retryDelay > 0
self._runner = None
self._logger = logging.getLogger('ib_insync.Watchdog')
def _createEvents(self):
self.connectedEvent = Event('connectedEvent')
self.disconnectedEvent = Event('disconnectedEvent')
self.updateEvent = Event('updateEvent')
self.pendingTickersEvent = Event('pendingTickersEvent')
self.barUpdateEvent = Event('barUpdateEvent')
self.newOrderEvent = Event('newOrderEvent')
self.orderModifyEvent = Event('orderModifyEvent')
self.cancelOrderEvent = Event('cancelOrderEvent')
self.openOrderEvent = Event('openOrderEvent')
self.orderStatusEvent = Event('orderStatusEvent')
self.execDetailsEvent = Event('execDetailsEvent')
self.commissionReportEvent = Event('commissionReportEvent')
self.updatePortfolioEvent = Event('updatePortfolioEvent')
self.positionEvent = Event('positionEvent')
self.accountValueEvent = Event('accountValueEvent')
self.accountSummaryEvent = Event('accountSummaryEvent')
self.pnlEvent = Event('pnlEvent')
self.pnlSingleEvent = Event('pnlSingleEvent')
self.scannerDataEvent = Event('scannerDataEvent')
self.tickNewsEvent = Event('tickNewsEvent')
self.newsBulletinEvent = Event('newsBulletinEvent')
self.errorEvent = Event('errorEvent')
self.timeoutEvent = Event('timeoutEvent')
def _createEvents(self):
self.connectedEvent = Event('connectedEvent')
self.disconnectedEvent = Event('disconnectedEvent')
self.updateEvent = Event('updateEvent')
self.pendingTickersEvent = Event('pendingTickersEvent')
self.barUpdateEvent = Event('barUpdateEvent')
self.newOrderEvent = Event('newOrderEvent')
self.orderModifyEvent = Event('orderModifyEvent')
self.cancelOrderEvent = Event('cancelOrderEvent')
self.openOrderEvent = Event('openOrderEvent')
self.orderStatusEvent = Event('orderStatusEvent')
self.execDetailsEvent = Event('execDetailsEvent')
self.commissionReportEvent = Event('commissionReportEvent')
self.updatePortfolioEvent = Event('updatePortfolioEvent')
self.positionEvent = Event('positionEvent')
self.accountValueEvent = Event('accountValueEvent')
self.accountSummaryEvent = Event('accountSummaryEvent')
self.pnlEvent = Event('pnlEvent')
self.pnlSingleEvent = Event('pnlSingleEvent')
self.scannerDataEvent = Event('scannerDataEvent')
self.tickNewsEvent = Event('tickNewsEvent')
self.newsBulletinEvent = Event('newsBulletinEvent')
self.errorEvent = Event('errorEvent')
self.timeoutEvent = Event('timeoutEvent')