API Support Forum
User Profile

Viewing User Profile for: RWare2020


About

Feb 11, 2020 03:38 PM

Aug 23, 2024 05:34 PM

Aug 23, 2024 05:34 PM



Post Statistics
RWare2020 has contributed to 206 posts out of 5677 total posts (3.63%) in 1744 days (0.00 posts per day).

20 most recent posts:

API Support » COM Memory Exceptions Aug 23, 2024 @ 05:34 PM (Total replies: 0)

I have been having some issues regarding some memory errors in the COM api and I am trying to narrow it down. As of right now, I have only been able to duplicate this in sim and not prod. This seems to have started roughly 2 - 3 weeks ago. We initially tested this on a Nasdaq Mini minute or range chart and the data feed just stops coming in if we let it just sit there. When doing some memory diagnostics, and some walkthroughs in my code here are some issues I'm having.

1.
When taking a crash dump and analyzing it while it is unresponsive, I analyze it with VS2022 and I am getting event handler leaks with many of them coming from here: GF.ProtoSharp.Serialization.Context.TagFieldReaders+c__DisplayClass6_0 4.77 KB 0x08F1662C

2.
When detaching the client using this code:
IDispEventSimpleImpl_IServerConnectionApiEvents::DispEventUnadvise(server->Connection->Aggregate);
IDispEventSimpleImpl_ISessionsApiEvents::DispEventUnadvise(server->Connection->Sessions);

I'm getting these errors:
Exception thrown at 0x767FA942 in Program.exe: Microsoft C++ exception: HRException at memory location 0x0093DDC8.
Exception thrown at 0x767FA942 in Program.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
Exception thrown at 0x767FA942 in Program.exe: Microsoft C++ exception: HRException at memory location 0x0093DDC8.
Exception thrown at 0x767FA942 in Program.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.

3.
I am also getting an error when disconnecting from the API that I don't remember getting typically:
Exception thrown at 0x767FA942 (KernelBase.dll) in Program.exe: 0x80010012: The callee (server [not server application]) is not available and disappeared; all connections are invalid. The call did not execute.

4.
I am also getting this error that I don't recall getting before:
WinRT originate error - 0x800401FB : 'Detected premature stub rundown for call on IID:{00000131-0000-0000-C000-000000000046}, method:4, IPID:{0000A809-55D0-7834-DAEB-3110DB238BF3}, type of rundown:1!'.
It seems to immediately after getting this error, I'm disconnected from the API.

API Support » GF API COM ICE US Dollar Daily History Returning Saturday Bar Aug 09, 2023 @ 03:07 PM (Total replies: 1)

I have had two customers report they are seeing what appears to be a duplicate bar due to getting a Saturday bar with the same OHL but slightly different closes.

We have just seen this issue starting Monday where we are getting a Saturday bar for some reason.

It is only with the US Dollar and no other symbols.

This is how we are requesting the data for all symbols:

IDurationPtr duration = client->Subscriptions->Bars->Duration->Create_2(fromDate, toDate, GF_Api_COM::Continuity::Continuity_OneTime);
IBarDescriptionPtr description = client->Subscriptions->Bars->Description->CreateDays(1);
ISubscriptionPtr sub = client->Subscriptions->Bars->Subscribe(con->id, duration, description);

Here is a chunk of data from July 1st to today that we are receiving:
Date Open High Low Close Volume OI Settlement
8/9/2023 102.350 102.405 102.120 102.325 7,996 0 102.310
8/8/2023 101.895 102.630 101.885 102.360 11,533 0 102.340
8/7/2023 101.840 102.190 101.770 101.890 8,205 28666 101.890
8/5/2023 102.290 102.450 101.550 101.845 19,085 0 101.835
8/4/2023 102.290 102.450 101.550 101.835 8,180 28685 101.835
8/3/2023 102.415 102.655 102.175 102.350 18,985 29433 102.350
8/2/2023 101.815 102.580 101.785 102.390 15,138 30679 102.390
8/1/2023 101.660 102.225 101.620 102.085 12,795 30910 102.085
7/31/2023 101.460 101.665 101.295 101.640 12,518 30784 101.640
7/29/2023 101.480 101.825 101.095 101.450 19,687 0 101.400
7/28/2023 101.480 101.825 101.095 101.400 12,464 30958 101.400
7/27/2023 100.845 101.615 100.320 101.545 19,385 31088 101.545
7/26/2023 101.055 101.190 100.595 100.635 24,611 33701 100.635
7/25/2023 101.150 101.395 100.930 101.095 18,449 34030 101.095
7/24/2023 100.715 101.160 100.625 101.120 14,304 34682 101.120
7/22/2023 100.505 100.925 100.450 100.810 14,078 0 100.800
7/21/2023 100.505 100.925 100.450 100.800 14,265 36048 100.800
7/20/2023 99.965 100.685 99.745 100.595 13,828 39015 100.595
7/19/2023 99.650 100.245 99.605 99.990 15,091 39467 99.990
7/18/2023 99.595 99.790 99.220 99.625 13,466 40558 99.625
7/17/2023 99.665 99.865 99.450 99.565 14,607 39881 99.565
7/15/2023 99.465 99.705 99.260 99.630 18,046 0 99.605
7/14/2023 99.465 99.705 99.260 99.605 14,607 37511 99.605
7/13/2023 100.205 100.295 99.425 99.455 17,931 35315 99.455
7/12/2023 101.295 101.295 100.180 100.195 25,270 30930 100.195
7/11/2023 101.610 101.650 101.315 101.405 21,382 28467 101.405
7/10/2023 101.970 102.235 101.610 101.610 13,219 27933 101.610
7/8/2023 102.785 102.875 101.910 101.910 19,418 0 101.950
7/7/2023 102.785 102.875 101.910 101.950 13,109 26457 101.950
7/6/2023 103.025 103.275 102.605 102.865 19,418 26024 102.865
7/5/2023 102.730 103.055 102.630 103.035 21,210 25708 103.035
7/3/2023 102.645 102.955 102.415 102.630 9,362 26114 102.630
7/1/2023 103.025 103.230 102.430 102.575 12,942 0 102.585


It doesn't appear to be happening in Gain Trader, Will you please look into this for me?

Thanks

API Support » Invalid Custom Compound in Real Accounts Jun 21, 2023 @ 05:02 PM (Total replies: 0)

I have a client that is attempting to roll a custom compound and they are receiving an invalid custom compound error message when placing the order. This appears to only happen in real and does not happen in sim.

On contract ESU23 a custom compound was placed with these legs:
OE4DM23 C4430 Sell Call with -11 quantity.
OEW4M23 C4480 Buy Call with 11 quantity.

We are then attempting to roll the OEW4M23 C4480 option down a couple strikes to C4450 and we place it as a sell option custom compound with legs of:
OEW4M23 C4480 Buy Call with 11 quantity.
OEW4M23 C4450 Sell Call with -11 Quantity

We then get "OEW4M23 COS +11 C4480, -11 C4450: Rejected Creation of custom compound failed: CustomCompound validation failed: Your strategy definition failed"

Again, this works in sim but does not work in prod from what we have tested.

Thanks

API Support » Determine Subscription Limit on Account Jun 02, 2023 @ 05:09 PM (Total replies: 0)

Is there a way for me to determine the max number of subscriptions an(a) account/user has on the different subscription types? I know there is a default and I found an old forum post about the defaults and I'm not sure if those defaults have changed either.

Thanks

API Support » DOW Mini Option Data Appears Very Sparse May 24, 2023 @ 09:49 AM (Total replies: 2)

Sounds good, thank you.

API Support » GF COM API Range/Volume Bar Subscription vs History Request May 24, 2023 @ 09:48 AM (Total replies: 2)

Sounds good, we will implement it that way, thank you very much.

API Support » GF API COM Logging in Without Internet Connection Gives Login Failed with Invalid Username or Password May 23, 2023 @ 01:13 PM (Total replies: 2)

Thank you very much.

API Support » DOW Mini Option Data Appears Very Sparse May 22, 2023 @ 10:50 AM (Total replies: 2)

The Mini DOW Option data appears very sparse from what I can see.

The YM underlying OEYM May 31, 2023 expiration has two strikes around the money that have ask values, but everything else have bids/asks of 0. I am looking in Gain Trader Demo and it appears to have the same issue.

All of the expirations for YM appear to have very minimal data with a lot of bids/asks of 0.

Thanks

API Support » Placing Limit Compound Orders as Credits vs Debits May 05, 2023 @ 10:49 AM (Total replies: 0)

When placing a compound option order and wanting to place a credit, should I be sending off a price that is a negative value?

I have noticed inside of gain trader demo when creating a Call Vertical (or any other compound option), if I put in a negative value and press transmit order, it shows "Credit: $" and anything above 0 shows "Debit: $".

Does this mean if I send off what I want to be a credit I need to send a negative value for the price? Or should everything be a positive value?

I have tried sending off a negative value for credit and it appears that they are getting filled immediately, when they should not be.

For example if I want to send off a credit spread at the price of 1.20, should I be sending off -1.20, or should I send off 1.20?

Thanks.

API Support » GF COM API: Determining if Position was Placed as a Spread Apr 19, 2023 @ 09:51 AM (Total replies: 2)

It seems weird to me that the spread is placed with a spread contract symbol/id, but when the position comes back, it has no idea about what it was placed as. There's no way I can piece it together by checking some legs or something of the position contract or anything?

Thanks.

API Support » GF API COM: Ability to Place Combo Orders Apr 17, 2023 @ 03:38 PM (Total replies: 2)

Mostly am I able to place a futures order and an option order in the same order. Not necessarily 2 *random* orders. They would need the same base symbol, but just a futures order and option order.

API Support » GF API COM: Ability to Place Combo Orders Apr 17, 2023 @ 01:53 PM (Total replies: 2)

Is there the ability to place combo orders? Meaning is there a way that I can place an option order and a limit order at the same time?

I have tried following what I am doing with custom compound orders and throwing a limit order in there, but it doesn't appear to be working. It keeps saying invalid compound type.

Thanks.

API Support » GF COM API: Determining if Position was Placed as a Spread Apr 14, 2023 @ 12:18 PM (Total replies: 2)

Is there a way for me to determine inside of the account's AvgPositions dictionary if a position was part of a futures spread?

I have checked the compound type as well as the contract kind for any sort of indication of spread and everything comes back as Kind_Futures or Compound_Unknown.

The symbol that comes back on the contract has no indication of it being part of a spread either.

I have checked:
position->Contract
position->Contract->BaseContract
position->PositionContract
position->Contract->ParentContract
position->PositionContract->BaseContract

It appears that the parent contract of the position has the same id for spread positions that come back which is what is what I have been using to determine if they were part of the same spread. That does not carry across the close and can no longer be used.

Thanks
Edited by RWare2020 on Apr 14, 2023 12:21 PM

API Support » Incorrect Values Coming from Margin Calculation Request Mar 28, 2023 @ 02:03 PM (Total replies: 4)

It looks like it's working, thanks!

API Support » Incorrect Values Coming from Margin Calculation Request Mar 28, 2023 @ 12:01 PM (Total replies: 4)

Thank you, I have attempted this and it didn't seem to match up either.
What is the Net Position values that are required for they hypo position?

Thanks.

API Support » Incorrect Values Coming from Margin Calculation Request Mar 24, 2023 @ 04:36 PM (Total replies: 4)

I am looking at a NASDAQ compound order:

OQNEH23 C12875 Being placed as a sell

OQNEH23 C12850 Being placed as a buy

The margin from gain trader using the margin calculator is coming back as Initial: 304 and Maintenance: 276 which looks correct.

When I place it using the margin request, I am getting 16831 for Initial and 15301 for Maintenance. It seems like it's not taking into account the buy leg I am placing with it.

Will you please look into this for me?

Thanks

API Support » GF API COM OnMarginCalculationCompleted to Being Hit After doing Margin Request Feb 14, 2023 @ 11:46 AM (Total replies: 4)

Furthermore, if I place the order that is not being calculated, then attempt to do another margin check on the position I just placed it works.

So it appears that the margin calculation only works on positions in the account.

API Support » GF API COM OnMarginCalculationCompleted to Being Hit After doing Margin Request Feb 14, 2023 @ 11:41 AM (Total replies: 4)

Something seems weird.

With option symbol:
OQNEG23 C12500 - marginCalc->WithOrder(GFApi()->Margin->CreateHypoOrder(contract->id, OrderSide_Buy, 1));
OQNEG23 P12500 - marginCalc->WithOrder(GFApi()->Margin->CreateHypoOrder(contract->id, OrderSide_Sell, 1));
OQNEG23 C12250 - marginCalc->WithOrder(GFApi()->Margin->CreateHypoOrder(contract->id, OrderSide_Buy, 1));

OnMarginCalculated does not get called

With Option Symbol:
OQNEG23 C12300 - marginCalc->WithOrder(GFApi()->Margin->CreateHypoOrder(contract->id, OrderSide_Buy, 1));
OQNEG23 P12300 - marginCalc->WithOrder(GFApi()->Margin->CreateHypoOrder(contract->id, OrderSide_Sell, 1));
OQNEG23 C12550 - marginCalc->WithOrder(GFApi()->Margin->CreateHypoOrder(contract->id, OrderSide_Buy, 1));

OnMarginCalculated does get called

They are both compound orders with 2 buy calls and 1 sell put.
The legs that do get calculated, they are a current position of mine. Why is it working when I have a position and not work when I don't have a position with those legs?

API Support » GF API COM OnMarginCalculationCompleted to Being Hit After doing Margin Request Feb 09, 2023 @ 07:04 PM (Total replies: 4)

Logging is showing that the margin calculation is going out:

Timestamp: 2/9/2023 6:03:30 PM - Category: 2 - Message: OrderConnection Outgoing:
Timestamp: 2/9/2023 6:03:32 PM - Category: 2 - Message: OrderConnection Outgoing:
Timestamp: 2/9/2023 6:03:34 PM - Category: 2 - Message: OrderConnection Outgoing:

API Support » GF API COM OnMarginCalculationCompleted to Being Hit After doing Margin Request Feb 09, 2023 @ 07:03 PM (Total replies: 4)

OnMarginCalculationCompleted is not being called after doing a margin request.
It was working before and is no longer working.
This is my code for the margin request:
I have tried updating the latest version of the API but did not help

IMarginCalculationRequestBuilderPtr marginCalc;
marginCalc.CreateInstance(__uuidof(MarginCalculationRequestBuilder));

IAccountPtr pAcct = GetCurrentAccountPtr(GFApi());

marginCalc->WithAccountID(pAcct->id);
IContractPtr contract = GFApi()->Contracts->Get_2((LPCTSTR)leg->
marginCalc->WithOrder(GFApi()->Margin->CreateHypoOrder(contract->id, side, qty));
IMarginCalculationRequestPtr marginRequest = marginCalc->Build();
_bstr_t valid = GFApi()->Margin->ValidateMarginCalculationRequest(marginRequest);
//valid is NULL which means it is valid
GFApi()->Margin->RequestMarginCalculation(marginRequest);

Please implement what is involved in this thread (https://apisupport.gainfutures.com/Topic/Index/1483) , it's in the API, but not in the GF COM API Wrapper as well

Thanks