Giter VIP home page Giter VIP logo

twsapicpp's People

Contributors

janboonen avatar quantitative-technologies avatar shevkoplyas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twsapicpp's Issues

compiling library warnings

I get the following warning message when building TwsApi.lib:
1>------ Rebuild All started: Project: TwsApi, Configuration: Release Win32 ------
1>TwsApiL0.cpp
1>d:\twsapicpp\source\posixclient\src\eposixclientsocketplatform.h(14): warning C4005: 'EISCONN': macro redefinition
1>c:\program files (x86)\windows kits\10\include\10.0.17763.0\ucrt\errno.h(98): note: see previous definition of 'EISCONN'
And similar messages for 'EWOULDBLOCK' and 'ECONNREFUSED'.

So I see the 3 #defines in 'eposixclientsocketplatform.h' mimic what's commented out in winsock.h and WinSock2.h which makes me want to ignore them. My main concern is that I was not forewarned of these warnings. Any thoughts?

I also get:
1>d:\twsapicpp\source\posixclient\src\eposixclientsocket.cpp(61): warning C4996: 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
1>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\winsock2.h(1831): note: see declaration of 'inet_addr'

but which doesn't worry me much.

For what it's worth here is my compiler command line:
/GS /analyze- /W3 /Gy /Zc:wchar_t /I"..\Src" /I"..\Api" /I"....\source\PosixClient\Shared" /I"....\source\PosixClient\src" /Zi /Gm- /O2 /Ob2 /Fd".\Release/" /Zc:inline /fp:precise /D "WIN32" /D "_CRT_SECURE_NO_WARNINGS" /D "_VC80_UPGRADE=0x0600" /D "_MBCS" /errorReport:prompt /GF /WX- /Zc:forScope /Gd /Oy- /MT /FC /Fa".\Release/" /EHsc /nologo /Fo".\Release/" /Fp".\Release/TwsApi.pch" /diagnostics:classic

Thanks

Visual Studio Linker Error LNK2019: unresolved external symbol public: static class EClientL0

Environment: MS Windows 7 Pro, Visual Studio 2013. TwsApiCpp version 9.71.
When we open the TwsApi.sln solution there is a "One way upgrade" that produces the following warnings (two examples - there are a total of 12):
..\Test_win32\Test.vcproj: Warning: The project file is being backed up to a relative path that differs from the original solution relative path. The difference in folder hierarchy may create problems in opening or building the backed up solution and project.
..\Test_win32\Test.vcproj: MSB8012: $(TargetPath) ('C:\Jts\TwsApiCpp\TwsApiC++\Test_win32.\Debug\Test.exe') does not match the Librarian's OutputFile property value '.\Debug\Test.exe' ('C:\Jts\TwsApiCpp\TwsApiC++_win32\Debug\Test.exe') in project configuration 'Debug|Win32'. This may cause your project to build incorrectly. To correct this, please make sure that $(TargetPath) property value matches the value specified in %(Lib.OutputFile).

Issue: When building the "Test" project in Visual Studio 2013 (and possibly in other versions of VS), the following error appears on linking:

error LNK2019: unresolved external symbol "public: static class EClientL0 * __cdecl EClientL0::New(class EWrapperL0 *)" (?New@EClientL0@@SAPAV1@PAVEWrapperL0@@@z) referenced in function _main C:\Jts\TwsApiCpp\TwsApiC++\Test_win32\Empty.obj Test

The solution appears to be:

  1. Open up the Test Project Properties and then navigate to Configuration Properties -> Linker -> General. Add the full path the Api folder in the Additional Library Directories. For exmaple: C:\Jts\TwsApiCpp\TwsApiC++\Api
  2. Open up the Test Project Properties and then navigate to Configuration Properties -> Linker -> Input. Add the TwsApi.lib file to the list that appears in Additional Dependencies.

I suspect it is just a matter of references to the Include and lib folders changing during the solution/project update to VS 2013.

Adding newer client and wrapper functions?

A bit of a novice here, but there are some newer wrapper and client functionalities that have been added to the TWS api I wish to use, such as the wrapper callback, tickNews(), or client request reqSecDefOptParams(). Would really appreciate some guidance on how to modify my copy of the library to include these. Working through it right now so if I can get it figured out I will post an update!

Storing received messages

Sorry I'm a rookie coder but was just wondering how one would store the received messages from TWS?

For example, I'm using the Test.cpp and the program is receiving DelayedLast, DelayedBid etc. and I want to store that in a double to check for standard deviations etc.

Any advice on how to deal with the incoming messages? Thanks!

One other question: futures options with this system?

Hi again ..

My project involves automating not only equity spreads but futures options spreads too .. but how to specify expiry and the instrument string?

I'm working on an example with oil futures options and calling reqContractDetails with various contract symbols (/CLX9, /CLZ9) and the expiration specified just as it works for the equities.

I have changed the secType to FOP and the exchange to GLOBEX but I keep getting "no security is found for this request" ... So in summary:

Contract C;
C.symbol = "CL"; // and "CLZ9" and "CLX9" -- same lack of results
C.expiry = "20191115";
C.secType = "FOP";
C.exchange = "GLOBEX";
C.currency = "USD";

Am I missing something? Please advise ... Thanks!

LNK1104

Cannot open file "TwsAPI.lib" in Visual Studio

Trouble getting SPX trades to work; SPX vs SPXW?

I have software written to handle trades in 4 steps:

  • Parse the trade email I get into a standard format file
  • read that file and send a command to get the contractID for every leg
  • save those legs back to another file with contract IDs attached
  • read in the final file and send the trade in for execution

I have this working for most underlyings: SPY, AAPL, IWM, INTC, XRT ... just to name a few. But I can't get SPX weeklies to work. I get the error "200: no such security definition" ... I put the symbol in as SPX and it comes back SPXW for the weeklies, and I tried every combination of these two ... still getting 200 errors.

Anybody got an idea about this? Thanks in advance ...

EClient::checkMessage?

The README.txt's "what makes the use of twsapic worthwhile" section reads:

The IB's implementation of EClient::checkMessage() call halts the programs until data is send to the client. TwsApiC++ overloads this method as a non-blocking call that waits for maximum 1 millisecond and which is safe to call in an endless loop without cpu usage penalty: when no data is received.

Is this still true in the TWS API? I can't find that method in the documentation for EClient.

possible performance tweak (linux)

This is for linux only:
In TwsApiL0.cpp, the select() call (line 463) does not need a timeout when EWrapper is multi-threaded. The timeout (1 usec) will cause unnecessary spinning in the message processing loop. I changed it in my copy and works so far with no timeout, should improve performance (measureably? I don't know). I'm not going to attempt to make any changes on github though, unless someone else can also test it. Or someone can maybe explain why the timeout is needed.

Using TwsApiCpp with a MinGW project

I am looking for a cross platform IB API that I can use with my project (that makes use of MinGW - it is based on the Qt framework).

I have found this project which appears to be a possible candidate. I am however not too clued-up on the entire IB API yet and have some questions regarding the use of this API wrapper.

I assume that in order to use TwsApiCpp, I will have to compile the library using MinGW. Would anything stop me from doing so? I'm unsure about the dependencies for the API. I've noticed that EClientSocketBaseImpl requires StdAfx and that a dummy afxwin.h file has been created in "TwsApiC++/Src". Am I supposed to include the afxwin.h in another file? I ask this because I've noticed the #define CorrectAfxWinIncluded check in TwsApiL0, but have yet to see it included in any other file.

I would really like to use this wrapper for the IB posix API as it seems to make things easier, but I am unsure how exactly to use it in my case. If you could answer my questions, I will appreciate it.

Thanks

Build error and potential fix on Mac OS

The following build error is encountered on MacOS:

TwsApiC++/Src/TwsApiL0.cpp:462:31: error: non-constant-expression cannot be narrowed from type 'long' to '__darwin_suseconds_t' (aka 'int') in initializer list [-Wc++11-narrowing]
                struct timeval timeout = {0,waitfor};   // wait for some milli/micro seconds

This can be fixed by adding a cast in 462:
struct timeval timeout = {0,(int)waitfor}; but I am new to your library and do not know if this would result in incorrect behavior.

TwsApiC++/Api/CmakeLists.txt PUBLIC -std=gnu++0x compile option

Dear Jan,

Thank you for creating a great wrapper library. I compile my application using Cmake with your library in a subdirectory of my project and using add_subdirectory(path/to/TwsApiCpp/TwsApiC++) and linking with the target tws_cpp_api. This works great and makes my project very portable.
However, the problem arises once i attempt to compile certain source files together with my target and linking with tws_cpp_api as the -std=gnu++0x compile option is applied to all source files due to the PUBLIC scope keyword in Api/CmakeLists.txt
If I change the PUBLIC to PRIVATE my project compiles and runs, and only the tws_cpp_api target is compiled with the -std=gnu++0x option. I don't know wether there are any broader harms to doing it this way.

Sincerely
Harald

No support for multileg option spreads?

Hi ...
I am working on a project where I need to support option spreads (strangles, Iron Condors, double Calendars and so forth.)

The TWS API documents and code show support for this, but I can't get it to work.

I was impressed by your approach, but I don't see support for these multileg spreads in your code either ...

Please correct me if I'm wrong! Thanks much.

TagValueListSPtr

Can you explain how you would use the TagValueListSPtr to establish algoParams?

For instance with an Order o

o.algoStrategy = "Adaptive";
// how would you set the adaptivePriority to patient?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.