Example #1
0
 private void btnUSDT_Click(object sender, EventArgs e)
 {
     QuoteCurrency = QuoteCurrencyEnum.USD;
     SetObject();
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="Instrument" /> class.
        /// </summary>
        /// <param name="quoteCurrency">The currency in which the instrument prices are quoted. (required).</param>
        /// <param name="kind">Instrument kind, &#x60;\&quot;future\&quot;&#x60; or &#x60;\&quot;option\&quot;&#x60; (required).</param>
        /// <param name="tickSize">specifies minimal price change and, as follows, the number of decimal places for instrument prices (required).</param>
        /// <param name="contractSize">Contract size for instrument (required).</param>
        /// <param name="isActive">Indicates if the instrument can currently be traded. (required).</param>
        /// <param name="optionType">The option type (only for options).</param>
        /// <param name="minTradeAmount">Minimum amount for trading. 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="settlementPeriod">The settlement period. (required).</param>
        /// <param name="strike">The strike value. (only for options).</param>
        /// <param name="baseCurrency">The underlying currency being traded. (required).</param>
        /// <param name="creationTimestamp">The time when the instrument was first created (milliseconds) (required).</param>
        /// <param name="expirationTimestamp">The time when the instrument will expire (milliseconds) (required).</param>
        public Instrument(QuoteCurrencyEnum quoteCurrency = default(QuoteCurrencyEnum), KindEnum kind = default(KindEnum), decimal?tickSize = default(decimal?), int?contractSize = default(int?), bool?isActive = default(bool?), OptionTypeEnum?optionType = default(OptionTypeEnum?), decimal?minTradeAmount = default(decimal?), string instrumentName = default(string), SettlementPeriodEnum settlementPeriod = default(SettlementPeriodEnum), decimal?strike = default(decimal?), BaseCurrencyEnum baseCurrency = default(BaseCurrencyEnum), int?creationTimestamp = default(int?), int?expirationTimestamp = default(int?))
        {
            // to ensure "quoteCurrency" is required (not null)
            if (quoteCurrency == null)
            {
                throw new InvalidDataException("quoteCurrency is a required property for Instrument and cannot be null");
            }
            else
            {
                this.QuoteCurrency = quoteCurrency;
            }

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

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

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

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

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

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

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

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

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

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

            this.OptionType = optionType;
            this.Strike     = strike;
        }
Example #3
0
 private void btnBTC_Click(object sender, EventArgs e)
 {
     QuoteCurrency = QuoteCurrencyEnum.BTC;
     SetObject();
 }