开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: C# Option Contract Details


andrewcmeier
 

I've given this a quick try, no luck yet, will try again when I get a chance.

--- In TWSAPI@..., Shane Castle <shane.castle@...> wrote:

You're running an older version of ib-csharp.

The latest code is now hosted here:

Download that and give it a try.

Shane

On Sunday, July 14, 2013, andrewcmeier wrote:

Oops, Tester and A1 were meant to be the same variable in the options
lines, change Tester to A1 and that is what I have.

--- In TWSAPI@... <javascript:;>, "andrewcmeier"
<andrewcmeier@> wrote:

Hi there,
I've started using the Krs.Ats.IBNet software (
)
to develop TWS software in C#.

Setting up equities is easy enough:
Equity Google = new Equity("GOOG");
client.RequestMarketData(14, Google, null, true, false);

But when I try to adapt it to options, I can't get it to work. This is
what I'm using:
Option A1 = new Option("AA", "AA", "20130719", RightType.Call, 8.0m);
client.RequestMarketData(15, Tester, null, false, false);

This is what it has in its class):
public Option(string equitySymbol, string optionSymbol, string expiry,
RightType right, decimal strike)

This is the error I get when I raise e.ErrorCode:
"No security definition has been found for the request"

Does anyone know what I'm entering wrong, or just how to set up an
option in C#? I also then wan't to be able to leave fields out to do
things such as return all the contracts in a month, does anyone have any
examples how to do this?

I'm finding that C# should be a good way to download and analyse data
but don't have any documentation, I've only worked out what to do from
searching through lots of the code.

Thanks for your help.



------------------------------------

Yahoo! Groups Links





Join [email protected] to automatically receive all group messages.