Beispiel #1
0
 TWSConnection()
 {
     _client = new EClientSocket(this);
     _mktDataPrices = new Dictionary<string, TimeSeries>();
     _mktDataVolumes = new Dictionary<string, TimeSeries>();
     _tickers = new List<string>();
 }
        public IBConnectionTestForm()
        {
            InitializeComponent();

            orderDlg = new ContractOrderDlg();
            //contractStk = new Contract("SPY", SecurityType.Stock, "SMART");
            // new Contract("ES", SecurityType.Future, "GLOBEX","USD", "201306");
            //contractCrncy = new Contract("EUR", SecurityType.Cash, "IDEALPRO");

            ibClient = new EClientSocket(this);
        }
Beispiel #3
0
        public IBClient(string host, int port, int clientId = 0)
        {
            Host = host;
            Port = port;
            ClientId = clientId;

            _marketDataRequests = new List<Tick>();
            _marketDepthRequests = new List<string>();
            _historicalBarRequests = new List<BarRequest>();
            _symbolToPosition = new Dictionary<string, Position>();
            _iborderIdToOrderInfo = new Dictionary<int, OrderInfo>();
            _duplicateIBIdToDeferredTrade = new List<KeyValuePair<int, Trade>>();

            _nextValidIBID = 1;
            _ibSocket = new EClientSocket(this);
        }
Beispiel #4
0
        Dictionary<int, PairPos> pairPosDict; // key, stkID, recording all positions in pair.

        #endregion Fields

        #region Constructors

        private EWrapperImpl()
        {
            //this.MAX_QUOTE_LIST = maxQuote;
            this.clientSocket = new EClientSocket(this);
            this.equityDict = new Dictionary<int, Equities>();
            this.PairPosDict = new Dictionary<int, PairPos>();
            try
            {
                File.Copy("mylogger.txt", "backup_logger.txt", true);
            }
            catch (Exception)
            {
                Console.WriteLine("Skip backing up and created a new logger file");
            }
            MyLogger.Instance.Open("mylogger.txt", false);   // create/open logger file

            this.readSymbols(SYMBOL_FILE_DIR);
        }
Beispiel #5
0
        //String etfDir, String stkDir
        public EWrapperImpl(string symbolFileDir, string quoteFolderDir, int maxQuote)
        {
            //this.MAX_QUOTE_LIST = maxQuote;
            this.SYMBOL_FILE_DIR = symbolFileDir;
            this.QUOTE_FOLDER_DIR = quoteFolderDir;

            this.clientSocket = new EClientSocket(this);
            this.tickerSymbolDict = new Dictionary<int, string>();
            this.etfSymbolLst = new List<string>();

            // quote dict has been moved
            //this.quoteDict = new Dictionary<int, List<QuoteTick>>();

            this.PairPosDict = new Dictionary<int, PairPos>();

            MyLogger.Instance.Open("mylogger.txt", true);   // create/open logger file

            this.CSVReader(SYMBOL_FILE_DIR);
            this.CreatePairObjs();
        }
Beispiel #6
0
 public BrokerWrapperIb()
 {
     clientSocket = new EClientSocket(this, Signal);
 }
Beispiel #7
0
 public EReader(EClientSocket clientSocket, EReaderSignal signal)
 {
     eClientSocket      = clientSocket;
     eReaderSignal      = signal;
     processMsgsDecoder = new EDecoder(eClientSocket.ServerVersion, eClientSocket.Wrapper, eClientSocket);
 }
 public EWrapperImpl(MessageHandler messageHandler)
 {
     clientSocket = new EClientSocket(this);
     MessageHandler.messageBox = messageHandler.messageBox;
     IsConnected = false;
 }
 public EWrapperImpl()
 {
     clientSocket = new EClientSocket(this);
 }
Beispiel #10
0
 public EReader(EClientSocket parent, BinaryReader reader)
 {
     this.parent    = parent;
     this.tcpReader = reader;
 }
Beispiel #11
0
 public EReader(EClientSocket parent, BinaryReader reader)
 {
     this.parent = parent;
     this.tcpReader = reader;
 }
Beispiel #12
0
 public IBClient(IBSampleApp parent)
 {
     parentUI = parent;
     clientSocket = new EClientSocket(this);
 }
 public EWrapperImplementation()
 {
     EClientSocket = new EClientSocket(this);
 }
Beispiel #14
0
 public EReader(EClientSocket clientSocket, EReaderSignal signal)
 {
     eClientSocket = clientSocket;
     eReaderSignal = signal;
     processMsgsDecoder = new EDecoder(eClientSocket.ServerVersion, eClientSocket.Wrapper, eClientSocket);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="InteractiveBrokersClient"/> class
 /// </summary>
 public InteractiveBrokersClient()
 {
     ClientSocket = new EClientSocket(this, new EReaderMonitorSignal());
 }
Beispiel #16
0
        //! [socket_declare]

        //! [socket_init]
        public EWrapperImpl()
        {
            Signal       = new EReaderMonitorSignal();
            clientSocket = new EClientSocket(this, Signal);
        }