API Support Forum
User Profile

Viewing User Profile for: ETrifonov


About

Feb 09, 2015 09:52 AM

Feb 06, 2022 09:55 PM

Feb 06, 2022 10:00 PM



Post Statistics
ETrifonov has contributed to 63 posts out of 5432 total posts (1.16%) in 2785 days (0.00 posts per day).

20 most recent posts:

API Support » VBA Sample COM Book Feb 06, 2022 @ 09:55 PM (Total replies: 3)

Hello Anthony.

1) You can simply not use GFApiEventHandler - it is not mandatory there.
2) It's in System.Threading namespace.

Below is some snippet you can try.
Also, you can check our COM API samples here: https://bitbucket.org/GainFuturesDev/comapisamples

Private _client As IGFClient
Private _cts As System.Threading.CancellationTokenSource
Private _connectionContext As ConnectionContext

Public Sub Register(ByVal client As IGFClient)
_client = client
AddHandler _client.Connection.Aggregate.LoginCompleted, Sub(gfClient, args) EndReconnect()

AddHandler _client.Connection.Aggregate.LoginFailed, Sub(gfClient, args)
If args.FailReason GF.Api.Values.Users.FailReason.ConnectionError OrElse _cts?.IsCancellationRequested False Then
EndReconnect()
Else
Reconnect()
End If
End Sub

AddHandler _client.Connection.Aggregate.Disconnected, Sub(gfClient, args)
If args.Reason DisconnectionReason.SocketError OrElse _cts?.IsCancellationRequested = False Then
Return
End If

_cts = New System.Threading.CancellationTokenSource()
Reconnect()
End Sub
End Sub

Public Sub Connect(ByVal context As ConnectionContext)
_connectionContext = context
_client.Connection.Aggregate.Connect(context)
End Sub

Private Sub Reconnect()
If _client.Connection.Aggregate.IsClosed Then
_client.Threading.BeginDelayedInvoke(TimeSpan.FromSeconds(1), Sub() _client.Connection.Aggregate.Connect(_connectionContext), _cts.Token)
End If
End Sub

Private Sub EndReconnect()
_cts?.Cancel()

If _client.Connection.Aggregate.IsConnecting Then
_client.Connection.Aggregate.Disconnect()
End If
End Sub
Evgeny

Edited by ETrifonov on Feb 06, 2022 10:00 PM

API Support » Private Sub Connection_Disconnected DisconnectionReason_SocketError = 0 Feb 02, 2022 @ 08:12 PM (Total replies: 1)

Hello Anthony,

Same as for your previous request - GF API doesn;t provide auto reconnect feature out of the box.
Please see reconnect same here: https://gainfutures.com/GFAPI/?topic=html/da57e5d9-0be9-4b5c-a8c8-5e39e11b5c98.htm
Evgeny


API Support » VBA Sample COM Book Feb 02, 2022 @ 08:10 PM (Total replies: 3)

Hello Anthony,

GF API doesn't provide auto reconnect feature out of the box and should be implemented on client side.
Please see documentation sample here: https://gainfutures.com/GFAPI/?topic=html/da57e5d9-0be9-4b5c-a8c8-5e39e11b5c98.htm
Evgeny


Market Data » Pulling in Silver Weekly Options Mar 01, 2021 @ 03:27 PM (Total replies: 9)

Silver Weekly Options should be available now.
Please check.
Base sysmbols are OSO1, OSO2, OSO3, OSO4, OSO5
Thanks
Evgeny


Market Data » Pulling in Silver Weekly Options Feb 28, 2021 @ 10:30 PM (Total replies: 9)

Sorry, looks like I'm a bit misundertood you.
For Weekly options, base symbol will be OSO2.
And for some reason we don't have any weekly options for it in the system.
We will look at this issue and let you know.
Evgeny


Market Data » Pulling in Silver Weekly Options Feb 25, 2021 @ 01:28 AM (Total replies: 9)

Hello,

I did check, your account doesn't have restrictions so you should be able to get data.
Did you check our GF COM API sample code, using links I provided for you?
Can you please first make sure you can lookup "OSI" options at all.
Evgeny


Market Data » Pulling in Silver Weekly Options Feb 23, 2021 @ 06:27 PM (Total replies: 9)

Please provide user name/account you use.
If possible, your code.

Yes, "OSI" is a correct symbol.
Evgeny


API Support » COM API version disparity Feb 18, 2021 @ 11:20 PM (Total replies: 3)

Hello,

Thank you for reported that.
We will fix that in next release.

Thank you.
Evgeny


Market Data » Pulling in Silver Weekly Options Feb 18, 2021 @ 11:15 PM (Total replies: 9)

Hello.

What version of COM API do you use?
Looks like it is outdated 3.5 OEC COM API.
Please consider to move to GF COM API.
Also check documentation page for COM API and samples downloads links: https://gainfutures.com/gainfuturesapi/documentation/

Thank you.
Evgeny


API Support » No results when searching for GGCH Jan 26, 2021 @ 03:14 AM (Total replies: 9)

Hi,

I did not check all your requestsm but looks like yesterday you requested just one result for GGC.
So, it is expected to get only one contract back.
I did double check and see no issue with platform, so please check your code.

Thank you.
Evgeny


API Support » No results when searching for GGCH Jan 26, 2021 @ 03:04 AM (Total replies: 9)

Just checked logs.
You are sending requests for different text - 'GCCH' instead of 'GGCH'.

Evgeny


API Support » No results when searching for GGCH Jan 26, 2021 @ 02:40 AM (Total replies: 9)

But what about API, does your code working there right now?
As I said, I see no issues on platform with GGCH contracts and my account is able to fetch that contracts.
So, please check your code with API environment.
Evgeny


API Support » No results when searching for GGCH Jan 26, 2021 @ 01:50 AM (Total replies: 9)

Hello TLau,

Your code should work.

I've double checked, there are no issues with GGCH contracts on DEMO environment:

Client.Contracts.Lookup.SymbolLookupReceived += OnSymbolLookupReceived;

var ggchRequest = new SymbolLookupRequestBuilder()
.WithResultCount(1)
.WithSymbol(TextSearch.CreateStartsWith("GGCH"))
.Build();

Client.Contracts.Lookup.ByCriteria(ggchRequest);

private void OnSymbolLookupReceived(IGFClient client, Api.Contracts.Lookup.SymbolLookupEventArgs e)
{
UpdateContracts(e.Contracts);
}


Can you please provide your DEMO user and account?
Did your code working fine on API environment?

Thank you.
Evgeny


API Support » basic connection error Jan 17, 2021 @ 10:56 PM (Total replies: 1)

Hello Dave,

Yes, api.gainfutures.com port 9210 is a correct address.
There are few error handlers in basic example code:

Client.Logging.ErrorOccurred += OnError;
Connection.LoginFailed += OnLoginFailed;
Connection.Disconnected += OnDisconnected;

You can try to get additional information from that handlers.
But, looks like application cannot reach our servers and I'm not sure why at that point.
Are you able to browse https://api.gainfutures.api site?
Also, it is depend on what day you are trying to connect.
Usually we have maintenace period on weekends.
Evgeny


API Support » No errors reported on risk violation Jul 27, 2020 @ 01:54 PM (Total replies: 5)

Hi Xingyu,

Please use ITradersApi.TraderError event to receive risk violation errors.
https://gainfutures.com/GFAPI/?topic=html/E_GF_Api_Traders_ITradersApi_TraderError.htm
Client.Traders.OnTraderError += this.ErrorOccured

Thank you.
Evgeny


API Support » No errors reported on risk violation Jul 20, 2020 @ 08:03 AM (Total replies: 5)

That handler is moved to GFClient.Logging.ErrorOccurred.
Evgeny


API Support » No errors reported on risk violation Jul 17, 2020 @ 02:38 PM (Total replies: 5)

Hello Xingyu,

If you placing an order which exceed buying power, it will be rejected and will should receive order update.
Not sure why you expecting reject message via GF.Api.Messaging.Notifications.
Please GF API Notification documentation https://gainfutures.com/GFAPI/
https://gainfutures.com/GFAPI/?topic=html/d75ea6d3-3433-401e-a3ac-42681240e1e9.htm

Thank you.
Evgeny


API Support » Getting Error if application has no internet access Jul 01, 2020 @ 12:11 PM (Total replies: 2)

Hello,

From just stack trace it is unclear what cause that.
Can you please provide more details, like connect/disconnect code.
Are you calling connect method on a GF API thread?

Thank you.
Evgeny


API Support » Issue with @6C and similar symbols Jun 30, 2020 @ 09:30 AM (Total replies: 6)

Hello,

You should update GF API.
Can you please tell us GF API version you are using?
Evgeny


API Support » Ticks, DOM messages stop when a historical tick request is made Jun 25, 2020 @ 01:09 PM (Total replies: 1)

Hello Peter,

I don't see issues you are described.
Having 5 DOM subscriptions I see no delays on historical tick data is returned.

What the duration time frame you are requesting?
What API version and user name you are using?
Maybe you can provide more information about your code?

Thank you.
Evgeny