From 412b9aaed621cf7d20c3a51683dbbbfc6c2c75ba Mon Sep 17 00:00:00 2001 From: Osita Okonkwo Date: Tue, 19 Nov 2024 13:38:41 -0600 Subject: [PATCH 1/3] add definitions for NO_SUCH_ORDER, NO_SUCH_TRADE, NO_SUCH_TRANSACTION --- .../TradeLibrary/Transaction/Definitions.cs | 957 +++++++++--------- 1 file changed, 480 insertions(+), 477 deletions(-) diff --git a/OkonkwoOandaV20/OkonkwoOandaV20/TradeLibrary/Transaction/Definitions.cs b/OkonkwoOandaV20/OkonkwoOandaV20/TradeLibrary/Transaction/Definitions.cs index b307cf9..bdd46be 100644 --- a/OkonkwoOandaV20/OkonkwoOandaV20/TradeLibrary/Transaction/Definitions.cs +++ b/OkonkwoOandaV20/OkonkwoOandaV20/TradeLibrary/Transaction/Definitions.cs @@ -11,30 +11,30 @@ namespace OkonkwoOandaV20.TradeLibrary.Transaction /// public class FundingReason { - /// - /// The client has initiated a funds transfer - /// - public const string ClientFunding = "CLIENT_FUNDING"; + /// + /// The client has initiated a funds transfer + /// + public const string ClientFunding = "CLIENT_FUNDING"; - /// - /// Funds are being transfered between two Accounts. - /// - public const string AccountTransfer = "ACCOUNT_TRANSFER"; + /// + /// Funds are being transfered between two Accounts. + /// + public const string AccountTransfer = "ACCOUNT_TRANSFER"; - /// - /// Funds are being transfered as part of a Division migration - /// - public const string DivisionMigration = "DIVISION_MIGRATION"; + /// + /// Funds are being transfered as part of a Division migration + /// + public const string DivisionMigration = "DIVISION_MIGRATION"; - /// - /// Funds are being transfered as part of a Site migration - /// - public const string SiteMigration = "SITE_MIGRATION"; + /// + /// Funds are being transfered as part of a Site migration + /// + public const string SiteMigration = "SITE_MIGRATION"; - /// - /// Funds are being transfered as part of an Account adjustment - /// - public const string Adjustment = "ADJUSTMENT"; + /// + /// Funds are being transfered as part of an Account adjustment + /// + public const string Adjustment = "ADJUSTMENT"; } /// @@ -45,10 +45,10 @@ public class FundingReason /// public class LiquidityRegenerationSchedule { - /// - /// The steps in the Liquidity Regeneration Schedule - /// - public List steps { get; set; } + /// + /// The steps in the Liquidity Regeneration Schedule + /// + public List steps { get; set; } } /// @@ -58,20 +58,20 @@ public class LiquidityRegenerationSchedule /// public class LiquidityRegenerationScheduleStep { - /// - /// The timestamp of the schedule step. - /// - public DateTime timestamp { get; set; } + /// + /// The timestamp of the schedule step. + /// + public DateTime timestamp { get; set; } - /// - /// The amount of bid liquidity used at this step in the schedule. - /// - public decimal bidLiquidityUsed { get; set; } + /// + /// The amount of bid liquidity used at this step in the schedule. + /// + public decimal bidLiquidityUsed { get; set; } - /// - /// The amount of ask liquidity used at this step in the schedule. - /// - public decimal askLiquidityUsed { get; set; } + /// + /// The amount of ask liquidity used at this step in the schedule. + /// + public decimal askLiquidityUsed { get; set; } } /// @@ -81,21 +81,21 @@ public class LiquidityRegenerationScheduleStep /// public class MarketOrderDelayedTradeClose { - /// - /// The ID of the Trade being closed - /// - public long tradeID { get; set; } + /// + /// The ID of the Trade being closed + /// + public long tradeID { get; set; } - /// - /// The Client ID of the Trade being closed - /// - public string clientTradeID { get; set; } + /// + /// The Client ID of the Trade being closed + /// + public string clientTradeID { get; set; } - /// - /// The Transaction ID of the DelayedTradeClosure transaction to which this - /// Delayed Trade Close belongs to - /// - public long sourceTransactionID { get; set; } + /// + /// The Transaction ID of the DelayedTradeClosure transaction to which this + /// Delayed Trade Close belongs to + /// + public long sourceTransactionID { get; set; } } /// @@ -104,21 +104,21 @@ public class MarketOrderDelayedTradeClose /// public class MarketOrderTradeClose { - /// - /// The ID of the Trade requested to be closed - /// - public long tradeID { get; set; } + /// + /// The ID of the Trade requested to be closed + /// + public long tradeID { get; set; } - /// - /// The client ID of the Trade requested to be closed - /// - public string clientTradeID { get; set; } + /// + /// The client ID of the Trade requested to be closed + /// + public string clientTradeID { get; set; } - /// - /// Indication of how much of the Trade to close. Either “ALL”, or a - /// DecimalNumber reflection a partial close of the Trade. - /// - public string units { get; set; } + /// + /// Indication of how much of the Trade to close. Either “ALL”, or a + /// DecimalNumber reflection a partial close of the Trade. + /// + public string units { get; set; } } /// @@ -127,18 +127,18 @@ public class MarketOrderTradeClose /// public class MarketOrderPositionCloseout { - /// - /// The instrument of the Position being closed out. - /// - public string instrument { get; set; } + /// + /// The instrument of the Position being closed out. + /// + public string instrument { get; set; } - /// - /// Indication of how much of the Position to close. Either “ALL”, or a - /// DecimalNumber reflection a partial close of the Trade. The DecimalNumber - /// must always be positive, and represent a number that doesn’t exceed the - /// absolute size of the Position. - /// - public string units { get; set; } + /// + /// Indication of how much of the Position to close. Either “ALL”, or a + /// DecimalNumber reflection a partial close of the Trade. The DecimalNumber + /// must always be positive, and represent a number that doesn’t exceed the + /// absolute size of the Position. + /// + public string units { get; set; } } /// @@ -147,10 +147,10 @@ public class MarketOrderPositionCloseout /// public class MarketOrderMarginCloseout { - /// - /// The reason the Market Order was created to perform a margin closeout - /// - public string reason { get; set; } + /// + /// The reason the Market Order was created to perform a margin closeout + /// + public string reason { get; set; } } /// @@ -158,16 +158,16 @@ public class MarketOrderMarginCloseout /// public class MarketOrderMarginCloseoutReason { - /// - /// Trade closures resulted from violating OANDA’s margin policy - /// - public const string MarginCheckViolation = "MARGIN_CHECK_VIOLATION"; + /// + /// Trade closures resulted from violating OANDA’s margin policy + /// + public const string MarginCheckViolation = "MARGIN_CHECK_VIOLATION"; - /// - /// Trade closures came from a margin closeout event resulting from regulatory conditions placed on the - /// Account’s margin call - /// - public const string RegulatoryMarginCallViolation = "REGULATORY_MARGIN_CALL_VIOLATION"; + /// + /// Trade closures came from a margin closeout event resulting from regulatory conditions placed on the + /// Account’s margin call + /// + public const string RegulatoryMarginCallViolation = "REGULATORY_MARGIN_CALL_VIOLATION"; } /// @@ -175,15 +175,15 @@ public class MarketOrderMarginCloseoutReason /// public class OpenTradeFinancing { - /// - /// The ID of the Trade that financing is being paid/collected for. - /// - public long tradeID { get; set; } + /// + /// The ID of the Trade that financing is being paid/collected for. + /// + public long tradeID { get; set; } - /// - /// The amount of financing paid/collected for the Trade. - /// - public decimal financing { get; set; } + /// + /// The amount of financing paid/collected for the Trade. + /// + public decimal financing { get; set; } } /// @@ -191,17 +191,17 @@ public class OpenTradeFinancing /// public class OrderFillReason { - public const string LimitOrder = "LIMIT_ORDER"; - public const string StopOrder = "STOP_ORDER"; - public const string MarketIfTouchedOrder = "MARKET_IF_TOUCHED_ORDER"; - public const string TakeProfitOrder = "TAKE_PROFIT_ORDER"; - public const string StopLossOrder = "STOP_LOSS_ORDER"; - public const string TrailingStopLossOrder = "TRALING_STOP_LOSS_ORDER"; - public const string MarketOrder = "MARKET_ORDER"; - public const string MarketOrderTradeClose = "MARKET_ORDER_TRADE_CLOSE"; - public const string MarketOrderPositionCloseout = "MARKET_ORDER_POSITION_CLOSEOUT"; - public const string MarketOrderMarginCloseout = "MARKET_ORDER_MARGIN_CLOSEOUT"; - public const string MarketOrderDelayedClose = "MARKET_ORDER_DELAYED_TRADE_CLOSE"; + public const string LimitOrder = "LIMIT_ORDER"; + public const string StopOrder = "STOP_ORDER"; + public const string MarketIfTouchedOrder = "MARKET_IF_TOUCHED_ORDER"; + public const string TakeProfitOrder = "TAKE_PROFIT_ORDER"; + public const string StopLossOrder = "STOP_LOSS_ORDER"; + public const string TrailingStopLossOrder = "TRALING_STOP_LOSS_ORDER"; + public const string MarketOrder = "MARKET_ORDER"; + public const string MarketOrderTradeClose = "MARKET_ORDER_TRADE_CLOSE"; + public const string MarketOrderPositionCloseout = "MARKET_ORDER_POSITION_CLOSEOUT"; + public const string MarketOrderMarginCloseout = "MARKET_ORDER_MARGIN_CLOSEOUT"; + public const string MarketOrderDelayedClose = "MARKET_ORDER_DELAYED_TRADE_CLOSE"; } /// @@ -209,47 +209,47 @@ public class OrderFillReason /// public class OrderCancelReason { - public const string InternalServerError = "INTERNAL_SERVER_ERROR"; - public const string AccountLocked = "ACCOUNT_LOCKED"; - public const string AccountNewPositionsLocked = "ACCOUNT_NEW_POSITIONS_LOCKED"; - public const string AccountNewOrderCreationLocked = "ACCOUNT_ORDER_CREATION_LOCKED"; - public const string AccountOrderFillLocked = "ACCOUNT_ORDER_FILL_LOCKED"; - public const string ClientRequest = "CLIENT_REQUEST"; - public const string Migration = "MIGRATION"; - public const string MarketHalted = "MARKET_HALTED"; - public const string LinkedTradeClosed = "LINKED_TRADE_CLOSED"; - public const string TimeInForceExpired = "TIME_IN_FORCE_EXPIRED"; - public const string InsufficientMargin = "INSUFFICIENT_MARGIN"; - public const string FifoViolation = "FIFO_VIOLATION"; - public const string BoundsViolation = "BOUNDS_VIOLATION"; - public const string ClientRequestReplaced = "CLIENT_REQUEST_REPLACED"; - public const string InsufficientLiquidity = "INSUFFICIENT_LIQUIDITY"; - public const string TakeProfitOnFillGtdTimestampInPast = "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST"; - public const string TakeProfitOnFillLoss = "TAKE_PROFIT_ON_FILL_LOSS"; - public const string LosingTakeProfit = "LOSING_TAKE_PROFIT"; - public const string StopLossOnFillGtdTimestampInPast = "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST"; - public const string StopLossOnFillLoss = "STOP_LOSS_ON_FILL_LOSS"; - public const string StopLossOnFillPriceDistanceMaximumExceeded = "STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"; - public const string StopLossOnFillRequired = "STOP_LOSS_ON_FILL_REQUIRED"; - public const string StopLossOnFillGuaranteedRequired = "STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED"; - public const string StopLossOnFillGuaranteedNotAllowed = "STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED"; - public const string StopLossOnFillGuaranteedMinimumDistanceNotMet = "STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET"; - public const string StopLossOnFillGuaranteedLevelRestrictionExceeded = "STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED"; - public const string StopLossOnFillGuaranteedHedgingNotAllowed = "STOP_LOSS_ON_FILL_GUARANTEED_HEDGING_NOT_ALLOWED"; - public const string StopLossOnFillTimeInForceInvalid = "STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID"; - public const string StopLossOnFillTriggerConditionInvalid = "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID"; - public const string TakeProfitOnFillPriceDistanceMaximumExceeded = "TAKE_PROFIT_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"; - public const string TrailingStopLossOnFillGtdTimestampInPast = "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST"; - public const string ClientTradeIdAlreadyExists = "CLIENT_TRADE_ID_ALREADY_EXISTS"; - public const string PositionCloseoutFailed = "POSITION_CLOSEOUT_FAILED"; - public const string OpenTradesAllowedExceeded = "OPEN_TRADES_ALLOWED_EXCEEDED"; - public const string PendingOrdersAllowedExceeded = "PENDING_ORDERS_ALLOWED_EXCEEDED"; - public const string TakeProfitOnFillClientOrderIdAlreadyExists = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS"; - public const string StopLossOnFillClientOrderIdAlreadyExists = "STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS"; - public const string TrailingStopLossOnFillClientOrderIdAlreadyExists = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS"; - public const string PositionSizeExceeded = "POSITION_SIZE_EXCEEDED"; - public const string HedgingGsloViolation = "HEDGING_GSLO_VIOLATION"; - public const string AccountPositionValueLimitExceeded = "ACCOUNT_POSITION_VALUE_LIMIT_EXCEEDED"; + public const string InternalServerError = "INTERNAL_SERVER_ERROR"; + public const string AccountLocked = "ACCOUNT_LOCKED"; + public const string AccountNewPositionsLocked = "ACCOUNT_NEW_POSITIONS_LOCKED"; + public const string AccountNewOrderCreationLocked = "ACCOUNT_ORDER_CREATION_LOCKED"; + public const string AccountOrderFillLocked = "ACCOUNT_ORDER_FILL_LOCKED"; + public const string ClientRequest = "CLIENT_REQUEST"; + public const string Migration = "MIGRATION"; + public const string MarketHalted = "MARKET_HALTED"; + public const string LinkedTradeClosed = "LINKED_TRADE_CLOSED"; + public const string TimeInForceExpired = "TIME_IN_FORCE_EXPIRED"; + public const string InsufficientMargin = "INSUFFICIENT_MARGIN"; + public const string FifoViolation = "FIFO_VIOLATION"; + public const string BoundsViolation = "BOUNDS_VIOLATION"; + public const string ClientRequestReplaced = "CLIENT_REQUEST_REPLACED"; + public const string InsufficientLiquidity = "INSUFFICIENT_LIQUIDITY"; + public const string TakeProfitOnFillGtdTimestampInPast = "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST"; + public const string TakeProfitOnFillLoss = "TAKE_PROFIT_ON_FILL_LOSS"; + public const string LosingTakeProfit = "LOSING_TAKE_PROFIT"; + public const string StopLossOnFillGtdTimestampInPast = "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST"; + public const string StopLossOnFillLoss = "STOP_LOSS_ON_FILL_LOSS"; + public const string StopLossOnFillPriceDistanceMaximumExceeded = "STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"; + public const string StopLossOnFillRequired = "STOP_LOSS_ON_FILL_REQUIRED"; + public const string StopLossOnFillGuaranteedRequired = "STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED"; + public const string StopLossOnFillGuaranteedNotAllowed = "STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED"; + public const string StopLossOnFillGuaranteedMinimumDistanceNotMet = "STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET"; + public const string StopLossOnFillGuaranteedLevelRestrictionExceeded = "STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED"; + public const string StopLossOnFillGuaranteedHedgingNotAllowed = "STOP_LOSS_ON_FILL_GUARANTEED_HEDGING_NOT_ALLOWED"; + public const string StopLossOnFillTimeInForceInvalid = "STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID"; + public const string StopLossOnFillTriggerConditionInvalid = "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID"; + public const string TakeProfitOnFillPriceDistanceMaximumExceeded = "TAKE_PROFIT_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"; + public const string TrailingStopLossOnFillGtdTimestampInPast = "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST"; + public const string ClientTradeIdAlreadyExists = "CLIENT_TRADE_ID_ALREADY_EXISTS"; + public const string PositionCloseoutFailed = "POSITION_CLOSEOUT_FAILED"; + public const string OpenTradesAllowedExceeded = "OPEN_TRADES_ALLOWED_EXCEEDED"; + public const string PendingOrdersAllowedExceeded = "PENDING_ORDERS_ALLOWED_EXCEEDED"; + public const string TakeProfitOnFillClientOrderIdAlreadyExists = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS"; + public const string StopLossOnFillClientOrderIdAlreadyExists = "STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS"; + public const string TrailingStopLossOnFillClientOrderIdAlreadyExists = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS"; + public const string PositionSizeExceeded = "POSITION_SIZE_EXCEEDED"; + public const string HedgingGsloViolation = "HEDGING_GSLO_VIOLATION"; + public const string AccountPositionValueLimitExceeded = "ACCOUNT_POSITION_VALUE_LIMIT_EXCEEDED"; } /// @@ -257,20 +257,20 @@ public class OrderCancelReason /// public class PositionFinancing { - /// - /// The instrument of the Position that financing is being paid/collected - /// - public string instrument { get; set; } + /// + /// The instrument of the Position that financing is being paid/collected + /// + public string instrument { get; set; } - /// - /// The amount of financing paid/collected for the Position. - /// - public decimal financing { get; set; } + /// + /// The amount of financing paid/collected for the Position. + /// + public decimal financing { get; set; } - /// - /// The financing paid/collected for each open Trade within the Position. - /// - public List openTradeFinancings { get; set; } + /// + /// The financing paid/collected for each open Trade within the Position. + /// + public List openTradeFinancings { get; set; } } /// @@ -280,17 +280,17 @@ public class PositionFinancing /// public class TradeOpen : TradeAction { - /// - /// The client extensions for the newly opened Trade - /// - public ClientExtensions clientExtensions { get; set; } + /// + /// The client extensions for the newly opened Trade + /// + public ClientExtensions clientExtensions { get; set; } - /// - /// The margin required at the time the Trade was created. Note, this is the - /// ‘pure’ margin required, it is not the ‘effective’ margin used that - /// factors in the trade risk if a GSLO is attached to the trade. - /// - public decimal initialMarginRequired { get; set; } + /// + /// The margin required at the time the Trade was created. Note, this is the + /// ‘pure’ margin required, it is not the ‘effective’ margin used that + /// factors in the trade risk if a GSLO is attached to the trade. + /// + public decimal initialMarginRequired { get; set; } } /// @@ -300,179 +300,179 @@ public class TradeOpen : TradeAction /// public class TradeReduce : TradeAction { - /// - /// The client Id for the Trade. - /// This is the same as the id in the clientExtensions (if provided) for the opened Trade. - /// - public string clientTradeID { get; set; } + /// + /// The client Id for the Trade. + /// This is the same as the id in the clientExtensions (if provided) for the opened Trade. + /// + public string clientTradeID { get; set; } - /// - /// The PL realized when reducing the Trade - /// - public decimal realizedPL { get; set; } + /// + /// The PL realized when reducing the Trade + /// + public decimal realizedPL { get; set; } - /// - /// The financing paid/collected when reducing the Trade - /// - public decimal financing { get; set; } + /// + /// The financing paid/collected when reducing the Trade + /// + public decimal financing { get; set; } } public abstract class TradeAction { - /// - /// The ID of the Trade targeted by the action. - /// - public long tradeID { get; set; } + /// + /// The ID of the Trade targeted by the action. + /// + public long tradeID { get; set; } - /// - /// The number of units transacted during the action. - /// - public decimal units { get; set; } + /// + /// The number of units transacted during the action. + /// + public decimal units { get; set; } - /// - /// The overall price used for the trade action. - /// - public decimal price { get; set; } + /// + /// The overall price used for the trade action. + /// + public decimal price { get; set; } - /// - /// This is the fee charged (if the trade action is a TradeOpen) for opening the trade if it has a guaranteed Stop - /// Loss Order attached to it. - /// - public decimal? guaranteedExecutionFee { get; set; } + /// + /// This is the fee charged (if the trade action is a TradeOpen) for opening the trade if it has a guaranteed Stop + /// Loss Order attached to it. + /// + public decimal? guaranteedExecutionFee { get; set; } - /// - /// The half spread cost (if the trade action is a TradeOpen). This can be a positive or - /// negative value and is represented in the home currency of the Account. - /// - public decimal? halfSpreadCost { get; set; } + /// + /// The half spread cost (if the trade action is a TradeOpen). This can be a positive or + /// negative value and is represented in the home currency of the Account. + /// + public decimal? halfSpreadCost { get; set; } } #region price object [JsonConverter(typeof(PriceObjectConverter))] public class TakeProfitDetails : PriceObject { - public TakeProfitDetails() { } - public TakeProfitDetails(Instrument.Instrument instrument) - { - priceInformation = new PriceInformation() - { - instrument = instrument, - priceProperties = new List() { nameof(price) } - }; - } + public TakeProfitDetails() { } + public TakeProfitDetails(Instrument.Instrument instrument) + { + priceInformation = new PriceInformation() + { + instrument = instrument, + priceProperties = new List() { nameof(price) } + }; + } - /// - /// The price that the Take Profit Order will be triggered at. - /// - public decimal price { get; set; } + /// + /// The price that the Take Profit Order will be triggered at. + /// + public decimal price { get; set; } } [JsonConverter(typeof(PriceObjectConverter))] public class StopLossDetails : PriceObject { - public StopLossDetails() { } - public StopLossDetails(Instrument.Instrument instrument) - { - priceInformation = new PriceInformation() - { - instrument = instrument, - priceProperties = new List() { nameof(price), nameof(distance) } - }; - } - - /// - /// The price that the Stop Loss Order will be triggered at. Only one of the - /// price and distance fields may be specified. - /// - public decimal? price { get; set; } - - /// - /// Specifies the distance (in price units) from the Trade’s open price to - /// use as the Stop Loss Order price. Only one of the distance and price - /// fields may be specified. - /// - public decimal? distance { get; set; } - - /// - /// Flag indicating that the price for the Stop Loss Order is guaranteed. The - /// default value depends on the GuaranteedStopLossOrderMode of the account, - /// if it is REQUIRED, the default will be true, for DISABLED or ENABLED the - /// default is false. - /// - public bool guaranteed { get; set; } + public StopLossDetails() { } + public StopLossDetails(Instrument.Instrument instrument) + { + priceInformation = new PriceInformation() + { + instrument = instrument, + priceProperties = new List() { nameof(price), nameof(distance) } + }; + } + + /// + /// The price that the Stop Loss Order will be triggered at. Only one of the + /// price and distance fields may be specified. + /// + public decimal? price { get; set; } + + /// + /// Specifies the distance (in price units) from the Trade’s open price to + /// use as the Stop Loss Order price. Only one of the distance and price + /// fields may be specified. + /// + public decimal? distance { get; set; } + + /// + /// Flag indicating that the price for the Stop Loss Order is guaranteed. The + /// default value depends on the GuaranteedStopLossOrderMode of the account, + /// if it is REQUIRED, the default will be true, for DISABLED or ENABLED the + /// default is false. + /// + public bool guaranteed { get; set; } } [JsonConverter(typeof(PriceObjectConverter))] public class TrailingStopLossDetails : PriceObject { - public TrailingStopLossDetails() { } - public TrailingStopLossDetails(Instrument.Instrument instrument) - { - priceInformation = new PriceInformation() - { - instrument = instrument, - priceProperties = new List() { nameof(distance) } - }; - } + public TrailingStopLossDetails() { } + public TrailingStopLossDetails(Instrument.Instrument instrument) + { + priceInformation = new PriceInformation() + { + instrument = instrument, + priceProperties = new List() { nameof(distance) } + }; + } - /// - /// The distance (in price units) from the Trade’s fill price that the - /// Trailing Stop Loss Order will be triggered at. - /// - public decimal distance { get; set; } + /// + /// The distance (in price units) from the Trade’s fill price that the + /// Trailing Stop Loss Order will be triggered at. + /// + public decimal distance { get; set; } } public abstract class PriceObject : IHasPrices { - /// - /// The time in force for the created Order. This may only - /// be GTC, GTD or GFD. - /// - public string timeInForce { get; set; } - - /// - /// The date when the Trailing Stop Loss Order will be cancelled on if - /// timeInForce is GTD. - /// - public DateTime? gtdTime { get; set; } - - /// - /// The Client Extensions to add to the Trailing Stop Loss Order when - /// created. - /// - public ClientExtensions clientExtensions { get; set; } - - /// - /// - /// - [JsonIgnore] - public PriceInformation priceInformation { get; set; } + /// + /// The time in force for the created Order. This may only + /// be GTC, GTD or GFD. + /// + public string timeInForce { get; set; } + + /// + /// The date when the Trailing Stop Loss Order will be cancelled on if + /// timeInForce is GTD. + /// + public DateTime? gtdTime { get; set; } + + /// + /// The Client Extensions to add to the Trailing Stop Loss Order when + /// created. + /// + public ClientExtensions clientExtensions { get; set; } + + /// + /// + /// + [JsonIgnore] + public PriceInformation priceInformation { get; set; } } #endregion #region order reasons public abstract class OrderReason { - public const string ClientOrder = "CLIENT_ORDER"; + public const string ClientOrder = "CLIENT_ORDER"; } public class MarketOrderReason : OrderReason { - public const string TradeClose = "TRADE_CLOSE"; - public const string PositionCloseout = "POSITION_CLOSEOUT"; - public const string MarginCloseout = "MARGIN_CLOSEOUT"; - public const string DelayedTradeClose = "DELAYED_TRADE_CLOSE"; + public const string TradeClose = "TRADE_CLOSE"; + public const string PositionCloseout = "POSITION_CLOSEOUT"; + public const string MarginCloseout = "MARGIN_CLOSEOUT"; + public const string DelayedTradeClose = "DELAYED_TRADE_CLOSE"; } public class FixedPriceOrderReason { - public const string PlatformAccountMigration = "PLATFORM_ACCOUNT_MIGRATION"; + public const string PlatformAccountMigration = "PLATFORM_ACCOUNT_MIGRATION"; } #region entry order reasons public abstract class EntryOrderReason : OrderReason { - public const string Replacement = "REPLACEMENT"; + public const string Replacement = "REPLACEMENT"; } public class LimitOrderReason : EntryOrderReason @@ -491,8 +491,8 @@ public class StopOrderReason : EntryOrderReason #region exit order reasons public abstract class ExitOrderReason : OrderReason { - public const string Replacement = "REPLACEMENT"; - public const string OnFill = "ON_FILL"; + public const string Replacement = "REPLACEMENT"; + public const string OnFill = "ON_FILL"; } public class TakeProfitOrderReason : ExitOrderReason @@ -515,148 +515,151 @@ public class TrailingStopLossOrderReason : ExitOrderReason /// public class TransactionRejectReason { - public const string InternalServerError = "INTERNAL_SERVER_ERROR"; - public const string InstrumentPriceUnknown = "INTERNAL_SERVER_ERROR"; - public const string AccountNotActive = "INTERNAL_SERVER_ERROR"; - public const string AccountLocked = "INTERNAL_SERVER_ERROR"; - public const string AccountOrderCreationLocked = "INTERNAL_SERVER_ERROR"; - public const string AccountConfigurationLocked = "INTERNAL_SERVER_ERROR"; - public const string AccountDepositLocked = "INTERNAL_SERVER_ERROR"; - public const string AccountWithdrawalLocked = "INTERNAL_SERVER_ERROR"; - public const string AccountOrderCancelLocked = "INTERNAL_SERVER_ERROR"; - public const string InstrumentNotTradeable = "INTERNAL_SERVER_ERROR"; - public const string PendingOrdersAllowedExceeded = "INTERNAL_SERVER_ERROR"; - public const string OrderIdUnspecified = "ORDER_ID_UNSPECIFIED"; - public const string OrderDoesntExist = "ORDER_DOESNT_EXIST"; - public const string OrderIdentifierInconsistency = "ORDER_IDENTIFIER_INCONSISTENCY"; - public const string TradeIdUnspecified = "TRADE_ID_UNSPECIFIED"; - public const string TradeDoesntExist = "TRADE_DOESNT_EXIST"; - public const string TradeIdentifierInconsistency = "TRADE_IDENTIFIER_INCONSISTENCY"; - public const string InstrumentMissing = "INSTRUMENT_MISSING"; - public const string InstrumentUnknown = "INSTRUMENT_UNKNOWN"; - public const string UnitsMissing = "UNITS_MISSING"; - public const string UnitsInvalid = "UNITS_INVALID"; - public const string UnitsPrecisionExceeded = "UNITS_PRECISION_EXCEEDED"; - public const string UnitsLimitExceeded = "UNITS_LIMIT_EXCEEDED"; - public const string UnitsMinimumNotMet = "UNITS_MIMIMUM_NOT_MET"; - public const string PriceMissing = "PRICE_MISSING"; - public const string PriceInvalid = "PRICE_INVALID"; - public const string PricePrecisionExceeded = "PRICE_PRECISION_EXCEEDED"; - public const string PriceDistanceMissing = "PRICE_DISTANCE_MISSING"; - public const string PriceDistanceInvalid = "PRICE_DISTANCE_INVALID"; - public const string PriceDistancePrecisionExceeded = "PRICE_DISTANCE_PRECISION_EXCEEDED"; - public const string PriceDistanceMaximumExceeded = "PRICE_DISTANCE_MAXIMUM_EXCEEDED"; - public const string PriceDistanceMinimumNotMet = "PRICE_DISTANCE_MINIMUM_NOT_MET"; - public const string TimeInForceMissing = "TIME_IN_FORCE_MISSING"; - public const string TimeInForceInvalid = "TIME_IN_FORCE_INVALID"; - public const string TimeInForceGtdTimestampMissing = "TIME_IN_FORCE_GTD_TIMESTAMP_MISSING"; - public const string TimeInForceGtdTimestampInPast = "TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST"; - public const string PriceBoundInvalid = "PRICE_BOUND_INVALID"; - public const string PriceBoundPrecisionExceeded = "PRICE_BOUND_PRECISION_EXCEEDED"; - public const string OrdersOnFillDuplicateClientOrderIDs = "ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS"; - public const string TradeOnFillClientExtensionsNotSupported = "TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED"; - public const string ClientOrderIdInvalid = "CLIENT_ORDER_ID_INVALID"; - public const string ClientOrderIdAlreadyExists = "CLIENT_ORDER_ID_ALREADY_EXISTS"; - public const string ClientOrderTagInvalid = "CLIENT_ORDER_TAG_INVALID"; - public const string ClientOrderCommentInvalid = "CLIENT_ORDER_COMMENT_INVALID"; - public const string ClientTradeIdInvalid = "CLIENT_TRADE_ID_INVALID"; - public const string ClientTradeIdAlreadyExists = "CLIENT_TRADE_ID_ALREADY_EXISTS"; - public const string ClientTradeTagInvalid = "CLIENT_TRADE_TAG_INVALID"; - public const string ClientTradeCommentInvalid = "CLIENT_TRADE_COMMENT_INVALID"; - public const string OrderFillPositionActionMissing = "ORDER_FILL_POSITION_ACTION_MISSING"; - public const string OrderFillPositionActionInvalid = "ORDER_FILL_POSITION_ACTION_INVALID"; - public const string TriggerConditionMissing = "TRIGGER_CONDITION_MISSING"; - public const string TriggerConditionInvalid = "TRIGGER_CONDITION_INVALID"; - public const string OrderPartialFillOptionMissing = "ORDER_PARTIAL_FILL_OPTION_MISSING"; - public const string OrderPartialFillOptionInvalid = "ORDER_PARTIAL_FILL_OPTION_INVALID"; - public const string InvalidReissueImmediatePartialFill = "INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL"; - public const string TakeProfitOrderAlreadyExists = "TAKE_PROFIT_ORDER_ALREADY_EXISTS"; - public const string TakeProfitOnFillPriceMissing = "TAKE_PROFIT_ON_FILL_PRICE_MISSING"; - public const string TakeProfitOnFillPriceInvalid = "TAKE_PROFIT_ON_FILL_PRICE_INVALID"; - public const string TakeProfitOnFillPricePrecisionExceeded = "TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED"; - public const string TakeProfitOnFillTimeInForceMissing = "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING"; - public const string TakeProfitOnFillTimeInForceInvalid = "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID"; - public const string TakeProfitOnFillGtdTimestampMissing = "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING"; - public const string TakeProfitOnFillGtdTimestampInPast = "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST"; - public const string TakeProfitOnFillClientOrderIdInvalid = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID"; - public const string TakeProfitOnFillClientOrderTagInvalid = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID"; - public const string TakeProfitOnFillClientOrderCommentInvalid = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID"; - public const string TakeProfitOnFillTriggerConditionMissing = "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING"; - public const string TakeProfitOnFillTriggerConditionInvalid = "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID"; - public const string StopLossOrderAlreadyExists = "STOP_LOSS_ORDER_ALREADY_EXISTS"; - public const string StopLossOrderGuaranteedRequired = "STOP_LOSS_ORDER_GUARANTEED_REQUIRED"; - public const string StopLossOrderGuaranteedPriceWithinSpread = "STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD"; - public const string StopLossOrderGuaranteedNotAllowed = "STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED"; - public const string StopLossOrderGuaranteedHaltedCreateViolation = "STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION"; - public const string StopLossOrderGuaranteedHaltedTightenViolation = "STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION"; - public const string StopLossOrderGuaranteedHedgingNotAllowed = "STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED"; - public const string StopLossOrderGuaranteedMinimumDistanceNotMet = "STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET"; - public const string StopLossOrderNotCancelable = "STOP_LOSS_ORDER_NOT_CANCELABLE"; - public const string StopLossOrderNotReplaceable = "STOP_LOSS_ORDER_NOT_REPLACEABLE"; - public const string StopLossOrderGuaranteedLevelRestrictionExceeded = "STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED"; - public const string StopLossOrderPriceAndDistanceBothSpecified = "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED"; - public const string StopLossOrderPriceAndDistanceBothMissing = "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING"; - public const string StopLossOnFillRequiredForPendingOrder = "STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER"; - public const string StopLossOnFillGuaranteedNotAllowed = "STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED"; - public const string StopLossOnFillGuaranteedRequired = "STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED"; - public const string StopLossOnFillPriceMissing = "STOP_LOSS_ON_FILL_PRICE_MISSING"; - public const string StopLossOnFillPriceInvalid = "STOP_LOSS_ON_FILL_PRICE_INVALID"; - public const string StopLossOnFillPricePrecisionExceeded = "STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED"; - public const string StopLossOnFillGuaranteedMinimumDistanceNotMet = "STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET"; - public const string StopLossOnFillGuaranteedLevelRestrictionExceeded = "STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED"; - public const string StopLossOnFillDistanceInvalid = "STOP_LOSS_ON_FILL_DISTANCE_INVALID"; - public const string StopLossOnFillPriceDistanceMaximumExceeded = "STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"; - public const string StopLossOnFillDistancePrecisionExceeded = "STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED"; - public const string StopLossOnFillPriceAndDistanceBothSpecified = "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED"; - public const string StopLossOnFillPriceAndDistanceBothMissing = "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING"; - public const string StopLossOnFillTimeInForceMissing = "STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING"; - public const string StopLossOnFillTimeInForceInvalid = "STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID"; - public const string StopLossOnFillGtdTimestampMissing = "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING"; - public const string StopLossOnFillGtdTimestampInPast = "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST"; - public const string StopLossOnFillClientOrderIdInvalid = "STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID"; - public const string StopLossOnFillClientOrderTagInvalid = "STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID"; - public const string StopLossOnFillClientOrderCommentInvalid = "STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID"; - public const string StopLossOnFillTriggerConditionMissing = "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING"; - public const string StopLossOnFillTriggerConditionInvalid = "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID"; - public const string TrailingStopLossOrderAlreadyExists = "TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS"; - public const string TrailingStopLossOnFillPriceDistanceMissing = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING"; - public const string TrailingStopLossOnFillPriceDistanceInvalid = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID"; - public const string TrailingStopLossOnFillPriceDistancePrecisionExceeded = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED"; - public const string TrailingStopLossOnFillPriceDistanceMaximumExceeded = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"; - public const string TrailingStopLossOnFillPriceDistanceMinimumNotMet = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET"; - public const string TrailingStopLossOnFillTimeInForceMissing = "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING"; - public const string TrailingStopLossOnFillTimeInForceInvalid = "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID"; - public const string TrailingStopLossOnFillGtdTimestampMissing = "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING"; - public const string TrailingStopLossOnFillGtdTimestampInPast = "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST"; - public const string TrailingStopLossOnFillClientOrderIdInvalid = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID"; - public const string TrailingStopLossOnFillClientOrderTagInvalid = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID"; - public const string TrailingStopLossOnFillClientOrderCommentInvalid = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID"; - public const string TrailingStopLossOrdersNotSupported = "TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED"; - public const string TrailingStopLossOnFillTriggerConditionMissing = "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING"; - public const string TrailingStopLossOnFillTriggerConditionInvalid = "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID"; - public const string CloseTradeTypeMissing = "CLOSE_TRADE_TYPE_MISSING"; - public const string CloseTradePartialUnitsMissing = "CLOSE_TRADE_PARTIAL_UNITS_MISSING"; - public const string CloseTradeUnitsExceedTradeSize = "CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE"; - public const string CloseoutPositionDoesntExist = "CLOSEOUT_POSITION_DOESNT_EXIST"; - public const string CloseoutPositionIncompleteSpecification = "CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION"; - public const string CloseoutPositionUnitsExceedPositionSize = "CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE"; - public const string CloseoutPositionReject = "CLOSEOUT_POSITION_REJECT"; - public const string CloseoutPositionPartialUnitsMissing = "CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING"; - public const string MarkupGroupIdInvalid = "MARKUP_GROUP_ID_INVALID"; - public const string PositionAggregationModeInvalid = "POSITION_AGGREGATION_MODE_INVALID"; - public const string AdminConfigureDataMissing = "ADMIN_CONFIGURE_DATA_MISSING"; - public const string MarginRateInvalid = "MARGIN_RATE_INVALID"; - public const string MarginRateWouldTriggerCloseout = "MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT"; - public const string AliasInvalid = "ALIAS_INVALID"; - public const string ClientConfigureDataMissing = "CLIENT_CONFIGURE_DATA_MISSING"; - public const string MarginRateWouldTriggerMarginCall = "MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL"; - public const string AmountInvalid = "AMOUNT_INVALID"; - public const string InsufficientFunds = "INSUFFICIENT_FUNDS"; - public const string AmountMissing = "AMOUNT_MISSING"; - public const string FundingReasonMissing = "FUNDING_REASON_MISSING"; - public const string ClientExtensionsDataMissing = "CLIENT_EXTENSIONS_DATA_MISSING"; - public const string ReplacingOrderInvalid = "REPLACING_ORDER_INVALID"; - public const string ReplacingTradeIdInvalid = "REPLACING_TRADE_ID_INVALID"; + public const string InternalServerError = "INTERNAL_SERVER_ERROR"; + public const string InstrumentPriceUnknown = "INTERNAL_SERVER_ERROR"; + public const string AccountNotActive = "INTERNAL_SERVER_ERROR"; + public const string AccountLocked = "INTERNAL_SERVER_ERROR"; + public const string AccountOrderCreationLocked = "INTERNAL_SERVER_ERROR"; + public const string AccountConfigurationLocked = "INTERNAL_SERVER_ERROR"; + public const string AccountDepositLocked = "INTERNAL_SERVER_ERROR"; + public const string AccountWithdrawalLocked = "INTERNAL_SERVER_ERROR"; + public const string AccountOrderCancelLocked = "INTERNAL_SERVER_ERROR"; + public const string InstrumentNotTradeable = "INTERNAL_SERVER_ERROR"; + public const string PendingOrdersAllowedExceeded = "INTERNAL_SERVER_ERROR"; + public const string OrderIdUnspecified = "ORDER_ID_UNSPECIFIED"; + public const string OrderDoesntExist = "ORDER_DOESNT_EXIST"; + public const string OrderIdentifierInconsistency = "ORDER_IDENTIFIER_INCONSISTENCY"; + public const string TradeIdUnspecified = "TRADE_ID_UNSPECIFIED"; + public const string TradeDoesntExist = "TRADE_DOESNT_EXIST"; + public const string TradeIdentifierInconsistency = "TRADE_IDENTIFIER_INCONSISTENCY"; + public const string InstrumentMissing = "INSTRUMENT_MISSING"; + public const string InstrumentUnknown = "INSTRUMENT_UNKNOWN"; + public const string UnitsMissing = "UNITS_MISSING"; + public const string UnitsInvalid = "UNITS_INVALID"; + public const string UnitsPrecisionExceeded = "UNITS_PRECISION_EXCEEDED"; + public const string UnitsLimitExceeded = "UNITS_LIMIT_EXCEEDED"; + public const string UnitsMinimumNotMet = "UNITS_MIMIMUM_NOT_MET"; + public const string PriceMissing = "PRICE_MISSING"; + public const string PriceInvalid = "PRICE_INVALID"; + public const string PricePrecisionExceeded = "PRICE_PRECISION_EXCEEDED"; + public const string PriceDistanceMissing = "PRICE_DISTANCE_MISSING"; + public const string PriceDistanceInvalid = "PRICE_DISTANCE_INVALID"; + public const string PriceDistancePrecisionExceeded = "PRICE_DISTANCE_PRECISION_EXCEEDED"; + public const string PriceDistanceMaximumExceeded = "PRICE_DISTANCE_MAXIMUM_EXCEEDED"; + public const string PriceDistanceMinimumNotMet = "PRICE_DISTANCE_MINIMUM_NOT_MET"; + public const string TimeInForceMissing = "TIME_IN_FORCE_MISSING"; + public const string TimeInForceInvalid = "TIME_IN_FORCE_INVALID"; + public const string TimeInForceGtdTimestampMissing = "TIME_IN_FORCE_GTD_TIMESTAMP_MISSING"; + public const string TimeInForceGtdTimestampInPast = "TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST"; + public const string PriceBoundInvalid = "PRICE_BOUND_INVALID"; + public const string PriceBoundPrecisionExceeded = "PRICE_BOUND_PRECISION_EXCEEDED"; + public const string OrdersOnFillDuplicateClientOrderIDs = "ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS"; + public const string TradeOnFillClientExtensionsNotSupported = "TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED"; + public const string ClientOrderIdInvalid = "CLIENT_ORDER_ID_INVALID"; + public const string ClientOrderIdAlreadyExists = "CLIENT_ORDER_ID_ALREADY_EXISTS"; + public const string ClientOrderTagInvalid = "CLIENT_ORDER_TAG_INVALID"; + public const string ClientOrderCommentInvalid = "CLIENT_ORDER_COMMENT_INVALID"; + public const string ClientTradeIdInvalid = "CLIENT_TRADE_ID_INVALID"; + public const string ClientTradeIdAlreadyExists = "CLIENT_TRADE_ID_ALREADY_EXISTS"; + public const string ClientTradeTagInvalid = "CLIENT_TRADE_TAG_INVALID"; + public const string ClientTradeCommentInvalid = "CLIENT_TRADE_COMMENT_INVALID"; + public const string OrderFillPositionActionMissing = "ORDER_FILL_POSITION_ACTION_MISSING"; + public const string OrderFillPositionActionInvalid = "ORDER_FILL_POSITION_ACTION_INVALID"; + public const string TriggerConditionMissing = "TRIGGER_CONDITION_MISSING"; + public const string TriggerConditionInvalid = "TRIGGER_CONDITION_INVALID"; + public const string OrderPartialFillOptionMissing = "ORDER_PARTIAL_FILL_OPTION_MISSING"; + public const string OrderPartialFillOptionInvalid = "ORDER_PARTIAL_FILL_OPTION_INVALID"; + public const string InvalidReissueImmediatePartialFill = "INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL"; + public const string TakeProfitOrderAlreadyExists = "TAKE_PROFIT_ORDER_ALREADY_EXISTS"; + public const string TakeProfitOnFillPriceMissing = "TAKE_PROFIT_ON_FILL_PRICE_MISSING"; + public const string TakeProfitOnFillPriceInvalid = "TAKE_PROFIT_ON_FILL_PRICE_INVALID"; + public const string TakeProfitOnFillPricePrecisionExceeded = "TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED"; + public const string TakeProfitOnFillTimeInForceMissing = "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING"; + public const string TakeProfitOnFillTimeInForceInvalid = "TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID"; + public const string TakeProfitOnFillGtdTimestampMissing = "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING"; + public const string TakeProfitOnFillGtdTimestampInPast = "TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST"; + public const string TakeProfitOnFillClientOrderIdInvalid = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID"; + public const string TakeProfitOnFillClientOrderTagInvalid = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID"; + public const string TakeProfitOnFillClientOrderCommentInvalid = "TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID"; + public const string TakeProfitOnFillTriggerConditionMissing = "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING"; + public const string TakeProfitOnFillTriggerConditionInvalid = "TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID"; + public const string StopLossOrderAlreadyExists = "STOP_LOSS_ORDER_ALREADY_EXISTS"; + public const string StopLossOrderGuaranteedRequired = "STOP_LOSS_ORDER_GUARANTEED_REQUIRED"; + public const string StopLossOrderGuaranteedPriceWithinSpread = "STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD"; + public const string StopLossOrderGuaranteedNotAllowed = "STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED"; + public const string StopLossOrderGuaranteedHaltedCreateViolation = "STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION"; + public const string StopLossOrderGuaranteedHaltedTightenViolation = "STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION"; + public const string StopLossOrderGuaranteedHedgingNotAllowed = "STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED"; + public const string StopLossOrderGuaranteedMinimumDistanceNotMet = "STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET"; + public const string StopLossOrderNotCancelable = "STOP_LOSS_ORDER_NOT_CANCELABLE"; + public const string StopLossOrderNotReplaceable = "STOP_LOSS_ORDER_NOT_REPLACEABLE"; + public const string StopLossOrderGuaranteedLevelRestrictionExceeded = "STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED"; + public const string StopLossOrderPriceAndDistanceBothSpecified = "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED"; + public const string StopLossOrderPriceAndDistanceBothMissing = "STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING"; + public const string StopLossOnFillRequiredForPendingOrder = "STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER"; + public const string StopLossOnFillGuaranteedNotAllowed = "STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED"; + public const string StopLossOnFillGuaranteedRequired = "STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED"; + public const string StopLossOnFillPriceMissing = "STOP_LOSS_ON_FILL_PRICE_MISSING"; + public const string StopLossOnFillPriceInvalid = "STOP_LOSS_ON_FILL_PRICE_INVALID"; + public const string StopLossOnFillPricePrecisionExceeded = "STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED"; + public const string StopLossOnFillGuaranteedMinimumDistanceNotMet = "STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET"; + public const string StopLossOnFillGuaranteedLevelRestrictionExceeded = "STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED"; + public const string StopLossOnFillDistanceInvalid = "STOP_LOSS_ON_FILL_DISTANCE_INVALID"; + public const string StopLossOnFillPriceDistanceMaximumExceeded = "STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"; + public const string StopLossOnFillDistancePrecisionExceeded = "STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED"; + public const string StopLossOnFillPriceAndDistanceBothSpecified = "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED"; + public const string StopLossOnFillPriceAndDistanceBothMissing = "STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING"; + public const string StopLossOnFillTimeInForceMissing = "STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING"; + public const string StopLossOnFillTimeInForceInvalid = "STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID"; + public const string StopLossOnFillGtdTimestampMissing = "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING"; + public const string StopLossOnFillGtdTimestampInPast = "STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST"; + public const string StopLossOnFillClientOrderIdInvalid = "STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID"; + public const string StopLossOnFillClientOrderTagInvalid = "STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID"; + public const string StopLossOnFillClientOrderCommentInvalid = "STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID"; + public const string StopLossOnFillTriggerConditionMissing = "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING"; + public const string StopLossOnFillTriggerConditionInvalid = "STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID"; + public const string TrailingStopLossOrderAlreadyExists = "TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS"; + public const string TrailingStopLossOnFillPriceDistanceMissing = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING"; + public const string TrailingStopLossOnFillPriceDistanceInvalid = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID"; + public const string TrailingStopLossOnFillPriceDistancePrecisionExceeded = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED"; + public const string TrailingStopLossOnFillPriceDistanceMaximumExceeded = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED"; + public const string TrailingStopLossOnFillPriceDistanceMinimumNotMet = "TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET"; + public const string TrailingStopLossOnFillTimeInForceMissing = "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING"; + public const string TrailingStopLossOnFillTimeInForceInvalid = "TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID"; + public const string TrailingStopLossOnFillGtdTimestampMissing = "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING"; + public const string TrailingStopLossOnFillGtdTimestampInPast = "TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST"; + public const string TrailingStopLossOnFillClientOrderIdInvalid = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID"; + public const string TrailingStopLossOnFillClientOrderTagInvalid = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID"; + public const string TrailingStopLossOnFillClientOrderCommentInvalid = "TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID"; + public const string TrailingStopLossOrdersNotSupported = "TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED"; + public const string TrailingStopLossOnFillTriggerConditionMissing = "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING"; + public const string TrailingStopLossOnFillTriggerConditionInvalid = "TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID"; + public const string CloseTradeTypeMissing = "CLOSE_TRADE_TYPE_MISSING"; + public const string CloseTradePartialUnitsMissing = "CLOSE_TRADE_PARTIAL_UNITS_MISSING"; + public const string CloseTradeUnitsExceedTradeSize = "CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE"; + public const string CloseoutPositionDoesntExist = "CLOSEOUT_POSITION_DOESNT_EXIST"; + public const string CloseoutPositionIncompleteSpecification = "CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION"; + public const string CloseoutPositionUnitsExceedPositionSize = "CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE"; + public const string CloseoutPositionReject = "CLOSEOUT_POSITION_REJECT"; + public const string CloseoutPositionPartialUnitsMissing = "CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING"; + public const string MarkupGroupIdInvalid = "MARKUP_GROUP_ID_INVALID"; + public const string PositionAggregationModeInvalid = "POSITION_AGGREGATION_MODE_INVALID"; + public const string AdminConfigureDataMissing = "ADMIN_CONFIGURE_DATA_MISSING"; + public const string MarginRateInvalid = "MARGIN_RATE_INVALID"; + public const string MarginRateWouldTriggerCloseout = "MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT"; + public const string AliasInvalid = "ALIAS_INVALID"; + public const string ClientConfigureDataMissing = "CLIENT_CONFIGURE_DATA_MISSING"; + public const string MarginRateWouldTriggerMarginCall = "MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL"; + public const string AmountInvalid = "AMOUNT_INVALID"; + public const string InsufficientFunds = "INSUFFICIENT_FUNDS"; + public const string AmountMissing = "AMOUNT_MISSING"; + public const string FundingReasonMissing = "FUNDING_REASON_MISSING"; + public const string ClientExtensionsDataMissing = "CLIENT_EXTENSIONS_DATA_MISSING"; + public const string ReplacingOrderInvalid = "REPLACING_ORDER_INVALID"; + public const string ReplacingTradeIdInvalid = "REPLACING_TRADE_ID_INVALID"; + public const string NoSuchOrder = "NO_SUCH_ORDER"; + public const string NoSuchTrade = "NO_SUCH_TRADE"; + public const string NoSuchTransaction = "NO_SUCH_TRANSACTION"; } /// @@ -664,41 +667,41 @@ public class TransactionRejectReason /// public class TransactionType { - public const string Create = "CREATE"; - public const string Close = "CLOSE"; - public const string Reopen = "REOPEN"; - public const string ClientConfigure = "CLIENT_CONFIGURE"; - public const string ClientConfigureReject = "CLIENT_CONFIGURE_REJECT"; - public const string TransferFunds = "TRANSFER_FUNDS"; - public const string TransferFundsReject = "TRANSFER_FUNDS_REJECT"; - public const string MarketOrder = "MARKET_ORDER"; - public const string MarketOrderReject = "MARKET_ORDER_REJECT"; - public const string FixedPriceOrder = "FIXED_PRICE_ORDER"; - public const string LimitOrder = "LIMIT_ORDER"; - public const string LimitOrderReject = "LIMIT_ORDER_REJECT"; - public const string StopOrder = "STOP_ORDER"; - public const string StopOrderReject = "STOP_ORDER_REJECT"; - public const string MarketIfTouchedOrder = "MARKET_IF_TOUCHED_ORDER"; - public const string MarketIfTouchedOrderReject = "MARKET_IF_TOUCHED_ORDER_REJECT"; - public const string TakeProfitOrder = "TAKE_PROFIT_ORDER"; - public const string TakeProfitOrderReject = "TAKE_PROFIT_ORDER_REJECT"; - public const string StopLossOrder = "STOP_LOSS_ORDER"; - public const string StopLossOrderReject = "STOP_LOSS_ORDER_REJECT"; - public const string TrailingStopLossOrder = "TRAILING_STOP_LOSS_ORDER"; - public const string TrailingStopLossOrderReject = "TRAILING_STOP_LOSS_ORDER_REJECT"; - public const string OrderFill = "ORDER_FILL"; - public const string OrderCancel = "ORDER_CANCEL"; - public const string OrderCancelReject = "ORDER_CANCEL_REJECT"; - public const string OrderClientExtensionsModify = "ORDER_CLIENT_EXTENSIONS_MODIFY"; - public const string OrderClientExtensionsModifyReject = "ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT"; - public const string TradeClientExtensionsModify = "TRADE_CLIENT_EXTENSIONS_MODIFY"; - public const string TradeClientExtensionsModifyReject = "TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT"; - public const string MarginCallEnter = "MARGIN_CALL_ENTER"; - public const string MarginCallExtend = "MARGIN_CALL_EXTEND"; - public const string MarginCallExit = "MARGIN_CALL_EXIT"; - public const string DelayedTradeClosure = "DELAYED_TRADE_CLOSURE"; - public const string DailyFinancing = "DAILY_FINANCING"; - public const string ResetResettablePL = "RESET_RESETTABLE_PL"; + public const string Create = "CREATE"; + public const string Close = "CLOSE"; + public const string Reopen = "REOPEN"; + public const string ClientConfigure = "CLIENT_CONFIGURE"; + public const string ClientConfigureReject = "CLIENT_CONFIGURE_REJECT"; + public const string TransferFunds = "TRANSFER_FUNDS"; + public const string TransferFundsReject = "TRANSFER_FUNDS_REJECT"; + public const string MarketOrder = "MARKET_ORDER"; + public const string MarketOrderReject = "MARKET_ORDER_REJECT"; + public const string FixedPriceOrder = "FIXED_PRICE_ORDER"; + public const string LimitOrder = "LIMIT_ORDER"; + public const string LimitOrderReject = "LIMIT_ORDER_REJECT"; + public const string StopOrder = "STOP_ORDER"; + public const string StopOrderReject = "STOP_ORDER_REJECT"; + public const string MarketIfTouchedOrder = "MARKET_IF_TOUCHED_ORDER"; + public const string MarketIfTouchedOrderReject = "MARKET_IF_TOUCHED_ORDER_REJECT"; + public const string TakeProfitOrder = "TAKE_PROFIT_ORDER"; + public const string TakeProfitOrderReject = "TAKE_PROFIT_ORDER_REJECT"; + public const string StopLossOrder = "STOP_LOSS_ORDER"; + public const string StopLossOrderReject = "STOP_LOSS_ORDER_REJECT"; + public const string TrailingStopLossOrder = "TRAILING_STOP_LOSS_ORDER"; + public const string TrailingStopLossOrderReject = "TRAILING_STOP_LOSS_ORDER_REJECT"; + public const string OrderFill = "ORDER_FILL"; + public const string OrderCancel = "ORDER_CANCEL"; + public const string OrderCancelReject = "ORDER_CANCEL_REJECT"; + public const string OrderClientExtensionsModify = "ORDER_CLIENT_EXTENSIONS_MODIFY"; + public const string OrderClientExtensionsModifyReject = "ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT"; + public const string TradeClientExtensionsModify = "TRADE_CLIENT_EXTENSIONS_MODIFY"; + public const string TradeClientExtensionsModifyReject = "TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT"; + public const string MarginCallEnter = "MARGIN_CALL_ENTER"; + public const string MarginCallExtend = "MARGIN_CALL_EXTEND"; + public const string MarginCallExit = "MARGIN_CALL_EXIT"; + public const string DelayedTradeClosure = "DELAYED_TRADE_CLOSURE"; + public const string DailyFinancing = "DAILY_FINANCING"; + public const string ResetResettablePL = "RESET_RESETTABLE_PL"; } /// @@ -706,12 +709,12 @@ public class TransactionType /// public class TransactionFilter : TransactionType { - public const string Order = "ORDER"; - public const string Funding = "FUNDING"; - public const string Admin = "ADMIN"; - public const string OneCancelsAllOrder = "ONE_CANCELS_ALL_ORDER"; - public const string OneCancelsAllOrderReject = "ONE_CANCELS_ALL_ORDER_REJECT"; - public const string OneCancelsAllOrderTriggered = "ONE_CANCELS_ALL_ORDER_TRIGGERED"; + public const string Order = "ORDER"; + public const string Funding = "FUNDING"; + public const string Admin = "ADMIN"; + public const string OneCancelsAllOrder = "ONE_CANCELS_ALL_ORDER"; + public const string OneCancelsAllOrderReject = "ONE_CANCELS_ALL_ORDER_REJECT"; + public const string OneCancelsAllOrderTriggered = "ONE_CANCELS_ALL_ORDER_TRIGGERED"; } /// @@ -721,7 +724,7 @@ public class TransactionFilter : TransactionType /// public class VWAPReceipt { - public decimal units { get; set; } - public decimal price { get; set; } + public decimal units { get; set; } + public decimal price { get; set; } } } From 86577927500ebbd4c91530f7411f7add5f6d9100 Mon Sep 17 00:00:00 2001 From: Osita Christopher Okonkwo Date: Tue, 19 Nov 2024 20:57:09 -0600 Subject: [PATCH 2/3] Update PackNuget.yml --- .github/workflows/PackNuget.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/PackNuget.yml b/.github/workflows/PackNuget.yml index 02cfa4f..15abf01 100644 --- a/.github/workflows/PackNuget.yml +++ b/.github/workflows/PackNuget.yml @@ -14,10 +14,11 @@ jobs: id: set_version run: | repoDateTime=${{github.event.repository.updated_at}} - versionNumber=$(echo $repoDateTime | cut -d "T" -f1 | sed 's/-/./g') + repoDateTime=$(date -d $repoDateTime +"%Y-%m%-d") + versionNumber=$(echo $repoDateTime | sed 's/-/./g') buildNumber=${{github.run_number}} - echo "Version is $versionNumber.$buildNumber" - echo "version=$versionNumber.$buildNumber" >> $GITHUB_OUTPUT + echo "Version is 3.$versionNumber.$buildNumber" + echo "version=3.$versionNumber.$buildNumber" >> $GITHUB_OUTPUT outputs: version: ${{steps.set_version.outputs.version}} From b2cee38b61af6864942c5fe564cc9c00cc213ecc Mon Sep 17 00:00:00 2001 From: Osita Christopher Okonkwo Date: Tue, 19 Nov 2024 21:01:52 -0600 Subject: [PATCH 3/3] Update PackNuget.yml --- .github/workflows/PackNuget.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/PackNuget.yml b/.github/workflows/PackNuget.yml index 15abf01..dab2a0a 100644 --- a/.github/workflows/PackNuget.yml +++ b/.github/workflows/PackNuget.yml @@ -13,7 +13,7 @@ jobs: - name: Set version id: set_version run: | - repoDateTime=${{github.event.repository.updated_at}} + repoDateTime=${{github.event.repository.pushed_at}} repoDateTime=$(date -d $repoDateTime +"%Y-%m%-d") versionNumber=$(echo $repoDateTime | sed 's/-/./g') buildNumber=${{github.run_number}}