12 const size_t MarketDepthArraySize = 5;
17 const unsigned short RSP_OrderStatus_PENDING = 0;
22 const unsigned short RSP_OrderStatus_CONFIRMED = 1;
27 const unsigned short RSP_OrderStatus_FILLED = 2;
32 const unsigned short RSP_OrderStatus_CANCELED = 3;
37 const unsigned short RSP_OrderStatus_REPLACED = 4;
42 const unsigned short RSP_OrderStatus_NEW_REJECTED = 5;
47 const unsigned short RSP_OrderStatus_CANCEL_REJECTED = 6;
52 const unsigned short RSP_OrderStatus_REPLACE_REJECTED = 7;
57 const unsigned short RSP_OrderStatus_FROZEN = 8;
62 const unsigned short RSP_OrderStatus_MARKET_TO_LIMIT = 9;
67 const unsigned short RSP_OrderStatus_TRIGGERED = 10;
72 const unsigned short RSP_OrderStatus_PARTIALLY_FILLED = 11;
77 const unsigned short RSP_OrderStatus_CANCELED_OF_IOC = 12;
82 const unsigned short RSP_OrderStatus_RMS_REJECT = 13;
90 const unsigned short RSP_StrategyComment_CIRCUIT_LIMIT_BREACH = 0;
95 const unsigned short RSP_StrategyComment_HEDGE_MARKET_ORDER_CANCELLED = 1;
100 const unsigned short RSP_StrategyComment_MAX_TRADABLE_LOTS_REACHED = 2;
105 const unsigned short RSP_StrategyComment_RMS_FAILURE = 3;
110 const unsigned short RSP_StrategyComment_USER_INPUT = 4;
115 const unsigned short RSP_StrategyComment_SECOND_LEG_PRICE_CHECK_FAIL = 5;
120 const unsigned short RSP_StrategyComment_WRONG_REF_PRICE_IN_CASE_OF_STOCKS = 6;
125 const unsigned short RSP_StrategyComment_PRICE_OF_HEDGING_INSTRUMENT_CALCULATED_ZERO = 7;
130 const unsigned short RSP_StrategyComment_MARKET_DATA_ORDER_INST_NOT_FOUND = 8;
135 const unsigned short RSP_StrategyComment_DELTA_CALCULATED_ZERO = 9;
140 const unsigned short RSP_StrategyComment_PRICE_DIFFERENCE_IS_GREATER_THAN_TOTAL_SPREAD = 10;
145 const unsigned short RSP_StrategyComment_SELL_PRICE_SMALLER_THAN_BEST_BID_OR_BUY_PRICE_GREATER_THAN_BEST_ASK = 11;
150 const unsigned short RSP_StrategyComment_MARKET_DATA_HEDGE_INST_NOT_FOUND = 12;
155 const unsigned short RSP_StrategyComment_EXCHANGE_DISCONNECTED = 13;
160 const unsigned short RSP_StrategyComment_ORDER_FROZEN = 14;
165 const unsigned short RSP_StrategyComment_FIRST_LEG_TBT_SUBSCRIPTION_FAILED = 15;
170 const unsigned short RSP_StrategyComment_SECOND_LEG_TBT_SUBSCRIPTION_FAILED = 16;
175 const unsigned short RSP_StrategyComment_IDLE_TIMER_EXPIRED = 17;
180 const unsigned short RSP_StrategyComment_ORDER_NOT_FILLED_OPEN_POSITIONS_CLOSED = 18;
185 const unsigned short RSP_StrategyComment_ORDER_NOT_FILLED_OPEN_POSITIONS_EXIST = 19;
190 const unsigned short RSP_StrategyComment_STRATEGY_COMPLETED_SUCCESSFULLY = 20;
195 const unsigned short RSP_StrategyComment_MARKET_MAKING_ORDER_LOTS_REDUCED = 21;
200 const unsigned short RSP_StrategyComment_MARKET_MAKING_REFERENCE_PRICE_PROTECTION_FAILED = 22;
205 const unsigned short RSP_StrategyComment_UNKNOWN_STATE = 23;
210 const unsigned short RSP_StrategyComment_THIRD_LEG_TBT_SUBSCRIPTION_FAILED = 24;
215 const unsigned short RSP_StrategyComment_ORDER_NOT_FILLED_OR_PARTIALLY_FILLED = 25;
220 const unsigned short RSP_StrategyComment_SPREAD_NOT_FAVOURABLE = 26;
225 const unsigned short RSP_StrategyComment_TRADES_COMPLETED = 27;
230 const unsigned short RSP_StrategyComment_TBT_SUBSCRIPTION_FAILED = 28;
235 const unsigned short RSP_StrategyComment_TBTFO_DISCONNECTED = 29;
240 const unsigned short RSP_StrategyComment_TBTCM_DISCONNECTED = 30;
245 const unsigned short RSP_StrategyComment_TURNOVER_ROUNDS_COMPLETED = 31;
250 const unsigned short RSP_StrategyComment_CURRENT_TIME_GREATER_THAN_ACTIVATION = 32;
255 const unsigned short RSP_StrategyComment_TERMINATE_SPREAD_BREACHED = 33;
260 const unsigned short RSP_StrategyComment_SYNTHETIC_POSITION_NOT_FILLED_OR_PARTIALLY_FILLED = 34;
265 const unsigned short RSP_StrategyComment_FOURTH_LEG_TBT_SUBSCRIPTION_FAILED = 35;
270 const unsigned short RSP_StrategyComment_UNDERLYING_TBT_SUBSCRIPTION_FAILED = 36;
275 const unsigned short RSP_StrategyComment_HEDGING_TBT_SUBSCRIPTION_FAILED = 37;
280 const unsigned short RSP_StrategyComment_FIRST_SQUARE_OFF_WITH_TIMER_NOT_FILLED = 38;
285 const unsigned short RSP_StrategyComment_STRATEGY_VERSION_DIFFERS = 39;
290 const unsigned short RSP_StrategyComment_PAIRS_ERROR_STATE = 40;
295 const unsigned short RSP_StrategyComment_PAIRS_TARGET_ACHIEVED = 41;
301 const unsigned short RSP_StrategyComment_PAIRS_STRATEGY_TERMINATING = 42;
306 const unsigned short RSP_StrategyComment_PAIRS_STOP_LOSS_HIT = 43;
311 const unsigned short RSP_StrategyComment_PAIRS_MAX_CYCLES_COMPLETED = 44;
316 const unsigned short RSP_StrategyComment_PAIRS_RESTORE_FAILED = 45;
321 const unsigned short RSP_StrategyComment_TBTCDS_DISCONNECTED = 46;
326 const unsigned short RSP_StrategyComment_INCREASE_COUNTER = 47;
331 const unsigned short RSP_StrategyComment_FORCE_TERMINATE = 48;
336 const unsigned short RSP_StrategyComment_STRATEGY_ALREADY_TERMINATED = 49;
341 const unsigned short RSP_StrategyComment_STRATEGY_ERROR_STATE = 50;
346 const unsigned short RSP_StrategyComment_STRATEGY_API_NOT_FOUND = 51;
351 const unsigned short RSP_StrategyComment_MAX = 52;
360 const unsigned short RSP_ResponseType_SUCCESS = 0;
365 const unsigned short RSP_ResponseType_FAILURE = 1;
370 const unsigned short RSP_ResponseType_TERMINATE_SUCCESS = 2;
375 const unsigned short RSP_ResponseType_TERMINATE_FAILURE = 3;
380 const unsigned short RSP_ResponseType_TERMINATE_SQUAREOFF_SUCCESS = 4;
385 const unsigned short RSP_ResponseType_TERMINATE_SQUAREOFF_FAILURE = 5;
390 const unsigned short RSP_ResponseType_PAUSE_STRATEGY_SUCCESS = 6;
395 const unsigned short RSP_ResponseType_PAUSE_STRATEGY_FAILURE = 7;
400 const unsigned short RSP_ResponseType_STRATEGY_RUNNING = 8;
405 const unsigned short RSP_ResponseType_TERMINATE_SPREAD_BREACHED = 9;
410 const unsigned short RSP_ResponseType_ALGO_NOT_ALLOWED = 10;
415 const unsigned short RSP_ResponseType_INCREASE_COUNTER = 11;
420 const unsigned short RSP_ResponseType_STRATEGY_ALREADY_TERMINATED = 12;
425 const unsigned short RSP_ResponseType_STRATEGY_API_NOT_FOUND = 13;
433 const unsigned short RSP_RiskStatus_SUCCESS = 0;
438 const unsigned short RSP_RiskStatus_WRONG_QUANTITY = 1;
443 const unsigned short RSP_RiskStatus_NOT_CONFIGURED = 2;
448 const unsigned short RSP_RiskStatus_MAX_SINGLE_ORDER_QTY_VIOLATED = 3;
453 const unsigned short RSP_RiskStatus_MAX_SINGLE_ORDER_VALUE_VIOLATED = 4;
458 const unsigned short RSP_RiskStatus_TOTAL_BUY_QUANTITY_VIOLATED = 5;
463 const unsigned short RSP_RiskStatus_TOTAL_BUY_VALUE_VIOLATED = 6;
468 const unsigned short RSP_RiskStatus_TOTAL_SELL_QUANTITY_VIOLATED = 7;
473 const unsigned short RSP_RiskStatus_TOTAL_SELL_VALUE_VIOLATED = 8;
478 const unsigned short RSP_RiskStatus_MAX_NET_QUANTITY_VIOLATED = 9;
483 const unsigned short RSP_RiskStatus_MAX_NET_VALUE_VIOLATED = 10;
488 const unsigned short RSP_RiskStatus_PRICE_PROTECTION_CHECK_VIOLATED = 11;
493 const unsigned short RSP_RiskStatus_MAX_MTM_LOSS_VIOLATED = 12;
498 const unsigned short RSP_RiskStatus_MAX_ORDERS_PER_SECOND_VIOLATED = 13;
503 const unsigned short RSP_RiskStatus_EXCHANGE_DISCONNECTED = 14;
508 const unsigned short RSP_RiskStatus_OUTSTANDING_TOTAL_BUY_QUANTITY_VIOLATED = 15;
513 const unsigned short RSP_RiskStatus_OUTSTANDING_TOTAL_BUY_VALUE_VIOLATED = 16;
518 const unsigned short RSP_RiskStatus_OUTSTANDING_TOTAL_SELL_QUANTITY_VIOLATED = 17;
523 const unsigned short RSP_RiskStatus_OUTSTANDING_TOTAL_SELL_VALUE_VIOLATED = 18;
528 const unsigned short RSP_RiskStatus_INDEX_PROTECTION_NSE_VIOLATED = 19;
533 const unsigned short RSP_RiskStatus_INDEX_PROTECTION_BSE_VIOLATED = 20;
538 const unsigned short RSP_RiskStatus_SECURITY_LIMITS_VIOLATED_BUY_QTY = 21;
543 const unsigned short RSP_RiskStatus_SECURITY_LIMITS_VIOLATED_BUY_VALUE = 22;
548 const unsigned short RSP_RiskStatus_SECURITY_LIMITS_VIOLATED_SELL_QTY = 23;
553 const unsigned short RSP_RiskStatus_SECURITY_LIMITS_VIOLATED_SELL_VALUE = 24;
558 const unsigned short RSP_RiskStatus_TRADER_OR_CLIENT_MARGIN_INSUFFICIENT = 25;
563 const unsigned short RSP_RiskStatus_MEMBER_NSE_MARGIN_INSUFFICIENT = 26;
568 const unsigned short RSP_RiskStatus_MEMBER_BSE_MARGIN_INSUFFICIENT = 27;
573 const unsigned short RSP_RiskStatus_PRICE_NOT_WITHIN_CIRCUIT_RANGE = 28;
578 const unsigned short RSP_RiskStatus_CLOSE_PRICE_PROTECTION_FAILED = 29;
583 const unsigned short RSP_RiskStatus_BAD_TRADE_PRICE_CHECK_FAILED = 30;
588 const unsigned short RSP_RiskStatus_MARKET_NOT_OPEN = 31;
593 const unsigned short RSP_RiskStatus_MAX = 32;
604 const unsigned short RSP_ResponseCategory_API2_REQUEST = 47;
609 const unsigned short RSP_ResponseCategory_API2_STRATEGY = 48;
620 const unsigned short CMD_OrderMode_BUY = 0;
625 const unsigned short CMD_OrderMode_SELL = 1;
630 const unsigned short CMD_OrderMode_MAX = 2;
641 const unsigned short CMD_ExchangeId_BSE = 1;
646 const unsigned short CMD_ExchangeId_NSE = 2;
651 const unsigned short CMD_ExchangeId_ESMNSE = 3;
656 const unsigned short CMD_ExchangeId_SGX = 4;
661 const unsigned short CMD_ExchangeId_NSECDS = 5;
666 const unsigned short CMD_ExchangeId_BSEETI = 6;
671 const unsigned short CMD_ExchangeId_CFH = 7;
682 const unsigned short CMD_SecurityType_COMMON_STOCK = 0;
687 const unsigned short CMD_SecurityType_FUTURE = 1;
692 const unsigned short CMD_SecurityType_OPTION = 2;
697 const unsigned short CMD_SecurityType_MAX = 3;
706 const unsigned short CMD_OrderType_LIMIT = 0;
711 const unsigned short CMD_OrderType_MARKET = 1;
716 const unsigned short CMD_OrderType_STOP_LIMIT = 2;
721 const unsigned short CMD_OrderType_STOP = 3;
731 const unsigned short CMD_OrderValidity_DAY = 0;
736 const unsigned short CMD_OrderValidity_IOC = 1;
741 const unsigned short CMD_OrderValidity_FOK = 2;
751 const unsigned short CMD_OptionMode_PUT = 0;
756 const unsigned short CMD_OptionMode_CALL = 1;
761 const unsigned short CMD_OptionMode_MAX = 2;
773 const unsigned short CMD_OptionAttribute_AMERICAN = 0;
778 const unsigned short CMD_OptionAttribute_EUROPEAN = 1;
783 const unsigned short CMD_OptionAttribute_MAX = 2;
794 const unsigned short CMD_ProductType_DELIVERY = 0;
799 const unsigned short CMD_ProductType_INTRADAY = 1;
810 const unsigned short CMD_InstrumentType_INDEX = 0;
815 const unsigned short CMD_InstrumentType_STOCK = 1;
820 const unsigned short CMD_InstrumentType_CURRENCY = 2;
825 const unsigned short CMD_InstrumentType_IRD = 3;
830 const unsigned short CMD_InstrumentType_IVX = 4;
841 const unsigned short CMD_TransactionType_NEW = 0;
846 const unsigned short CMD_TransactionType_MODIFY = 1;
851 const unsigned short CMD_TransactionType_CANCEL = 2;
856 const unsigned short CMD_TransactionType_MAX = 3;
867 const unsigned short CMD_CommandCategory_API2_REQUEST = 67;
872 const unsigned short CMD_CommandCategory_API2_STRATEGY = 68;