Advertisement
Guest User

Untitled

a guest
Mar 6th, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. PROCEDURE L2_SI_AutoCreation DO
  2. {
  3. PrintEx("__SI__ SGX Auto Creation");
  4.  
  5. ClearMsgMap("SI_AUTO_CREATED_SIs");
  6.  
  7. PrepareMsgMapForWalking("ALLOCATIONS_TO_AUTO_SI");
  8.  
  9. WHILE (WalkingTheMsgMap("ALLOCATIONS_TO_AUTO_SI", CE_OBJ_ATT_ALLOC_POS) = FALSE) DO
  10. {
  11. InitIterator(IT_UNIVERSAL, "ATT_ALLOC_POS");
  12.  
  13. WHILE (IteratorGetNext(IT_UNIVERSAL, "") = NO_ERROR) DO
  14. {
  15. # TODO: Add any filters here.
  16. CopyObject(CE_OBJ_POSITION, CE_OBJ_ATT_ALLOC_POS);
  17.  
  18. IF (GetIntParam("IN_OVERDUE_AUTO_CREATION_PROCESS") = TRUE) THEN
  19. {
  20. IF (([ATT_ALLOC_POS.Settlement Date] < GetNextTradingDay()) AND ([ATT_ALLOC_POS.Cancelled SI Quantity] D_NOT_EQUAL(0.0))) DO
  21. {
  22. IF ([ATT_ALLOC_POS.Cancelled Pool ID] != "") DO
  23. {
  24. AddToMsgMap([ATT_ALLOC_POS.Position ID], CE_OBJ_ATT_ALLOC_POS, "ALLOCATIONS_TO_AUTO_SI");
  25. }
  26. }
  27. }
  28. ELSE IF (GetIntParam("IN_ALLOC_MIGARTION_PROCESS") = TRUE) THEN
  29. {
  30. IF ([ATT_ALLOC_POS.Settlement Date] <= GetNextTradingDay()) DO
  31. {
  32. AddToMsgMap([ATT_ALLOC_POS.Position ID], CE_OBJ_ATT_ALLOC_POS, "ALLOCATIONS_TO_AUTO_SI");
  33. }
  34. }
  35. ELSE
  36. {
  37. IF ([ATT_ALLOC_POS.Settlement Date] = GetNextTradingDay()) DO
  38. {
  39. AddToMsgMap([ATT_ALLOC_POS.Position ID], CE_OBJ_ATT_ALLOC_POS, "ALLOCATIONS_TO_AUTO_SI");
  40. }
  41. }
  42.  
  43. }
  44. BREAK
  45. }
  46.  
  47. PrepareMsgMapForWalking("ALLOCATIONS_TO_AUTO_SI");
  48.  
  49. WHILE (WalkingTheMsgMap("ALLOCATIONS_TO_AUTO_SI", CE_OBJ_ATT_ALLOC_POS) = TRUE) DO
  50. {
  51. # SGEXNEWC-830 [SI] - CAS Allocations to be Exempted for SI auto generation
  52. AttachEntity([ATT_ALLOC_POS.Firm ID], ENT_BROKER);
  53.  
  54. IF (GetIntParam("IN_ALLOC_MIGARTION_PROCESS") != TRUE) DO
  55. {
  56. IF ([BROKER.CDP CAS Indicator] = TRUE) DO
  57. {
  58. PrintEx("__SI__ Exempt CAS Allocation [%s]", [ATT_ALLOC_POS.Position ID]);
  59.  
  60. # [SIT] Revert SGEXNEWC-830 - 2014/10/20 - Srimal
  61. # IF ([ATT_ALLOC_POS.Current Quantity] D_EQUAL(0.0) = FALSE) THEN
  62. # {
  63. # PrintEx("__SI__ Current Quantity is set to zero");
  64. # [ATT_ALLOC_POS.Current Quantity] := 0.0;
  65. #
  66. # [ATT_ALLOC_POS.Unique Reference] := [zUniqueRef];
  67. # [ATT_ALLOC_POS.Entering User ID] := "SI AUTO CREATION";
  68. # [ATT_ALLOC_POS.External Request ID] := [zUniqueRef];
  69. # [ATT_ALLOC_POS.Last Updated Source ID] := ClearingEngine;
  70. #
  71. # # new publish position function to update positions with no hierarchy
  72. # CALL NC_PublishPosition PC_ATTACHED_ALLOCATION, ALLOC_SI_SETTLEMENT;
  73. # }
  74. # ELSE
  75. # {
  76. # PrintEx("__SI__ Current Quantity is already zero" );
  77. # }
  78.  
  79.  
  80. CONTINUE
  81. }
  82. }
  83.  
  84. CALL SI_AutoCreationHelper;
  85. }
  86. ClearMsgMap("ALLOCATIONS_TO_AUTO_SI");
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement