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.
|
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.
toggle quoted message
Show quoted text
--- In TWSAPI@..., "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.
|
You're running an older version of ib-csharp.
The latest code is now hosted here:
Download that and give it a try.
Shane
toggle quoted message
Show quoted text
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
|
Should '20130719' be '20130720'? I.e. 19 -> 20 to match the tws market line. (Although IB will expire the option on the 19th. Confusing.) Pete
toggle quoted message
Show quoted text
On 07/14/13, andrewcmeier<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@..., "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.
|
In the file section of this group I wrote a option chain getter I included the source.it in vb and conversion is easy to c# i had very little problems with it it get the chain of any stock ticker gets all the quotes and draws vertical spread graphs
nick
toggle quoted message
Show quoted text
On 7/14/2013 6:23 AM, 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@..., "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
|
I've had a look, it looks great, however, I still can't seem to fix my problem. The way you set up a contract in VB is: contract.conId = Convert.ToInt32(ss(2)) contract.symbol = TextBox1.Text contract.secType = "OPT" contract.expiry = ss(0).Trim.ToString contract.strike = Convert.ToDouble(ss(1)) contract.right = "C" contract.multiplier = "" contract.exchange = "SMART" contract.primaryExchange = "" contract.currency = "USD" contract.localSymbol = "" contract.includeExpired = 0 tickcount += 1 AxTws1.reqMktDataEx(rnumber, contract, "", 1) '0 =streaming 1=snapshot
However, in C# I don't seem to have any of the contract.x and can't even seem to use .reqMktDataEx()
I've tried another method which uses: AAAA = new Contract(22, "AAPL", SecurityType.Option, "201307", 420.0, RightType.Call, "", "SMART", "USD", "", "", SecurityIdType.None, "");
The constructor for this is: public Contract(int contractId, String symbol, SecurityType securityType, String expiry, double strike, RightType right, String multiplier, string exchange, string currency, string localSymbol, string primaryExchange, SecurityIdType secIdType, string secId)
It still says no security definition found. Any idea of what is wrong here?
Thanks again.
toggle quoted message
Show quoted text
--- In TWSAPI@..., Nick <nickhere@...> wrote: In the file section of this group I wrote a option chain getter I included the source.it in vb and conversion is easy to c# i had very little problems with it it get the chain of any stock ticker gets all the quotes and draws vertical spread graphs
nick
On 7/14/2013 6:23 AM, 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@..., "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
|
I've tried both dates, no luck.
toggle quoted message
Show quoted text
--- In TWSAPI@..., Peter Gum <petergum@...> wrote:
Should '20130719' be '20130720'? I.e. 19 -> 20 to match the tws market line. (Although IB will expire the option on the 19th. Confusing.) Pete
On 07/14/13, andrewcmeier<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@..., "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.
|
I've given this a quick try, no luck yet, will try again when I get a chance.
toggle quoted message
Show quoted text
--- 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
|
contractId is IB's own unique identifier for a contract. If you know this id for a specific contract, you can use it in a contract details request and not supply any of the other fields. Setting this to 22 as you have done, and then supplying all the other fields for a contract whose id is almost certainly not 22, is probably the source of your error. So try setting contractId to 0. Richard From: TWSAPI@... [mailto:TWSAPI@...] On Behalf Of andrewcmeier Sent: 15 July 2013 04:47 To: TWSAPI@... Subject: [TWS API] Re: C# Option Contract Details I've had a look, it looks great, however, I still can't seem to fix my problem. The way you set up a contract in VB is: contract.conId = Convert.ToInt32(ss(2)) contract.symbol = TextBox1.Text contract.secType = "OPT" contract.expiry = ss(0).Trim.ToString contract.strike = Convert.ToDouble(ss(1)) contract.right = "C" contract.multiplier = "" contract.exchange = "SMART" contract.primaryExchange = "" contract.currency = "USD" contract.localSymbol = "" contract.includeExpired = 0 tickcount += 1 AxTws1.reqMktDataEx(rnumber, contract, "", 1) '0 =streaming 1=snapshot However, in C# I don't seem to have any of the contract.x and can't even seem to use .reqMktDataEx() I've tried another method which uses: AAAA = new Contract(22, "AAPL", SecurityType.Option, "201307", 420.0, RightType.Call, "", "SMART", "USD", "", "", SecurityIdType.None, ""); The constructor for this is: public Contract(int contractId, String symbol, SecurityType securityType, String expiry, double strike, RightType right, String multiplier, string exchange, string currency, string localSymbol, string primaryExchange, SecurityIdType secIdType, string secId) It still says no security definition found. Any idea of what is wrong here? Thanks again. --- In TWSAPI@... <mailto:TWSAPI%40yahoogroups.com> , Nick <nickhere@...> wrote: In the file section of this group I wrote a option chain getter I included the source.it in vb and conversion is easy to c# i had very little problems with it it get the chain of any stock ticker gets all the quotes and draws vertical spread graphs
nick
On 7/14/2013 6:23 AM, 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@... <mailto:TWSAPI%40yahoogroups.com> ,
"andrewcmeier" <andrewcmeier@> wrote: Hi there, I've started using the Krs.Ats.IBNet software
(. 0.21.Full.zip) 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
|
Excellent, it worked, had to change a couple of other fields but it was definitely the contractID, thank you. The final code I used is:
AAAA = new Contract(0, "AAPL", SecurityType.Option, "20130719", 420.0, RightType.Call, "100", "SMART", "USD", "", "", SecurityIdType.None, "");
Still not sure how to get all options for a stock but will keep trying.
toggle quoted message
Show quoted text
--- In TWSAPI@..., "Richard L King" <rlking@...> wrote: contractId is IB's own unique identifier for a contract. If you know this id for a specific contract, you can use it in a contract details request and not supply any of the other fields.
Setting this to 22 as you have done, and then supplying all the other fields for a contract whose id is almost certainly not 22, is probably the source of your error.
So try setting contractId to 0.
Richard
From: TWSAPI@... [mailto:TWSAPI@...] On Behalf Of andrewcmeier Sent: 15 July 2013 04:47 To: TWSAPI@... Subject: [TWS API] Re: C# Option Contract Details
I've had a look, it looks great, however, I still can't seem to fix my problem. The way you set up a contract in VB is: contract.conId = Convert.ToInt32(ss(2)) contract.symbol = TextBox1.Text contract.secType = "OPT" contract.expiry = ss(0).Trim.ToString contract.strike = Convert.ToDouble(ss(1)) contract.right = "C" contract.multiplier = "" contract.exchange = "SMART" contract.primaryExchange = "" contract.currency = "USD" contract.localSymbol = "" contract.includeExpired = 0 tickcount += 1 AxTws1.reqMktDataEx(rnumber, contract, "", 1) '0 =streaming 1=snapshot
However, in C# I don't seem to have any of the contract.x and can't even seem to use .reqMktDataEx()
I've tried another method which uses: AAAA = new Contract(22, "AAPL", SecurityType.Option, "201307", 420.0, RightType.Call, "", "SMART", "USD", "", "", SecurityIdType.None, "");
The constructor for this is: public Contract(int contractId, String symbol, SecurityType securityType, String expiry, double strike, RightType right, String multiplier, string exchange, string currency, string localSymbol, string primaryExchange, SecurityIdType secIdType, string secId)
It still says no security definition found. Any idea of what is wrong here?
Thanks again.
--- In TWSAPI@... <mailto:TWSAPI%40yahoogroups.com> , Nick <nickhere@> wrote:
In the file section of this group I wrote a option chain getter I included the source.it in vb and conversion is easy to c# i had very little problems with it it get the chain of any stock ticker gets all the quotes and draws vertical spread graphs
nick
On 7/14/2013 6:23 AM, 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@... <mailto:TWSAPI%40yahoogroups.com> ,
"andrewcmeier" <andrewcmeier@> wrote:
Hi there, I've started using the Krs.Ats.IBNet software
(. 0.21.Full.zip) 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
|
I am not sure if anyone has answered your question to your satisfaction yet but I wanted to give you what I have figured out for options.
using request market data you would have something like this in c#
client.RequestMarketData(i, new Option("BAC", "BAC130720C00012000", "", RightType.Undefined, 0), some collection, false, false);
toggle quoted message
Show quoted text
--- In TWSAPI@..., "andrewcmeier" <andrewcmeier@...> wrote: I've tried both dates, no luck.
--- In TWSAPI@..., Peter Gum <petergum@> wrote:
Should '20130719' be '20130720'? I.e. 19 -> 20 to match the tws market line. (Although IB will expire the option on the 19th. Confusing.) Pete
On 07/14/13, andrewcmeier<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@..., "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.
|
You should be able to get all options by calling reqContractDetailsEx(). Just leave strike, right, and possibly expiry blank/zero.
[rwk]
--- "andrewcmeier" <andrewcmeier@...> wrote:
toggle quoted message
Show quoted text
Still not sure how to get all options for a stock but will keep trying.
|
Sorry, I've been away. That looks fine, I'm happy that I've got what I need now to download data, havn't been able to retrieve an option chain but I've come up with a workaround that is quicker. Basically I'm downloading the option details from Yahoo in advance, storing the details in a file, then reading this file to download 100 option prices at a time, works out quicker because I can filter it ahead of time and be downloading 100 options at a time rather than 1 stock at a time. The programming to split the 100 options into their stocks is a bit of a pain though.
Thanks for your input.
toggle quoted message
Show quoted text
--- In TWSAPI@..., "t0ksik" <seventhpoint@...> wrote:
I am not sure if anyone has answered your question to your satisfaction yet but I wanted to give you what I have figured out for options.
using request market data you would have something like this in c#
client.RequestMarketData(i, new Option("BAC", "BAC130720C00012000", "", RightType.Undefined, 0), some collection, false, false);
--- In TWSAPI@..., "andrewcmeier" <andrewcmeier@> wrote:
I've tried both dates, no luck.
--- In TWSAPI@..., Peter Gum <petergum@> wrote:
Should '20130719' be '20130720'? I.e. 19 -> 20 to match the tws market line. (Although IB will expire the option on the 19th. Confusing.) Pete
On 07/14/13, andrewcmeier<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@..., "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.
|
not sure of your problem but getting a full option chain for the underlying was never a problem for my code the biggest problem was getting all the details and it timing out. nick
toggle quoted message
Show quoted text
On 7/18/2013 8:45 PM, andrewcmeier wrote: Sorry, I've been away. That looks fine, I'm happy that I've got what I need now to download data, havn't been able to retrieve an option chain but I've come up with a workaround that is quicker. Basically I'm downloading the option details from Yahoo in advance, storing the details in a file, then reading this file to download 100 option prices at a time, works out quicker because I can filter it ahead of time and be downloading 100 options at a time rather than 1 stock at a time. The programming to split the 100 options into their stocks is a bit of a pain though.
Thanks for your input.
--- In TWSAPI@..., "t0ksik" <seventhpoint@...> wrote:
I am not sure if anyone has answered your question to your satisfaction yet but I wanted to give you what I have figured out for options.
using request market data you would have something like this in c#
client.RequestMarketData(i, new Option("BAC", "BAC130720C00012000", "", RightType.Undefined, 0), some collection, false, false);
--- In TWSAPI@..., "andrewcmeier" <andrewcmeier@> wrote:
I've tried both dates, no luck.
--- In TWSAPI@..., Peter Gum <petergum@> wrote:
Should '20130719' be '20130720'? I.e. 19 -> 20 to match the tws market line. (Although IB will expire the option on the 19th. Confusing.) Pete
On 07/14/13, andrewcmeier<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@..., "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
|