API Support Forum
User Profile

Viewing User Profile for: JSmith5611


About

Aug 11, 2015 02:10 PM

Nov 23, 2020 01:45 PM

Nov 23, 2020 01:45 PM



Post Statistics
JSmith5611 has contributed to 80 posts out of 4944 total posts (1.62%) in 1932 days (0.00 posts per day).

20 most recent posts:

API Support » GF COM API Options Help Nov 23, 2020 @ 01:45 PM (Total replies: 10)

ATM = at the money, so the strike that's closest to the current price of the underlying future.
I don't have a good range percentage for this search howerver.
Jason Smith


API Support » GF COM API Options Help Nov 23, 2020 @ 06:47 AM (Total replies: 10)

I do see one thing you can do.
If you want all options on ESZ20, instead of using basecontract ID, and have to iterate through all the different es option base contracts, use WithParentContractID(), with the ID of ESZ20.

Parent contract could also be called underlying contract.it is the future contract that an exercised option will get a position in.
Jason Smith


API Support » GF COM API Options Help Nov 20, 2020 @ 07:12 AM (Total replies: 10)

btw, for your contract load request what criterion are you using?
And by 'all available expiration dates' do you mean all option series for a givien future contract?
like for ESZ20 getting:

OEW3X20, OE4AX20, OE4CX20, OEW4X20, OEWX20, OE1CZ20, OEW1Z20, OE1AZ20, OE2CZ20, OEW2Z20, OE2AZ20, OE3CZ20, OESZ20, OE3AZ20

Best way to do that would be the same as before, but limit the strike range of the search to near ATM.
Jason Smith


API Support » GF COM API Options Help Nov 18, 2020 @ 12:09 PM (Total replies: 10)

The trick for this is to do multiple contract load requests.

for all of them, use result count 1000.
the first one, use skip count 0.
When the ContractLoadReceived event is triggered for that, do another, with skip count of the number of contracts received (most likely 1000)
When that one's even is triggered, do another, this time with skip count for the total number of contracts received so far.
Continue doing that (ever increasing skip count) until the ContractLoadRecieved event is triggered with zero contracts. At that point, all of them are loaded.

BTW, this is the same procedure you'd use for c#
Jason Smith


API Support » COM sample code not working GF API Oct 28, 2020 @ 02:18 PM (Total replies: 1)

Most of that code is commented out in the excel example. probably was a leftover from coverting from old api to the new one.

Here's a version of that function that does work:

Private Sub LookupRequest(ByVal Name As String)
If Len(Name) > 0 Then

Dim builder As SymbolLookupRequestBuilder
Set builder = New SymbolLookupRequestBuilder

Dim bc As BaseContract
If (Len(Name) > 3) Then
bcName = Mid(Name, 1, Len(Name) - 3)
Set bc = api.contracts.Base.Get_3(bcName)
Else
Set bc = Nothing
End If

If Not (bc Is Nothing) Then
builder.WithBaseSymbol bc.Symbol, TextSearchMode_StartsWith
Else
builder.WithSymbol Name, TextSearchMode_StartsWith
End If

builder.WithResultCount 1
api.contracts.lookup.ByCriteria builder.Build
End If
End Sub


The Mid() call stripping the last 3 characters off is to get, for example, 'ES' from 'ESZ20', as that is the base contract name.
Jason Smith

Edited by JSmith5611 on Oct 28, 2020 02:19 PM

API Support » Contracts.Lookup.BySymbol() - We are having a problem Oct 28, 2020 @ 01:51 PM (Total replies: 1)

hmm..
1) for starters, api.Contracts.Get_2(Name) and api.Contracts.Base.Get_3(Name) are going to return different types (Contract and BaseContract respectively)

2) Before connecting are you setting up the threading model?
3) Why do you sleep instead of listening for the events?
Jason Smith


API Support » New bug in GAIN COM API Oct 28, 2020 @ 11:32 AM (Total replies: 2)

you can think of it like a tree structure.
adding an operator adds a relationship (AND or OR) between the last two things added, and combines them into one thing.
Jason Smith


API Support » New bug in GAIN COM API Oct 28, 2020 @ 11:30 AM (Total replies: 2)

This is not a bug, it is working as intended.

If you want to use
WithContractType() and WithHasOptions(), after you use those two, you need to use WithOperator() to say the relation between them.

You can do some very complex lookups with this.
For example, if you want to find all puts with strikes between 1600 and 1700

expressionBuilder
->WithStrikeMaximum(1700)
->WithStrikeMinimum(1600)
->WithOperator(GF_Api_COM::SymbolLookupExpressionOperator_And)
->WithOptionType(GF_Api_COM::SymbolLookupCriteriaOptionType_Put)
->WithOperator(GF_Api_COM::SymbolLookupExpressionOperator_And)
Jason Smith


FIX Support » FAST Template.xml Oct 21, 2020 @ 12:04 PM (Total replies: 1)

Do you have any more information on what you are doing?
I pulled the fix example from bitbucket and it ran fine (connecting to both fix and fast) .
Jason Smith


API Support » Spreads MKT Orders Not Filling in Demo or API Sep 30, 2020 @ 02:35 PM (Total replies: 3)

There is a bug with out simulated filling engine with market orders for spreads. this will be fixed.
Jason Smith


API Support » Spreads MKT Orders Not Filling in Demo or API Sep 30, 2020 @ 09:45 AM (Total replies: 3)

On API and SIM, we simulate fills, they are not sent to the exchange. I'm going to check to see if we have an issue with market spreads.
Jason Smith


API Support » GFApi Equivalent to OECAPI::RequestContracts Sep 30, 2020 @ 08:50 AM (Total replies: 2)

ContractLoadRequest is what you want to use here.
The max you can request at at time is 1000. If you don't have all the contracts you need after that, you can use SkipCount to skip the number of contracts you've already received.

I.e, if you for a given set of Expressions, the first request would have result count of 1000, skip count of 0, then the next would have a result count of 1000, skip count of 1000, etc.

When the actual # of contracts received would be less than 1000 for a given expression set, you know you're done.
Jason Smith

Edited by JSmith5611 on Sep 30, 2020 08:53 AM

API Support » = api.BaseContracts.FindBySymbol(Name) in OECAPICOM Sep 17, 2020 @ 01:00 PM (Total replies: 4)

GF_Api_COM.GFComClient.Contracts.Lookup.BySymbol() does not return a contract, it returns a contract lookup id.
This actually does send a request looking for a contract that you had never previously seen since logging in. You need to wait for the SymbolLookupReceived event, which will contain the found contracts (and then they will also be available via GFComClient.Contracts.Get methods)
Jason Smith


API Support » COM API: Sep 15, 2020 @ 12:56 PM (Total replies: 2)

We now see that this is a problem, and are working on it.
Jason Smith


API Support » = api.BaseContracts.FindBySymbol(Name) in OECAPICOM Sep 15, 2020 @ 11:42 AM (Total replies: 4)

Also.. if I may ask, why are you using the COM api instead of the .NET nuget package?
Jason Smith


API Support » = api.BaseContracts.FindBySymbol(Name) in OECAPICOM Sep 15, 2020 @ 11:42 AM (Total replies: 4)

GF_Api_COM.GFComClient.Contracts.Get_2(Name) is the equivalent to api.Contracts.Item(Name)
if that succeeds, then there is a BaseSymbol property on the Contract.

If that fails, you will have to do a contract lookup (GF_Api_COM.GFComClient.Contracts.Lookup.BySymbol() for the simplest method)

you can use that string as the input to GF_API_COM.GFComClient.Contracts.Base.Get_3()

If your wondering, the numbers on the Get() functions were chosen by how COM, not really by us.
Jason Smith


API Support » Advanced Example Sep 03, 2020 @ 07:14 AM (Total replies: 4)

I just made sure i had the latest of the advanced example, ran 'git clean -fdx' to remove all temporary files and directories.

Opened the .sln file in Visual studio 2017 and 2019 and did a full rebuild.. worked fine both times.
Jason Smith


API Support » Advanced Example Sep 02, 2020 @ 02:34 PM (Total replies: 4)

We here do our compiling using visual studio... I don't think any of us have tried dotnet run or similar commands.. Nor have we tested under mono (i'm guessing that one since you said you work on *NIX)
Jason Smith


API Support » C++ COM Wrapper Error Message when Closing a Position Jul 17, 2020 @ 11:48 AM (Total replies: 3)

Judging by the call stack, and the fact that the error no longer happens when your AvgPositionChanged handler is commented out.. I think the problem is in that handler.

Something in that function is throwing an exception.
Jason Smith


API Support » C++ COM Wrapper Error Message when Closing a Position Jul 09, 2020 @ 01:14 PM (Total replies: 3)

Just in case, can you comment out everything that your listener for AvgPositionChanged does, and see if the exception still occurs?
Jason Smith