softwarespartan / IB4m

Interactive Brokers API for Matlab
GNU General Public License v2.0
62 stars 21 forks source link

reqSecDefOptParam #108

Closed Despair2000 closed 3 years ago

Despair2000 commented 3 years ago

I'd like to use reqSecDefOptParam to download whole option chains. Using the contract details to do so is painfully slow and also not recommended according to the API documentation. @softwarespartan do I understand right that the event has to be exposed first to use this method?

softwarespartan commented 3 years ago

yes, that's correct. Needs to be exposed.

https://interactivebrokers.github.io/tws-api/options.html

public void securityDefinitionOptionParameter(
    int reqId, 
    string exchange, 
    int underlyingConId, 
    string tradingClass, 
    string multiplier, 
    HashSet<string> expirations, 
    HashSet<double> strikes
)

I'll try to get it wired up this week sometime.

softwarespartan commented 3 years ago

Update pushed for reqSecDefOptParam. Let me know if find any bugs. Will start on whatif next

Despair2000 commented 3 years ago

@softwarespartan Is the events.m correct? You didn't add any event.

softwarespartan commented 3 years ago

Yes, that’s correct.

I should have mentioned that.

I configured the option parameters to come in via the contract details event. Just trying to be sensible about how many different event type there are. Since this call is really just to speed up what would normally be a contract details call any way.

This can be easily changed. if prefer separate event type that’s no problem.

On Oct 30, 2020, at 4:22 AM, Despair2000 notifications@github.com wrote:

 @softwarespartan Is the events.m correct? You didn't add any event.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Despair2000 commented 3 years ago

OK, great. Sounds reasonable. I will test the new function this weekend and let you know if anything looks strange.

Despair2000 commented 3 years ago

I tested the function and it works as advertised after correcting a little typo you had in the processnotification.m. The class(event) should be 'com.tws.Handler$OptionParameterEvent' and not 'com.tws.OptionParameter'. You maybe want to correct this. Otherwise thanks for exposing this function, this will be very useful!

Have a great weekend!

Despair2000 commented 3 years ago

I close also this issue since it is done. @softwarespartan Just make sure you correct the typo I mentioned above before somebody else finds it :-P