Questions tagged [tws]

Trader Work-Station (TWS) API from Interactive Brokers

183 questions
0
votes
1 answer

How to run Interactive broker TWS linux version 10.12.2j from command line supplied by username and password?

I need to run Interactive Broker Workstation and Gateway TWS software (version 10.12.2j) from linux command line, supplied by username and password. Does anyone know how to do it? There are few autorunner scripts that worked well with previous…
blackbeard
  • 385
  • 2
  • 12
0
votes
1 answer

How to scan the stock market for HALT in ibapi

this is code that i found in the internet for scanning and i do not understand how can i add the option to find stock in halt in this moment https://interactivebrokers.github.io/tws-api/tick_types.html#halted from ibapi.client import EClient from…
0
votes
0 answers

How can I get the current price using IB API

I have this code, and I need to store in a variable the last price, how can i do? class IBapi(EWrapper, EClient): def __init__(self): EClient.__init__(self, self) def tickPrice(self, reqId, tickType, price, attrib): if…
Trees Jin
  • 13
  • 3
0
votes
1 answer

Child orders (target and stop loss) in bracket order does not get sent to IB TWS using python code

I have the code below - python code using ib_insync to connect and place a bracket order for a ticker. However, only the first order, the parent order, gets submitted. The child orders (target and stop loss) don't get submitted. I am a bit stumped…
danjuma
  • 51
  • 5
0
votes
1 answer

Interactive Brokers Python API: contractDetails request prints nicely, but won't return

Beginner. Spent a LONG time on this before giving up. Thank you for taking my question. Writing a program to take input of one or more stock tickers (e.g. GE, EQNR, CCJ) and give information back. First step is, for the list of stocks entered, to…
0
votes
4 answers

Using the same variable in multiple functions in a class-TWS

I created a variable conID in one function and I want to use it in another. Both functions are inside a class. The problem is that in the second function the first function is called, so self.reqSecDefOptParams calls the first function. And after…
0
votes
1 answer

Python Interactive Brokers TWS Net Liquidity

I'm trying to get my account net liquidity to store it in a variable but whenever I'm trying to get it like this: self.reqAccountSummary(9003, "All", "$LEDGER:EUR") I'm getting none. Anyone know how to get the net liquidity? Thank you.
kickass213
  • 51
  • 1
  • 2
  • 7
0
votes
0 answers

Using Python In IB TWS I am trying to get real time data saved to a file, but the file is empty, but the data can be seen in the console

I am using the latest version of IB's TWS API and I want to write real-time data(not historical) to a file as it becomes available. My problem is that although I get no error messages, the file is always empty after multiple times the data has…
quinn
  • 177
  • 1
  • 2
  • 13
0
votes
1 answer

Cant load real-time data from tws

I can't get real-time tick with API for GBP.CHF@IDEALPRO/ My log: 0:53:36:282 <- 9-8-1073741829-0-GBP-CASH--0-----CHF---0--- 10:53:36:282 <- 1-11-1073741830-0-GBP-CASH--0-----CHF---0-233,236,258-0-0-- 10:53:36:282 -> ---R4-2-1073741830-321-Error…
mak_27
  • 9
  • 3
0
votes
0 answers

Combo Orders Rejected - Invalid value in field # 6079

Hi I'm trying to place combo orders with IB Native API but it keeps being rejected with a popup: The error message is "Rejected - Invalid value in field # 6079". I don't know which field is #6079. My code looks like this (the conid's were…
0
votes
1 answer

AttributeError: 'TradingApp' object has no attribute 'nextValidOrderId'

Keep seeing this error message Hi guys, I tried to run this code for IBKR API. I literally just copy/pasted what I learned in the udemy course but still getting this message. Some additional info below: I did it twice in two of my computers, but…
Ryan C
  • 15
  • 4
0
votes
1 answer

There is no current event loop in thread 'Thread-1'

I'm very new to python and I'm trying to implement an API for requesting some data from Interactive Brokers Trader Workstation. I'm using Flask and ib_insync. Here is my code: import configparser import json import logging.config from flask import…
I.R.
  • 442
  • 1
  • 7
  • 16
0
votes
1 answer

Interactive Brokers TWS, Python API

I have a question. See my question in upper case below in the middle of my program. Somehow the two lists are empty. The function position in the class TestApp seems not be called. Any help is appreciated. I am stuck here and could not find a…
0
votes
0 answers

Python TWS Interactive Broker Attribute error

when i run this code i get attribute error but can't get result from API POSITIONS IN MY ACCOUNT ARE NOT PRINTED OUT. ALSO THE CODE (print("Position", contract.symbol, position, avgCost) IN THE DEF POSITION) IS NOT EXECUTED I am getting attribute…
0
votes
0 answers

Need help on opening Interactive Trader Workstation

When I try to open Trader Workstation on Mac OS, there is a startup error. How do I resolve this? What does this error message mean? The error message: java.lang.IllegalArgumentException: Input byte[] should at least have 2 bytes for base64…