Click or drag to resize

Woti.Orders Namespace

Provides an interface for interacting with the Worms order framework. Place orders, query order information, etc.
Classes
 ClassDescription
Public classCAdjustmentEventDataThe IAdjustmentEventData object defines one adjustment to be applied to an Execution event, specified by the IAdjustmentEventData::EventId data member. The data members such as GiveUp and Cmta indicate that these items may be adjusted if desired. Any data members that are left blank indicate that the data should stay the same as it was originally. Executions must be fully adjusted, the total IAdjustmentEventData::Qty of all IAdjustmentEventData objects that refer to IAdjustmentEventData::EventId must add up to the full quantity of that particular Execution. For example, if ABC-1-DEF-1 is an Execution event for 100 shares, you may submit two IAdjustmentEventData objects with IAdjustmentEventData::Qty of 25 and 75 respectively that both point to event id ABC-1-DEF-1, these must be submitted in the same batch so that the total adds up to 100 shares.
Public classCBulkOrderPlacer 
Public classCBulkSpreadOrderPlacer 
Public classCWormsAllocator

Builds and places a batch of allocations. New instances of CWormsAllocator are retrieved via the CWormsSession.GetAllocator() function. Validates that the restrictions and requirements of WORMS allocations are satisfied before placing the allocation. Should be used as follows:

C#
1. Woti.Orders.CWormsAllocator allocator = session_.GetAllocator()
2. allocator.AddOrderId("XX-XX")
       Add as many order ids as needed, using a loop such as a for or while loop.
       These are the orders that you intend to allocate.
       For example:
           Order AA-1 is BUY 100 GOOG @ 700.00.
           Order BB-2 is BUY 100 GOOG @ 701.00.

           To allocate both of these orders together, do

           allocator.AddOrderId("AA-1");
           allocator.AddOrderId("BB-2");

3. allocator.AddAllocation(...params...)
       Add as many allocations as needed. The total quantity of the allocations should add up to equal the total
       quantity of the orders that you added in step 2.
       For example you could allocate as follows:
           50 GOOG @ 700 to account 1
           50 GOOG @ 700 to account 2
           75 GOOG @ 701 to account 3
           25 GOOG @ 701 to account 4
4. allocator.ValidateAllocations()
       This will make sure that the quantity of all your allocations equals the total quantity of the orders you are
       allocating. Any fatal errors are thrown. Any non-fatal warnings are returned as strings. Warnings include:
       average price of allocations does not equal average price of original orders, commission is more than five
       cents per share.
5. allocator.SendAllocations()
       If this allocation batch passed validation then the allocations will be sent. If successful, the allocations
       are wiped out and the CWormsAllocator object can be reused for a new batch of allocations. If not successful,
       all the allocations are deleted but the original order data is still held.
6. allocator.Clear()
       Manually deletes all internal data from this allocator object, including original order data and allocation data.

To see the order ids of the resulting allocations, watch CWormsOrderCache.OrderUpdated for new orders of type WOTI_OrderType.OT_AllocationChild. These orders will have one initial event of type WOTI_EventType.EV_NewAllocationChild, followed by one execution event of type WOTI_EventyType.EV_AllocationExecution. To bust allocations, pass the event id of the EV_AllocationExecution event to CWormsSession::BustEvent.

Public classCWormsChangeOrderPlacerResponsible for placing WORMS change orders. New instances of CWormsChangeOrderPlacer are retrieved via the IWormsSession.GetChangeOrderPlacer() function. The only required field is the OrderId
Public classCWormsCrossingOrderPlacer Responsible for placing new WORMS crossing orders. New instances of CWormsCrossingOrderPlacer are retrieved via the IWormsSession.GetCrossingOrderPlacer() function. The CWormsCrossingOrderPlacer automatically populates parameters that are marked in the documentation as "Not Required" with default values that are legitimate for most orders. Parameters marked as "Required" must be filled in by the user.
Public classCWormsCrossingOrderResultContains the main and contra order ID's returned from a crossing order.
Public classCWormsCrossingSpreadOrderPlacer Responsible for placing new WORMS crossing spread orders. New instances of CWormsCrossingSpreadOrderPlacer are retrieved via the IWormsSession.GetCrossingSpreadOrderPlacer() function. The CWormsCrossingSpreadOrderPlacer automatically populates parameters that are marked in the documentation as "Not Required" with default values that are legitimate for most orders. Parameters marked as "Required" must be filled in by the user.
Public classCWormsCrossingSpreadTradeReportPlacer Responsible for placing new WORMS crossing spread trade reports. New instances of CWormsCrossingSpreadTradeReportPlacer are retrieved via the IWormsSession.GetCrossingSpreadTradeReportPlacer() function. The CWormsCrossingSpreadTradeReportPlacer automatically populates parameters that are marked in the documentation as "Not Required" with default values that are legitimate for most orders. Parameters marked as "Required" must be filled in by the user.
Public classCWormsCrossingTradeReportPlacer Responsible for placing new WORMS crossing trade reports. New instances of CWormsCrossingTradeReportPlacer are retrieved via the IWormsSession.GetCrossingTradeReportPlacer() function. The CWormsCrossingTradeReportPlacer automatically populates parameters that are marked in the documentation as "Not Required" with default values that are legitimate for most orders. Parameters marked as "Required" must be filled in by the user.
Public classCWormsEventDescribes a single WORMS Event. A collection of these is maintained by each IWormsOrder.
Public classCWormsHistoricalOrderRequestorRequest historical orders from the WORMS historical data caches.

Historical order data is delivered by WORMS backend servers, so IWormsSession::InitializeWmdBackend must be called before a request can be sent successfully. Contact WEX Support to make sure that your user is configured to connect to the cache server. Should be used as follows:

C#
// Create the historical order requestor and subscribe to events.
Woti.Orders.IWormsHistoricalOrderRequestor requestor_ = session_.GetHistoricalOrderRequestor();
requestor_.HistoricalOrderReceived += OnHistoricalOrderReceived;
requestor_.HistoricalRequestComplete += OnHistoricalRequestComplete;

// Make a new data request. This request will fetch all orders sent on Nov. 6th 2018, in the account named "ACCOUNT1".
requestor_.GetHistoricalOrders("2018-11-06", WOTI_PositionType.PT_Account, "ACCOUNT1");
Public classCWormsOrderDescribes a single WORMS Order and contains all events associated with the order.
Public classCWormsOrderCacheContains all WORMS orders the the user has permission to see.
Public classCWormsOrderLegStores information about an order leg for complex orders such as spread orders.
Public classCWormsOrderPlacerResponsible for placing new WORMS simple orders. New instances of CWormsOrderPlacer are retrieved via the IWormsSession.GetOrderPlacer() function. The CWormsOrderPlacer automatically populates parameters that are marked in the documentation as "Not Required" with default values that are legitimate for most orders. Parameters marked as "Required" must be filled in by the user.
Public classCWormsPositionAdjustmentPlacerResponsible for placing new WORMS position adjustments. New instances of CWormsPositionAdjustmentPlacer are retrieved via the IWormsSession.GetPositionAdjustmentPlacer() function. The CWormsPositionAdjustmentPlacer automatically populates parameters that are marked in the documentation as "Not Required" with default values that are legitimate for most orders. Parameters marked as "Required" must be filled in by the user.
Public classCWormsPostTradeAdjuster The IWormsPostTradeAdjuster interface allows you to submit adjustments to existing Execution events on orders. Each Execution event may be adjusted individually to alter data such as its Give-Up, CMTA, and Account Type among other data. Sample usage:
Public classCWormsRfqOrderPlacerResponsible for placing new WORMS RFQ orders. New instances of CWormsOrderPlacer are retrieved via the IWormsSession.GetRfqOrderPlacer() function.
Public classCWormsRfqSpreadOrderPlacerResponsible for placing new WORMS RFQ orders. New instances of CWormsSpreadOrderPlacer are retrieved via the IWormsSession.GetRfqSpeadOrderPlacer() function.
Public classCWormsSpreadOrderPlacerResponsible for placing new WORMS spread orders. New instances of CWormsSpreadOrderPlacer are retrieved via the IWormsSession.GetSpreadOrderPlacer() function. The CWormsSpreadOrderPlacer automatically populates parameters that are marked in the documentation as "Not Required" with default values that are legitimate for most orders. Parameters marked as "Required" must be filled in by the user.
Public classCWormsSpreadTradeReportPlacerResponsible for placing new WORMS spread report trade. New instances of CWormsTradeReportSpreadPlacer are retrieved via the IWormsSession.GetSpreadTradeReportPlacer() function. The CWormsSpreadTradeReportPlacer automatically populates parameters that are marked in the documentation as "Not Required" with default values that are legitimate for most orders. Parameters marked as "Required" must be filled in by the user.
Public classCWormsStagedCrossingOrderPlacerResponsible for placing new WORMS staged crossing orders. New instances of CWormsStagedCrossingOrderPlacer are retrieved via the IWormsSession.GetStagedCrossingOrderPlacer() function. The CWormsStagedCrossingOrderPlacer automatically populates parameters that are marked in the documentation as "Not Required" with default values that are legitimate for most orders. Parameters marked as "Required" must be filled in by the user.
Public classCWormsStagedCrossingSpreadOrderPlacer Responsible for placing new WORMS staged crossing spread orders. New instances of CWormsStagedCrossingSpreadOrderPlacer are retrieved via the IWormsSession.GetStagedCrossingSpreadOrderPlacer() function. The CWormsStagedCrossingSpreadOrderPlacer automatically populates parameters that are marked in the documentation as "Not Required" with default values that are legitimate for most orders. Parameters marked as "Required" must be filled in by the user.
Public classCWormsStagedOrderPlacerResponsible for placing new WORMS staged orders. New instances of CWormsStagedOrderPlacer are retrieved via the IWormsSession.GetStagedOrderPlacer() function. The CWormsStagedOrderPlacer automatically populates parameters that are marked in the documentation as "Not Required" with default values that are legitimate for most orders. Parameters marked as "Required" must be filled in by the user.
Public classCWormsStagedSpreadOrderPlacerResponsible for placing new WORMS simple orders. New instances of CWormsStagedSpreadOrderPlacer are retrieved via the IWormsSession.GetStagedSpreadOrderPlacer() function. The CWormsOrderPlacer automatically populates parameters that are marked in the documentation as "Not Required" with default values that are legitimate for most orders. Parameters marked as "Required" must be filled in by the user.
Public classCWormsTradeReportPlacerResponsible for placing new WORMS report trade. New instances of CWormsTradeReportPlacer are retrieved via the IWormsSession.GetTradeReportPlacer() function. The CWormsTradeReportPlacer automatically populates parameters that are marked in the documentation as "Not Required" with default values that are legitimate for most orders. Parameters marked as "Required" must be filled in by the user.
Interfaces
Delegates