GRUL and other Master/Yoda Coders...
Young C++ Jedi here trying to make his way through IB's code galaxy...
I'm working with Jan Boonen's TwsAPICpp code which apparently is still working for some on this forum
https://github.com/JanBoonen/TwsApiCpp
A kind soul suggested I take a look at how test.cpp is implemented for a base case. Here's what I can make out of the code:
MyEWrapper inherits from EWrapperL0 which, according to TwsApilL0.h, in turn extends EWrapper; so the end-user basically needs to create a wrapper that wraps around another wrapper? (or is it my brain that's wrapped around itself?)
I don't quite get the 'boolCalledFromThread = true' syntax:
/*
public:
MyEWrapper( boolCalledFromThread = true ): EWrapperL0( CalledFromThread ) {}
*/
but recognize the constructor format. The rest of the class looks like method declarations.
In "Main", he creates a MyEWrapper class object MW (which is customized to derive from EWrapperL0 in TwsApiL0.h header file) which he then passes by reference to a new memory allocated EC object of type EClientL0. This object looks like its the big daddy (?) EClientL0 (also in the TwsApiL0.h header file) extends EClient (defined in the EClient.h header and looks fairly tight, contains the key eConnect and eDisconnect methods among a gazillion others)
Then he connects to IB via this EC object of type EClientL0 and calls EC->eConnect, with the port number it looks like (7496?), requests some historical data for stock ticker C (Citigroup). Then comes a bunch of if statements that I'm not sure about: are these checking for a lack of connection between the client socket and the IB server socket? Not sure I get the ( 0 = id%50) syntax...
So all in roughly, it looks like I need my own custom wrapper passed to a 'socket connection' object of type EClientL0? And therefore need to study TwsApiL0.h file carefully to know how to implement the wrapper and use it in my main?
If you code expert marksmen can spare a thought or two, would be great to know if I'm on the right path...
Young C++ Jedi here trying to make his way through IB's code galaxy...
I'm working with Jan Boonen's TwsAPICpp code which apparently is still working for some on this forum
https://github.com/JanBoonen/TwsApiCpp
A kind soul suggested I take a look at how test.cpp is implemented for a base case. Here's what I can make out of the code:
MyEWrapper inherits from EWrapperL0 which, according to TwsApilL0.h, in turn extends EWrapper; so the end-user basically needs to create a wrapper that wraps around another wrapper? (or is it my brain that's wrapped around itself?)
I don't quite get the 'boolCalledFromThread = true' syntax:
/*
public:
MyEWrapper( boolCalledFromThread = true ): EWrapperL0( CalledFromThread ) {}
*/
but recognize the constructor format. The rest of the class looks like method declarations.
In "Main", he creates a MyEWrapper class object MW (which is customized to derive from EWrapperL0 in TwsApiL0.h header file) which he then passes by reference to a new memory allocated EC object of type EClientL0. This object looks like its the big daddy (?) EClientL0 (also in the TwsApiL0.h header file) extends EClient (defined in the EClient.h header and looks fairly tight, contains the key eConnect and eDisconnect methods among a gazillion others)
Then he connects to IB via this EC object of type EClientL0 and calls EC->eConnect, with the port number it looks like (7496?), requests some historical data for stock ticker C (Citigroup). Then comes a bunch of if statements that I'm not sure about: are these checking for a lack of connection between the client socket and the IB server socket? Not sure I get the ( 0 = id%50) syntax...
So all in roughly, it looks like I need my own custom wrapper passed to a 'socket connection' object of type EClientL0? And therefore need to study TwsApiL0.h file carefully to know how to implement the wrapper and use it in my main?
If you code expert marksmen can spare a thought or two, would be great to know if I'm on the right path...
Last edited:
