Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UserTrade" /> class.
        /// </summary>
        /// <param name="direction">Trade direction of the taker (required).</param>
        /// <param name="feeCurrency">Currency, i.e &#x60;\&quot;BTC\&quot;&#x60;, &#x60;\&quot;ETH\&quot;&#x60; (required).</param>
        /// <param name="orderId">Id of the user order (maker or taker), i.e. subscriber&#39;s order id that took part in the trade (required).</param>
        /// <param name="timestamp">The timestamp of the trade (required).</param>
        /// <param name="price">The price of the trade (required).</param>
        /// <param name="iv">Option implied volatility for the price (Option only).</param>
        /// <param name="tradeId">Unique (per currency) trade identifier (required).</param>
        /// <param name="fee">User&#39;s fee in units of the specified &#x60;fee_currency&#x60; (required).</param>
        /// <param name="orderType">Order type: &#x60;\&quot;limit&#x60;, &#x60;\&quot;market\&quot;&#x60;, or &#x60;\&quot;liquidation\&quot;&#x60;.</param>
        /// <param name="tradeSeq">The sequence number of the trade within instrument (required).</param>
        /// <param name="selfTrade">&#x60;true&#x60; if the trade is against own order. This can only happen when your account has self-trading enabled. Contact an administrator if you think you need that (required).</param>
        /// <param name="state">order state, &#x60;\&quot;open\&quot;&#x60;, &#x60;\&quot;filled\&quot;&#x60;, &#x60;\&quot;rejected\&quot;&#x60;, &#x60;\&quot;cancelled\&quot;&#x60;, &#x60;\&quot;untriggered\&quot;&#x60; or &#x60;\&quot;archive\&quot;&#x60; (if order was archived) (required).</param>
        /// <param name="label">User defined label (presented only when previously set for order by user).</param>
        /// <param name="indexPrice">Index Price at the moment of trade (required).</param>
        /// <param name="amount">Trade amount. For perpetual and futures - in USD units, for options it is amount of corresponding cryptocurrency contracts, e.g., BTC or ETH. (required).</param>
        /// <param name="instrumentName">Unique instrument identifier (required).</param>
        /// <param name="tickDirection">Direction of the \&quot;tick\&quot; (&#x60;0&#x60; &#x3D; Plus Tick, &#x60;1&#x60; &#x3D; Zero-Plus Tick, &#x60;2&#x60; &#x3D; Minus Tick, &#x60;3&#x60; &#x3D; Zero-Minus Tick). (required).</param>
        /// <param name="matchingId">Always &#x60;null&#x60;, except for a self-trade which is possible only if self-trading is switched on for the account (in that case this will be id of the maker order of the subscriber) (required).</param>
        /// <param name="liquidity">Describes what was role of users order: &#x60;\&quot;M\&quot;&#x60; when it was maker order, &#x60;\&quot;T\&quot;&#x60; when it was taker order.</param>
        public UserTrade(DirectionEnum direction = default(DirectionEnum), FeeCurrencyEnum feeCurrency = default(FeeCurrencyEnum), string orderId = default(string), int?timestamp = default(int?), decimal?price = default(decimal?), decimal?iv = default(decimal?), string tradeId = default(string), decimal?fee = default(decimal?), OrderTypeEnum?orderType = default(OrderTypeEnum?), int?tradeSeq = default(int?), bool?selfTrade = default(bool?), StateEnum state = default(StateEnum), string label = default(string), decimal?indexPrice = default(decimal?), decimal?amount = default(decimal?), string instrumentName = default(string), TickDirectionEnum tickDirection = default(TickDirectionEnum), string matchingId = default(string), LiquidityEnum?liquidity = default(LiquidityEnum?))
        {
            // to ensure "direction" is required (not null)
            if (direction == null)
            {
                throw new InvalidDataException("direction is a required property for UserTrade and cannot be null");
            }
            else
            {
                this.Direction = direction;
            }

            // to ensure "feeCurrency" is required (not null)
            if (feeCurrency == null)
            {
                throw new InvalidDataException("feeCurrency is a required property for UserTrade and cannot be null");
            }
            else
            {
                this.FeeCurrency = feeCurrency;
            }

            // to ensure "orderId" is required (not null)
            if (orderId == null)
            {
                throw new InvalidDataException("orderId is a required property for UserTrade and cannot be null");
            }
            else
            {
                this.OrderId = orderId;
            }

            // to ensure "timestamp" is required (not null)
            if (timestamp == null)
            {
                throw new InvalidDataException("timestamp is a required property for UserTrade and cannot be null");
            }
            else
            {
                this.Timestamp = timestamp;
            }

            // to ensure "price" is required (not null)
            if (price == null)
            {
                throw new InvalidDataException("price is a required property for UserTrade and cannot be null");
            }
            else
            {
                this.Price = price;
            }

            // to ensure "tradeId" is required (not null)
            if (tradeId == null)
            {
                throw new InvalidDataException("tradeId is a required property for UserTrade and cannot be null");
            }
            else
            {
                this.TradeId = tradeId;
            }

            // to ensure "fee" is required (not null)
            if (fee == null)
            {
                throw new InvalidDataException("fee is a required property for UserTrade and cannot be null");
            }
            else
            {
                this.Fee = fee;
            }

            // to ensure "tradeSeq" is required (not null)
            if (tradeSeq == null)
            {
                throw new InvalidDataException("tradeSeq is a required property for UserTrade and cannot be null");
            }
            else
            {
                this.TradeSeq = tradeSeq;
            }

            // to ensure "selfTrade" is required (not null)
            if (selfTrade == null)
            {
                throw new InvalidDataException("selfTrade is a required property for UserTrade and cannot be null");
            }
            else
            {
                this.SelfTrade = selfTrade;
            }

            // to ensure "state" is required (not null)
            if (state == null)
            {
                throw new InvalidDataException("state is a required property for UserTrade and cannot be null");
            }
            else
            {
                this.State = state;
            }

            // to ensure "indexPrice" is required (not null)
            if (indexPrice == null)
            {
                throw new InvalidDataException("indexPrice is a required property for UserTrade and cannot be null");
            }
            else
            {
                this.IndexPrice = indexPrice;
            }

            // to ensure "amount" is required (not null)
            if (amount == null)
            {
                throw new InvalidDataException("amount is a required property for UserTrade and cannot be null");
            }
            else
            {
                this.Amount = amount;
            }

            // to ensure "instrumentName" is required (not null)
            if (instrumentName == null)
            {
                throw new InvalidDataException("instrumentName is a required property for UserTrade and cannot be null");
            }
            else
            {
                this.InstrumentName = instrumentName;
            }

            // to ensure "tickDirection" is required (not null)
            if (tickDirection == null)
            {
                throw new InvalidDataException("tickDirection is a required property for UserTrade and cannot be null");
            }
            else
            {
                this.TickDirection = tickDirection;
            }

            // to ensure "matchingId" is required (not null)
            if (matchingId == null)
            {
                throw new InvalidDataException("matchingId is a required property for UserTrade and cannot be null");
            }
            else
            {
                this.MatchingId = matchingId;
            }

            this.Iv        = iv;
            this.OrderType = orderType;
            this.Label     = label;
            this.Liquidity = liquidity;
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PublicTrade" /> class.
        /// </summary>
        /// <param name="direction">Trade direction of the taker (required).</param>
        /// <param name="tickDirection">Direction of the \&quot;tick\&quot; (&#x60;0&#x60; &#x3D; Plus Tick, &#x60;1&#x60; &#x3D; Zero-Plus Tick, &#x60;2&#x60; &#x3D; Minus Tick, &#x60;3&#x60; &#x3D; Zero-Minus Tick). (required).</param>
        /// <param name="timestamp">The timestamp of the trade (required).</param>
        /// <param name="price">The price of the trade (required).</param>
        /// <param name="tradeSeq">The sequence number of the trade within instrument (required).</param>
        /// <param name="tradeId">Unique (per currency) trade identifier (required).</param>
        /// <param name="iv">Option implied volatility for the price (Option only).</param>
        /// <param name="indexPrice">Index Price at the moment of trade (required).</param>
        /// <param name="amount">Trade amount. For perpetual and futures - in USD units, for options it is amount of corresponding cryptocurrency contracts, e.g., BTC or ETH. (required).</param>
        /// <param name="instrumentName">Unique instrument identifier (required).</param>
        public PublicTrade(DirectionEnum direction = default(DirectionEnum), TickDirectionEnum tickDirection = default(TickDirectionEnum), int?timestamp = default(int?), decimal?price = default(decimal?), int?tradeSeq = default(int?), string tradeId = default(string), decimal?iv = default(decimal?), decimal?indexPrice = default(decimal?), decimal?amount = default(decimal?), string instrumentName = default(string))
        {
            // to ensure "direction" is required (not null)
            if (direction == null)
            {
                throw new InvalidDataException("direction is a required property for PublicTrade and cannot be null");
            }
            else
            {
                this.Direction = direction;
            }

            // to ensure "tickDirection" is required (not null)
            if (tickDirection == null)
            {
                throw new InvalidDataException("tickDirection is a required property for PublicTrade and cannot be null");
            }
            else
            {
                this.TickDirection = tickDirection;
            }

            // to ensure "timestamp" is required (not null)
            if (timestamp == null)
            {
                throw new InvalidDataException("timestamp is a required property for PublicTrade and cannot be null");
            }
            else
            {
                this.Timestamp = timestamp;
            }

            // to ensure "price" is required (not null)
            if (price == null)
            {
                throw new InvalidDataException("price is a required property for PublicTrade and cannot be null");
            }
            else
            {
                this.Price = price;
            }

            // to ensure "tradeSeq" is required (not null)
            if (tradeSeq == null)
            {
                throw new InvalidDataException("tradeSeq is a required property for PublicTrade and cannot be null");
            }
            else
            {
                this.TradeSeq = tradeSeq;
            }

            // to ensure "tradeId" is required (not null)
            if (tradeId == null)
            {
                throw new InvalidDataException("tradeId is a required property for PublicTrade and cannot be null");
            }
            else
            {
                this.TradeId = tradeId;
            }

            // to ensure "indexPrice" is required (not null)
            if (indexPrice == null)
            {
                throw new InvalidDataException("indexPrice is a required property for PublicTrade and cannot be null");
            }
            else
            {
                this.IndexPrice = indexPrice;
            }

            // to ensure "amount" is required (not null)
            if (amount == null)
            {
                throw new InvalidDataException("amount is a required property for PublicTrade and cannot be null");
            }
            else
            {
                this.Amount = amount;
            }

            // to ensure "instrumentName" is required (not null)
            if (instrumentName == null)
            {
                throw new InvalidDataException("instrumentName is a required property for PublicTrade and cannot be null");
            }
            else
            {
                this.InstrumentName = instrumentName;
            }

            this.Iv = iv;
        }