API Support Forum
OEC API > API Support > New GF API Market Orders
Author Topic: New GF API Market Orders
(2 messages, Page 1 of 1)
Moderators: VPfau
PNannis
Posts: 17
Joined: Apr 16, 2014


Posted: Jan 15, 2020 @ 03:42 PM             Msg. 1 of 2
I'm getting a "Nullable object must have a value" exception when trying to send a Market Order. Limit, Stop and StopLimit orders are working fine. Not getting any Validation errors and the exception occurs at gfClient.Orders.SendOrder(newOrderDraft) . I've tried stripping it down to only using the fields you use in the online order examples but getting same result.

The order draft is set as below and builds fine.

newOrderDraft = new GF.Api.Orders.Drafts.OrderDraftBuilder()
.WithSide(tType)
.WithContractID(newOrderContract.ID)
.WithComments(tmpOrderID)
.WithAccountID(account.ID)
.WithAllocationBlock(allocationBlock)
.WithQuantity(quantity)
.WithOrderType(oType)
.WithFlags(goodTill)
.WithSubmissionType(GF.Api.Values.Orders.SubmissionType.Manual);

Version, GF.Api 4.0.3.12 , GF.Api.Impl 4.0.3.16, GF.Api.Values 4.0.3.5, GF.Api.Common 4.0.3.1
Peter Nannis
PNannis
Posts: 17
Joined: Apr 16, 2014


Posted: Jan 16, 2020 @ 12:49 PM             Msg. 2 of 2
Figured it out .. please ignore.
Peter Nannis