API Support Forum
User Profile

Viewing User Profile for: MErshov1302


About

Aug 05, 2021 09:08 AM

Dec 31, 2021 03:59 PM

Jan 01, 2022 01:43 AM



Post Statistics
MErshov1302 has contributed to 4 posts out of 5677 total posts (0.07%) in 1205 days (0.00 posts per day).

20 most recent posts:

API Support » Option-Chain? Dec 31, 2021 @ 03:59 PM (Total replies: 5)

It seems I should subscribe to price changes of underlying future

Client.Subscriptions.Price.Subscribe(cbSymbol.SelectedContract.ID);

And then I will receive GreeksChanged often because future price often changes.

Or I can subscribe to price changes of the option itself
Client.Subscriptions.Price.Subscribe(cbSymbol.SelectedContract.ID);
but the price usually changes rare, so I will receive updates...sometime.

API Support » Option-Chain? Dec 31, 2021 @ 03:43 PM (Total replies: 5)

I'm sorry, I wanted to post my question into another topic
https://apisupport.gainfutures.com/Topic/Index/1357


API Support » Option-Chain? Dec 31, 2021 @ 03:41 PM (Total replies: 5)

The problem is that

private void OnGreeksChanges(IGFClient client, GreeksChangedEventArgs e)
{
Console.WriteLine("OnGreeksChanges");
}


never called.

And volatility event handlers supplying some strange values, that doesn't look like
an option's Implied Volatility

API Support » Option-Chain? Dec 31, 2021 @ 03:38 PM (Total replies: 5)

Hello, I tried something similar (subscribe for greeks of the option) on the demo API account

so I set
Client.Options.VolatilitySource = Api.Options.OptionVolatilitySource.Client;

then subscribed on greeks (slightly modifying GF Advanced Example)

protected override void PrepareControlEventHandlers()
{
base.PrepareControlEventHandlers();
Client.Subscriptions.Histogram.HistogramReceived += OnHistogramReceived;
Client.Subscriptions.Greeks.GreeksChanged += OnGreeksChanges;
Client.Contracts.Volatility.ContractVolatilityChanged += OnContractVolatilityChanged;
Client.Contracts.Volatility.VolatilitySubscriptionChanged += OnVolatilitySubscriptionChanged;

Client.Options.VolatilitySource = Api.Options.OptionVolatilitySource.Client;

}


...

public void ChartSelectedContractChangedEventHandler(IContract contract)
{
//clears last subscription
histogramChart.ClearHistogram();
dgHistogram.DataSource = null;

_currentSubscription?.Unsubscribe();
_currentSubscription = null;

if (contract == null)
return;

_currentContract = contract;

Client.Subscriptions.Histogram.Subscribe(contract.ID);
if (contract.IsOption) {
Client.Subscriptions.Greeks.Subscribe(contract.ID);
}

}


Please help me to figure out, is its limitation of the demo account
or should do something additional to receive greeks?

Also, may I ask whether if "GF.Api.Contracts.Volatility"
related to options?
Or it's not a something-related option Implied Volatility (IV)?