Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EventHandler Example #11

Closed
bondtrade opened this issue Sep 7, 2017 · 8 comments
Closed

EventHandler Example #11

bondtrade opened this issue Sep 7, 2017 · 8 comments

Comments

@bondtrade
Copy link

Hi Abel,

I read though a closed thread where you give some great examples on how to subscribe to data and process it with callbacks.

I was wondering if you would be kind enough to provide a detailed example which extends the previous ones using EventHandler to efficiently subscribe to multiple symbols, assign listeners/callbacks, and process the results please?

Great work.

@softwarespartan
Copy link
Owner

softwarespartan commented Sep 17, 2017 via email

@bondtrade
Copy link
Author

bondtrade commented Sep 17, 2017 via email

@softwarespartan
Copy link
Owner

softwarespartan commented Sep 27, 2017 via email

@bondtrade
Copy link
Author

Hi Abel,

Thanks again. Would a simple example of what you mean be asking too much? You have provided great examples for the non-OO aspects that are easy to follow and implement but I can't find any example on what you're describing that make sense to me - Java and OOP illiterate. Examples for the most compelling method of implementation seem to be missing from the package.

Here's a couple of embarrassing attempts to (barely) demonstrate that I've had a crack and am not just lazily soliciting a bit of free spoon-feeding:

priceSPY = TWS.MarketData.EventListener(); % Works but no subscribe functionality
priceSPY = TWS.MarketData('SPY'); % Does not work
priceSPY = this@TWS.MarketData.EventHandler(); % Does not work

Surely a new class definition doesn't have to be created for each symbol? If it does, then I'm stuffed and it's back to uni for a year or so to learn Java and OOP, unless... examples please...

Cheers,
Paul.

@softwarespartan
Copy link
Owner

softwarespartan commented Oct 18, 2017 via email

@softwarespartan
Copy link
Owner

softwarespartan commented Oct 20, 2017 via email

@bondtrade
Copy link
Author

Thanks so much Abel! Much appreciated. Makes sense now having seen your example. I'll get busy.

Cheers,
Paul.

@softwarespartan
Copy link
Owner

softwarespartan commented Oct 21, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants