syntax="proto3"; package bts.api.orderman; option csharp_namespace="bts.api.orderman"; import "lib/api/Apioptions.proto"; import "lib/domain_model/Security.proto"; import "google/protobuf/timestamp.proto"; import "lib/sparkproto/SparkProtos.proto"; import "lib/api/Apicore.proto"; service OrderService { option (bts.api.service_description)="Implements order management"; // service calls rpc create_order(Create) returns (Response) { option(skip_excel_generation) = true; }; rpc cancel_order(Cancel) returns (Response) { option(skip_excel_generation) = true; }; rpc update_order(Update) returns (Response) { option(skip_excel_generation) = true; }; rpc detach_order(Detach) returns (Response) { option(skip_excel_generation) = true; }; rpc get_registered_dynamic_order_types(bts.api.VoidMessage) returns (RegisteredDynamicOrderTypes); // streams rpc orders (OrdersSub) returns (stream OrderRecord); rpc fills (FillsSub) returns (stream Fill); } // request types message Create { OrderDefinition new_order = 1; double price = 2; uint32 quantity = 3; } message Update { CustomOrderDefinition custom = 4; double price = 2; uint32 quantity = 3; uint32 order_key = 1; } message Cancel {uint32 order_key = 1;}; message Detach {uint32 order_key = 1;}; // response types message Response {uint32 order_key = 1; OrderError error_code = 2; string msg = 3;} // subscription types message OrdersSub {} message FillsSub {} message OrderDefinition { // deleted fields (don't reuse!): // - uint32 algo_template_key = 15; (originally deleted 05/03/2019) // standard order elements uint32 security_key = 1; api.Side side = 2 [(bts.api.fix_tag) = 54]; string user = 5; uint32 user_id = 13; string account = 6 [(bts.api.fix_tag) = 1]; uint32 account_id = 14; TimeInForce time_in_force = 7 [(bts.api.fix_tag) = 59]; ManualOrderIndicator manual_order_indicator = 8 [(bts.api.fix_tag) = 1028]; CTICode cti_code = 9 [(bts.api.fix_tag) = 9702]; CustomerOrFirm customer_or_firm = 10 [(bts.api.fix_tag) = 204]; OrderSubType sub_type = 12; uint32 attach_target_order_key = 16; CustomOrderDefinition custom_def = 11; string external_order_id = 20; } message CustomOrderDefinition { oneof custom { // native order types // https://www.cmegroup.com/confluence/display/EPICSANDBOX/New+Order MarketOrderDefinition market = 11; // OrdType = 1 LimitOrderDefinition limit = 12; // OrdType = 2 StopOrderDefinition stop = 13; // OrdType = 3 StopLimitOrderDefinition stop_limit = 14; // OrdType = 4 GLBXIcebergOrderDefinition glbx_iceberg = 28; // OrdType = 4, with max_show_quantity !=0 IcebergOrderDefinition iceberg = 15; SpreaderOrderDefinition spreader = 16; TimeBoxOrderDefinition time_box = 17; TickOrderDefinition tick = 18; LeanOrderDefinition lean = 19; JoinOrderDefinition join = 20; TopOrderDefinition top = 21; TriggerOrderDefinition trigger = 22; CoverOrderDefinition cover = 23; OffsetOrderDefinition offset = 24; QueueHolderDefinition queue_holder = 30; OCOOrderDefinition oco = 25; PricerOrderDefinition pricer = 26; CompositeOrderDefinition composite = 27; SplitterOrderDefinition splitter = 29; ScratchOrderDefinition scratch = 31; ProRataOrderDefinition prorata = 32; PegOrderDefinition peg = 37; TWAPOrderDefinition twap = 100; VWAPOrderDefinition vwap = 101; POVOrderDefinition pov = 102; ArrivalPriceOrderDefinition arrival = 103; VolumeSliceOrderDefinition vslice = 104; DynamicOrderDefinition dynamic = 1000; } } // Custom order definitions message MarketOrderDefinition {} message LimitOrderDefinition {} message StopOrderDefinition { double stop_price = 1; } message StopLimitOrderDefinition { double stop_price = 1; } message GLBXIcebergOrderDefinition { option (bts.api.fix_algostrategy_tagbase) = 8000; uint32 max_show_quantity = 1; } message IcebergOrderDefinition { option (bts.api.fix_algostrategy_tagbase) = 8100; double show_quantity = 1; uint32 pause_between_orders_ms = 3; CustomOrderDefinition child = 2; } message SpreaderOrderDefinition { option (bts.api.fix_algostrategy_tagbase) = 8200; api.Security security = 1; spark.ExecutionStrategy execution_strategy = 2; } message TimeBoxOrderDefinition { option (bts.api.fix_algostrategy_tagbase) = 8300; google.protobuf.Timestamp start = 1; google.protobuf.Timestamp stop = 2; CustomOrderDefinition child = 3; } //TICK is deprecated message TickOrderDefinition { uint32 tick_offset_on_deploy = 1; spark.QuantityMeasure cross_threshold = 2; uint32 cross_ticks = 3; uint32 max_chase_ticks = 4; bool detach_on_toward = 5; CustomOrderDefinition child = 6; } message LeanOrderDefinition { option (bts.api.fix_algostrategy_tagbase) = 8400; spark.QuantityMeasure cross_threshold = 1; uint32 max_chase_ticks = 2; /*deprecated*/ bool detach_on_toward = 4; enum OnToward { NO_CHANGE = 0 [(bts.api.fix_value) = "0"]; //continue to lean on initial inside market CANCEL = 1 [(bts.api.fix_value) = "1"]; //cancel algo and order DETACH = 2 [(bts.api.fix_value) = "2"]; //cancel algo but leave order working REPRICE = 3 [(bts.api.fix_value) = "3"]; //lean on new inside market } OnToward trade_toward_behavior = 5; CustomOrderDefinition child = 3; } message JoinOrderDefinition { option (bts.api.fix_algostrategy_tagbase) = 8500; spark.QuantityMeasure join_threshold = 2; CustomOrderDefinition child = 6; } message TopOrderDefinition { option (bts.api.fix_algostrategy_tagbase) = 8600; spark.QuantityMeasure top_threshold = 2; uint32 ticks_off = 3; CustomOrderDefinition child = 6; } message TriggerOrderDefinition { TriggerCondition trigger_condition=1; TriggerAction trigger_action=2; CustomOrderDefinition child=3; TriggerExitCondition exit_condition=4; } message CoverOrderDefinition { option (bts.api.fix_algostrategy_tagbase) = 8700; CustomOrderDefinition hedge = 1; uint32 hedge_ticks = 2; CustomOrderDefinition child = 3; bool cancel_on_external_hedge_cancel = 4; bool cancel_hedges_on_cancel = 5; } message OffsetOrderDefinition { option (bts.api.fix_algostrategy_tagbase) = 8800; reserved 1; int32 tick_offset_on_deploy = 2; CustomOrderDefinition child = 6; } message QueueHolderDefinition{ option (bts.api.fix_algostrategy_tagbase) = 8900; // this is for the number of trailing // orders behind the top one (so value // of 1 means 2 orders in all) uint32 n_queue_orders = 1; spark.NullableQuantity show_quantity = 2; CustomOrderDefinition child=10; } message OCOOrderDefinition { option (bts.api.fix_algostrategy_tagbase) = 9000; CustomOrderDefinition other = 1; int32 other_ticks = 2; api.RelativeSide other_side = 4; CustomOrderDefinition child = 3; } message PricerOrderDefinition { option (bts.api.fix_algostrategy_tagbase) = 9100; int32 price_offset_ticks = 1; double price_factor = 2; CustomOrderDefinition child = 3; } message CompositeOrderDefinition { uint32 algo_template_key = 1; CustomOrderDefinition definition = 2; } message SplitterOrderDefinition { option (bts.api.fix_algostrategy_tagbase) = 9200; uint32 max_order_qty = 1; uint32 exposed_qty = 2; // uint32 target_qty = 3; CustomOrderDefinition child = 10; } message ScratchOrderDefinition { option (bts.api.fix_algostrategy_tagbase) = 9300; spark.QuantityMeasure scratch_threshold = 1; uint32 chase_ticks = 2; CustomOrderDefinition child = 10; } message ProRataOrderDefinition { option (bts.api.fix_algostrategy_tagbase) = 9400; uint32 hedge_ticks = 1; uint32 chase_ticks = 2; spark.QuantityMeasure fill_limit = 5; spark.QuantityMeasure stay_in_threshold = 6; bool scratch_on_overfill = 7; bool stay_in = 8; CustomOrderDefinition child = 10; CustomOrderDefinition hedge = 20; CustomOrderDefinition overfill_hedge = 30; } message PegOrderDefinition { uint32 tick_offset = 1; CustomOrderDefinition child = 6; } message TimeDuration { //default = 0, when to start the order, 0 = immediately google.protobuf.Timestamp start = 10; oneof duration { //when to conclude google.protobuf.Timestamp end_timestamp = 20; //alternative to end_time, minutes from start time at which to stop uint32 duration_in_minutes = 30; } uint32 interval_in_seconds = 50; } message VolumeDuration { oneof duration { //the order will get done after this amount trades uint32 order_duration_in_lots = 10; } uint32 interval_in_lots = 30; } message OrderAggression { enum ScheduleMode { TacticalThenAggressive = 0; AggressiveOnly = 1; } ScheduleMode schedule_mode = 10; // default = 0, time in periods which to let unexecuted size remain in the tactical channel uint32 extra_tactical_slices = 15; // default = 0, 0 - 99 be no more than X% of the market, 0.0 means no cap uint32 max_participation_pct = 20; // default = 0.0, price at which you will take liquidity regardless of other parameters, 0.0 means there is no iwouldprice double i_would_price = 30; // default = 0, 0 - 100 vary size +/- quantity_variance percent, 0 means don't vary the size uint32 quantity_variance = 40; } message DistributionParameters { // default = 20, historical volume distribution time horizon uint32 time_horizon_days = 10; } message TWAPOrderDefinition { TimeDuration duration = 10; OrderAggression aggression = 20; CustomOrderDefinition tactical_child = 200; CustomOrderDefinition aggressive_child = 210; } message VWAPOrderDefinition { TimeDuration duration = 10; OrderAggression aggression = 20; DistributionParameters distribution_params = 30; CustomOrderDefinition tactical_child = 200; CustomOrderDefinition aggressive_child = 210; } message POVOrderDefinition { TimeDuration duration = 10; OrderAggression aggression = 20; uint32 min_participation_pct = 50; CustomOrderDefinition tactical_child = 200; CustomOrderDefinition aggressive_child = 210; } message ArrivalPriceOrderDefinition { TimeDuration duration = 10; OrderAggression aggression = 20; DistributionParameters distribution_params = 30; // default = 0.0, risk neutral, -1.0 to 1.0. nondimensional parameter. -1 is completely risk averse, 1 is risk seeking // this has the net effect of tilting Arrival schedules to do more earlier the more negative the parameter // Constant * lambda in Almgren 2000; Konishi 2002 double risk_threshold = 50; // default = 0.0, -2 slow down when market is in your favor, -1.0 do not adapt to market conditions, 0.0 speed up when the market is in your favor double adaptivity = 60; CustomOrderDefinition tactical_child = 200; CustomOrderDefinition aggressive_child = 210; } message VolumeSliceOrderDefinition { VolumeDuration duration = 10; OrderAggression aggression = 20; CustomOrderDefinition tactical_child = 200; CustomOrderDefinition aggressive_child = 210; } message DynamicOrderDefinition { string dynamic_order_type = 1; map order_params = 2; } // End custom order definitions message OrderRecord { uint32 key = 1 [(bts.api.key)=true]; uint32 parent_key = 2; OrderDefinition def = 3; OrderState state = 4; } message OrderState { // standard order state OrderStatus status = 1; double price = 2; uint32 quantity = 3; uint32 filled_quantity=4; uint32 filled_at_attach_time_quantity = 34; double last_price = 5; double avg_price = 6; string last_msg = 7; google.protobuf.Timestamp created = 16; google.protobuf.Timestamp last_change = 8; enum DisplayStatus { VISIBLE = 0; HIDDEN = 1; } DisplayStatus display_status=23; string external_order_id = 105; oneof custom { // native order types MarketOrderState market = 9; // OrdType = 1 LimitOrderState limit = 10; // OrdType = 2 StopOrderState stop= 11; // OrdType = 3 StopLimitOrderState stop_limit = 12; // OrdType = 4 GlbxIcebergOrderState glbx_iceberg = 27; // OrdType == limit, with a non zero show quantity IcebergOrderState iceberg = 13; SpreaderOrderState spreader = 14; TimeBoxOrderState time_box = 15; TickOrderState tick = 17; LeanOrderState lean = 18; JoinOrderState join = 19; TopOrderState top = 20; TriggerOrderState trigger = 21; CoverOrderState cover = 22; OffsetOrderState offset = 24; OCOOrderState oco = 25; PricerOrderState pricer = 26; QueueHolderState queue_holder = 30; SplitterOrderState splitter = 31; ScratchOrderState scratch = 32; ProRataOrderState prorata = 33; PegOrderState peg = 37; TWAPOrderState twap = 100; VWAPOrderState vwap = 101; POVOrderState pov = 102; ArrivalPriceOrderState arrival = 103; VolumeSliceOrderState vslice = 104; DynamicOrderState dynamic = 255; // do not use anything bigger than 255, or things will break } } // only native orders have fills message Fill { uint32 order_key = 1; uint32 security_key = 2; string account = 3; double last_price = 4; double avg_price = 9; api.Side side = 5; double last_shares = 6; string fill_key = 7 [(bts.api.key)=true]; google.protobuf.Timestamp timestamp = 8; uint32 internal_account_id = 11; enum FillKind { FILL_KIND_STANDARD = 0; FILL_KIND_LEG = 1; FILL_KIND_SOD = 2; } FillKind fill_kind = 10; enum FillStatus { FILL_STATUS_ACTIVE = 0; FILL_STATUS_CORRECTED = 1; FILL_STATUS_BUSTED = 2; } FillStatus fill_status = 20; } enum OrderSubType { ORDER_SUB_TYPE_NONE = 0; ORDER_SUB_TYPE_HEDGING_LEG = 1; ORDER_SUB_TYPE_QUOTING_LEG = 2; } message RoutingRecord { string session = 1; string account = 2; string operator_id = 3; CTICode cti_code = 4; CustomerOrFirm customer_or_firm = 5; string smp_id = 6 ; SelfMatchPreventionInstruction smp_instruction = 7; string location = 8; string cust_order_handling_inst = 9; string sender_compid = 15; string clearing_firm = 20; string customer_account_ref_id = 25; string account_code = 30; string company_id = 45; string authorized_trader = 50; string authorized_group = 60; string cust_order_handing_inst = 70; string order_server_id = 200; } message NativeOrderState { string exchange_order_id = 1; uint64 last_msg_seq_num = 4; enum SubError { SUB_ERROR_NONE = 0; SUB_ERROR_UNKNOWN_SECURITY = 1; SUB_ERROR_UNKNOWN_FIX_SESSION = 2; } SubError sub_error_code = 2; NativeOrderStatus native_status = 3; RoutingRecord routing_record = 5; NativeOrderType native_type = 6; string last_transact_time = 7; } // Custom order states message MarketOrderState {NativeOrderState native_state = 1;} message LimitOrderState {NativeOrderState native_state = 1;} message StopOrderState {NativeOrderState native_state = 1;} message StopLimitOrderState {NativeOrderState native_state = 1;} message GlbxIcebergOrderState {NativeOrderState native_state = 1;} message IcebergOrderState {} message SpreaderOrderState {} message TimeBoxOrderState {} message TickOrderState {} message LeanOrderState {} message JoinOrderState {} message TopOrderState {} message TriggerOrderState {} message CoverOrderState {} message OffsetOrderState {} message OCOOrderState {} message PricerOrderState {} message ScratchOrderState {} message ProRataOrderState {} message DynamicOrderState {} message QueueHolderState {} message SplitterOrderState {} message TWAPOrderState {} message VWAPOrderState {} message POVOrderState {} message ArrivalPriceOrderState {} message VolumeSliceOrderState {} message PegOrderState {} enum OrderStatus { // The order has been constructed but not acted on. Inactive orders // can be abandoned without consequences. This state should only be // used internally by the order manager, i.e. it should never appear // in externally visible orders. ORDER_STATUS_INACTIVE = 0; // The order is currently working, i.e. its algorithm is operating. ORDER_STATUS_WORKING = 1; // The order has completed successfully and accomplished its // goal. This is a terminal state. ORDER_STATUS_COMPLETED = 2; // The order was terminated orderly before it had a chance to // complete. This is a terminal state. ORDER_STATUS_CANCELED = 3; // The order has encountered an unexpected condition from which it // cannot recover. This a terminal state. ORDER_STATUS_ERROR = 4; // The last known state for this order was ORDER_STATUS_WORKING, but // since then the execution gateway has signaled a disconnect. This // is not a terminal state ORDER_STATUS_DISCONNECTED = 5; // The order is initializing. It cannot be modified at this point. ORDER_STATUS_PENDING_WORKING = 6; // The order is invalid and was rejected by Spark (not the // exchange), on creation. This is a terminal state. ORDER_STATUS_REJECTED_BY_SPARK= 7; } enum TimeInForce { TIME_IN_FORCE_UNDEFINED = 0; TIME_IN_FORCE_DAY = 48 [(bts.api.fix_value) = "0"]; TIME_IN_FORCE_GTC = 49 [(bts.api.fix_value) = "1"]; TIME_IN_FORCE_IOC = 51 [(bts.api.fix_value) = "3"]; } enum ManualOrderIndicator { MANUAL_ORDER_INDICATOR_NO = 0 [(bts.api.fix_value) = "N"]; MANUAL_ORDER_INDICATOR_YES = 1 [(bts.api.fix_value) = "Y"]; } enum CustomerOrFirm { CUSTOMER_OR_FIRM_CUSTOMER = 0 [(bts.api.fix_value) = "0"]; CUSTOMER_OR_FIRM_FIRM = 1 [(bts.api.fix_value) = "1"]; } enum CTICode { CTI_CODE_UNDEFINED = 0; CTI_CODE_CTI_CODE1 = 49 [(bts.api.fix_value) = "1"]; CTI_CODE_CTI_CODE2 = 50 [(bts.api.fix_value) = "2"]; CTI_CODE_CTI_CODE3 = 51 [(bts.api.fix_value) = "3"]; CTI_CODE_CTI_CODE4 = 52 [(bts.api.fix_value) = "4"]; } enum SelfMatchPreventionInstruction { SELF_MATCH_PREVENTION_INSTRUCTION_UNDEFINED = 0; SELF_MATCH_PREVENTION_INSTRUCTION_CANCEL_RESTING = 79; SELF_MATCH_PREVENTION_INSTRUCTION_CANCEL_AGRESSING = 78; } enum NativeOrderStatus { NATIVE_ORDER_STATUS_UNACKNOWLEDGED = 0; NATIVE_ORDER_STATUS_NEW = 48 [(bts.api.fix_value) = "0"]; NATIVE_ORDER_STATUS_PARTIALLY_FILLED = 49 [(bts.api.fix_value) = "1"]; NATIVE_ORDER_STATUS_FILLED = 50 [(bts.api.fix_value) = "2"]; NATIVE_ORDER_STATUS_DONE = 51 [(bts.api.fix_value) = "3"]; NATIVE_ORDER_STATUS_CANCELED = 52 [(bts.api.fix_value) = "4"]; NATIVE_ORDER_STATUS_REPLACED = 53 [(bts.api.fix_value) = "5"]; NATIVE_ORDER_STATUS_PENDING_CANCEL = 54 [(bts.api.fix_value) = "6"]; NATIVE_ORDER_STATUS_STOPPED = 55 [(bts.api.fix_value) = "7"]; NATIVE_ORDER_STATUS_REJECTED = 56 [(bts.api.fix_value) = "8"]; NATIVE_ORDER_STATUS_SUSPENDED = 57 [(bts.api.fix_value) = "9"]; NATIVE_ORDER_STATUS_PENDING_NEW = 65 [(bts.api.fix_value) = "A"]; NATIVE_ORDER_STATUS_CALCULATED = 66 [(bts.api.fix_value) = "B"]; NATIVE_ORDER_STATUS_EXPIRED = 67 [(bts.api.fix_value) = "C"]; NATIVE_ORDER_STATUS_ACCEPTED_FOR_BIDDING = 68 [(bts.api.fix_value) = "D"]; NATIVE_ORDER_STATUS_PENDING_REPLACE = 69 [(bts.api.fix_value) = "E"]; NATIVE_ORDER_STATUS_CANCEL_ACK = 72 [(bts.api.fix_value) = "H"]; NATIVE_ORDER_STATUS_UNDEFINED = 85 [(bts.api.fix_value) = "U"]; NATIVE_ORDER_STATUS_ORDER_NOT_FOUND = 89 [(bts.api.fix_value) = "Y"]; } enum NativeOrderType { NATIVE_ORDER_TYPE_UNDEFINED = 0 ; NATIVE_ORDER_TYPE_MARKET = 49 [(bts.api.fix_value) = "1"]; NATIVE_ORDER_TYPE_LIMIT = 50 [(bts.api.fix_value) = "2"]; NATIVE_ORDER_TYPE_STOP = 51 [(bts.api.fix_value) = "3"]; NATIVE_ORDER_TYPE_STOP_LIMIT = 52 [(bts.api.fix_value) = "4"]; NATIVE_ORDER_TYPE_MARKET_LIMIT = 75 [(bts.api.fix_value) = "K"]; } enum ExecType { EXEC_TYPE_UNDEFINED = 0 ; EXEC_TYPE_NEW = 48 [(bts.api.fix_value) = "0"]; EXEC_TYPE_PARTIAL_FILL = 49 [(bts.api.fix_value) = "1"]; EXEC_TYPE_FILL = 50 [(bts.api.fix_value) = "2"]; EXEC_TYPE_DONE = 51 [(bts.api.fix_value) = "3"]; EXEC_TYPE_CANCELED = 52 [(bts.api.fix_value) = "4"]; EXEC_TYPE_REPLACED = 53 [(bts.api.fix_value) = "5"]; EXEC_TYPE_PENDING_CANCEL = 54 [(bts.api.fix_value) = "6"]; EXEC_TYPE_STOPPED = 55 [(bts.api.fix_value) = "7"]; EXEC_TYPE_REJECTED = 56 [(bts.api.fix_value) = "8"]; EXEC_TYPE_SUSPENDED = 57 [(bts.api.fix_value) = "9"]; EXEC_TYPE_PENDING_NEW = 65 [(bts.api.fix_value) = "A"]; EXEC_TYPE_CALCULATED = 66 [(bts.api.fix_value) = "B"]; EXEC_TYPE_EXPIRED = 67 [(bts.api.fix_value) = "C"]; EXEC_TYPE_RESTATED = 68 [(bts.api.fix_value) = "D"]; EXEC_TYPE_PENDING_REPLACE = 69 [(bts.api.fix_value) = "E"]; EXEC_TYPE_TRADE_CORRECT = 71 [(bts.api.fix_value) = "G"]; EXEC_TYPE_TRADE_CANCEL = 72 [(bts.api.fix_value) = "H"]; } enum OrderError { ORDER_ERROR_UNDEFINED = 0; ORDER_ERROR_UNSUPPORTED_ORDER_TYPE = 1; ORDER_ERROR_GATEWAY_NOT_READY = 2; ORDER_ERROR_UNKNOWN_ORDER = 5 ; ORDER_ERROR_UNKNOWN_SECURITY = 6; ORDER_ERROR_ORDER_NOT_ACK = 7; ORDER_ERROR_SERVER_NOT_READY = 8; ORDER_ERROR_OK = 9; ORDER_ERROR_OP_NOT_SUPPORTED = 10; ORDER_ERROR_INVALID_OP = 11; ORDER_ERROR_LIMIT_BREACH = 12; ORDER_ERROR_MESSAGING_LIMIT_BREACH = 13; ORDER_ERROR_UNAUTHORIZED = 14; ORDER_ERROR_INVALID_ORDER_DEFINITON = 15; ORDER_ERROR_UNEXPECTED_CHILD_STATE = 16; ORDER_ERROR_INVALID_PARAMETER = 17; } // Trigger Condition ///////////////////////////////// ////////////////////////////////////////////////////// enum TriggerType{ STOP = 0; INVERSE_STOP = 1; } // this is the maket the trigger order // watches for the trigger condition enum TriggerPriceType{ BID = 0; ASK = 1; LAST_TRADE_PRICE = 2; //unused->assert } message TriggerQuantity{ spark.QuantityMeasure quantity_measure = 10; uint32 threshold_quantity = 20; } message AbsolutePriceTrigger{ // we can leave out qty for now TriggerQuantity trigger_quantity = 10; //unused } message TrailingTrigger{ TriggerType trigger_type = 10; int32 number_of_ticks = 20; } message TriggerCondition{ TriggerPriceType price_type = 10; oneof trigger{ AbsolutePriceTrigger absolute_price_trigger = 20; TrailingTrigger trailing_trigger = 30; //unused } } // Trigger Action //////////////////////////////////// ////////////////////////////////////////////////////// // if TriggerAction.orderprice is payup // then the payup price will be calc'ed // with respect to this price message TriggerPayupPrice{ enum TriggerPayupPriceType{ BID = 0; ASK = 1; LAST_TRADE_PRICE = 2; //unused TRIGGER=3; } TriggerPriceType price_type = 10; // defunct TriggerPayupPriceType payup_price_type = 15; int32 payup_ticks = 20; } message TriggerAction{ uint32 security_id = 10; //unused oneof orderprice{ TriggerPayupPrice payup = 20; double price = 30; } } // Trigger Exit Condition //////////////////////////// ////////////////////////////////////////////////////// message TriggerExitCondition{ bool timeout_enabled = 10; uint32 timeout_seconds=20; //seconds bool conditional_cancel=30; } // Dynamic Orders enum DynamicOrderPrimitiveDescriptor { DYNAMIC_ORDER_PRIMITIVE_INT = 0; DYNAMIC_ORDER_PRIMITIVE_UINT = 1; DYNAMIC_ORDER_PRIMITIVE_DOUBLE = 2; DYNAMIC_ORDER_PRIMITIVE_STRING = 3; DYNAMIC_ORDER_PRIMITIVE_BOOL = 4; DYNAMIC_ORDER_PRIMITIVE_ORDER_DEF = 5; DYNAMIC_ORDER_PRIMITIVE_QUANTITY = 6; DYNAMIC_ORDER_PRIMITIVE_SECURITY_KEY = 7; } message DynamicOrderTypeDescriptor { oneof descriptor { DynamicOrderPrimitiveDescriptor primitive = 2; DynamicOrderArrayDescriptor array = 3; DynamicOrderStructDescriptor structure = 4; DynamicOrderEnumeratedDescriptor enumerated = 5; } } message DynamicOrderArrayDescriptor { DynamicOrderTypeDescriptor element_type = 1; } message DynamicOrderParamDescriptor { string param_name = 1; DynamicOrderTypeDescriptor param_type = 2; } message DynamicOrderStructDescriptor { repeated DynamicOrderParamDescriptor field = 1; } message DynamicOrderEnumeratedDescriptor { repeated string element = 1; } message DynamicOrderDescriptor { string dynamic_order_type = 1; repeated DynamicOrderParamDescriptor param_desc = 3; } message RegisteredDynamicOrderTypes { repeated DynamicOrderDescriptor dynamic_order_desc = 1; } message DynamicOrderParam { oneof value { uint32 as_int32 = 1; uint32 as_uint32 = 2; double as_double = 3; string as_string = 4; bool as_bool = 5; CustomOrderDefinition as_order_def = 6; DynamicOrderArray as_array = 7; DynamicOrderStruct as_struct = 8; DynamicOrderEnumerated as_enumerated = 9; spark.QuantityMeasure as_quantity = 10; } } message DynamicOrderArray { repeated DynamicOrderParam element = 1; } message DynamicOrderStruct { map field = 1; } message DynamicOrderEnumerated { string enum_value = 1; } message FIXAlgoDefinition { string name = 1 [(bts.api.fix_tag) = 6401]; CustomOrderDefinition definition = 2; } message FIXAlgoDefinitions { repeated FIXAlgoDefinition algo_strategy = 1; }