API Support Forum
OEC API > API Support > Receiving Option Greeks via .NET GFAPI
Author Topic: Receiving Option Greeks via .NET GFAPI
(3 messages, Page 1 of 1)
Moderators: VPfau
AKisiev3297
Posts: 3
Joined: May 05, 2020


Posted: Sep 15, 2020 @ 02:59 AM             Msg. 1 of 3
Hello!

I have problems receiving option contract greeks via .NET GFAPI.

I do receive updates (i.e.: GreeksChanged event), but with every update I receive zeros for all the greeks.

I use latest stable GFAPI version 4.0.3.44 from Nuget.

Code I use:

// create client
var gfClient = GF.Api.Impl.GFApi.CreateClient();
var runner = new GF.Api.Threading.GFClientRunner(gfClient);
runner.Start();

var connectionContext = new GF.Api.Connection.ConnectionContextBuilder()
.WithUserName(xxxxxx)
.WithPassword(xxxxxxx)
.WithUUID(xxxxx)
.WithHost("prod.gainfutures.com")
.WithPort(9210)
.WithForceLogin(true)
.Build();

gfClient.Connection.Aggregate.Connect(connectionContext);

// subscribe to event
client.Subscriptions.Greeks.GreeksChanged += (gfClient, args) =>
{
Console.WriteLine($"GREEKS | TP={args.Contract.Greeks.TheoreticalPrice}, D={args.Contract.Greeks.Delta}, G={args.Contract.Greeks.Gamma},V={args.Contract.Greeks.Vega} @ {DateTime.Now}");
};

// subscribe greeks
var greeksSubscription = client.Subscriptions.Greeks.Subscribe(contract.ID);
RBduov
Posts: 6
Joined:


Posted: Sep 17, 2020 @ 04:10 AM             Msg. 2 of 3
Hello.
Our specialist investigates the problem and will give you an answer soon.
RBduov
Posts: 6
Joined:


Posted: Sep 22, 2020 @ 11:38 PM             Msg. 3 of 3
Hello.
On September 15, we observed temporary difficulty with one of our services that process requests for the Options. Now everything is working fine. Please try to request the Greeks again and let us know if you are still having trouble getting the data.
Thank you.