Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PROCEDURE L2_SI_AutoCreation DO
- {
- PrintEx("__SI__ SGX Auto Creation");
- ClearMsgMap("SI_AUTO_CREATED_SIs");
- PrepareMsgMapForWalking("ALLOCATIONS_TO_AUTO_SI");
- WHILE (WalkingTheMsgMap("ALLOCATIONS_TO_AUTO_SI", CE_OBJ_ATT_ALLOC_POS) = FALSE) DO
- {
- InitIterator(IT_UNIVERSAL, "ATT_ALLOC_POS");
- WHILE (IteratorGetNext(IT_UNIVERSAL, "") = NO_ERROR) DO
- {
- # TODO: Add any filters here.
- CopyObject(CE_OBJ_POSITION, CE_OBJ_ATT_ALLOC_POS);
- IF (GetIntParam("IN_OVERDUE_AUTO_CREATION_PROCESS") = TRUE) THEN
- {
- IF (([ATT_ALLOC_POS.Settlement Date] < GetNextTradingDay()) AND ([ATT_ALLOC_POS.Cancelled SI Quantity] D_NOT_EQUAL(0.0))) DO
- {
- IF ([ATT_ALLOC_POS.Cancelled Pool ID] != "") DO
- {
- AddToMsgMap([ATT_ALLOC_POS.Position ID], CE_OBJ_ATT_ALLOC_POS, "ALLOCATIONS_TO_AUTO_SI");
- }
- }
- }
- ELSE IF (GetIntParam("IN_ALLOC_MIGARTION_PROCESS") = TRUE) THEN
- {
- IF ([ATT_ALLOC_POS.Settlement Date] <= GetNextTradingDay()) DO
- {
- AddToMsgMap([ATT_ALLOC_POS.Position ID], CE_OBJ_ATT_ALLOC_POS, "ALLOCATIONS_TO_AUTO_SI");
- }
- }
- ELSE
- {
- IF ([ATT_ALLOC_POS.Settlement Date] = GetNextTradingDay()) DO
- {
- AddToMsgMap([ATT_ALLOC_POS.Position ID], CE_OBJ_ATT_ALLOC_POS, "ALLOCATIONS_TO_AUTO_SI");
- }
- }
- }
- BREAK
- }
- PrepareMsgMapForWalking("ALLOCATIONS_TO_AUTO_SI");
- WHILE (WalkingTheMsgMap("ALLOCATIONS_TO_AUTO_SI", CE_OBJ_ATT_ALLOC_POS) = TRUE) DO
- {
- # SGEXNEWC-830 [SI] - CAS Allocations to be Exempted for SI auto generation
- AttachEntity([ATT_ALLOC_POS.Firm ID], ENT_BROKER);
- IF (GetIntParam("IN_ALLOC_MIGARTION_PROCESS") != TRUE) DO
- {
- IF ([BROKER.CDP CAS Indicator] = TRUE) DO
- {
- PrintEx("__SI__ Exempt CAS Allocation [%s]", [ATT_ALLOC_POS.Position ID]);
- # [SIT] Revert SGEXNEWC-830 - 2014/10/20 - Srimal
- # IF ([ATT_ALLOC_POS.Current Quantity] D_EQUAL(0.0) = FALSE) THEN
- # {
- # PrintEx("__SI__ Current Quantity is set to zero");
- # [ATT_ALLOC_POS.Current Quantity] := 0.0;
- #
- # [ATT_ALLOC_POS.Unique Reference] := [zUniqueRef];
- # [ATT_ALLOC_POS.Entering User ID] := "SI AUTO CREATION";
- # [ATT_ALLOC_POS.External Request ID] := [zUniqueRef];
- # [ATT_ALLOC_POS.Last Updated Source ID] := ClearingEngine;
- #
- # # new publish position function to update positions with no hierarchy
- # CALL NC_PublishPosition PC_ATTACHED_ALLOCATION, ALLOC_SI_SETTLEMENT;
- # }
- # ELSE
- # {
- # PrintEx("__SI__ Current Quantity is already zero" );
- # }
- CONTINUE
- }
- }
- CALL SI_AutoCreationHelper;
- }
- ClearMsgMap("ALLOCATIONS_TO_AUTO_SI");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement