Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ExoticInstrumentAllOf" /> class.
        /// </summary>
        /// <param name="instrumentFormat">instrumentFormat (required).</param>
        /// <param name="content">The original document received into the system. This format could potentially be anything though is most likely to be either Json or Xml. In the case where no other              interface is supported it is possible to fall back onto this.              For example, a trade from an external client system. This may be recognized internally by Lusid or simply passed through to another vendor system. (required).</param>
        /// <param name="instrumentType">The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashflowLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CashSettled, CdsIndex, Basket (required).</param>
        public ExoticInstrumentAllOf(InstrumentDefinitionFormat instrumentFormat = default(InstrumentDefinitionFormat), string content = default(string), InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum))
        {
            // to ensure "instrumentFormat" is required (not null)
            if (instrumentFormat == null)
            {
                throw new InvalidDataException("instrumentFormat is a required property for ExoticInstrumentAllOf and cannot be null");
            }
            else
            {
                this.InstrumentFormat = instrumentFormat;
            }

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

            // to ensure "instrumentType" is required (not null)
            if (instrumentType == null)
            {
                throw new InvalidDataException("instrumentType is a required property for ExoticInstrumentAllOf and cannot be null");
            }
            else
            {
                this.InstrumentType = instrumentType;
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="FixedLegAllOf" /> class.
        /// </summary>
        /// <param name="startDate">The start date of the instrument. This is normally synonymous with the trade-date. (required).</param>
        /// <param name="maturityDate">The final maturity date of the instrument. This means the last date on which the instruments makes a payment of any amount.              For the avoidance of doubt, that is not necessarily prior to its last sensitivity date for the purposes of risk; e.g. instruments such as              Constant Maturity Swaps (CMS) often have sensitivities to rates beyond their last payment date (required).</param>
        /// <param name="legDefinition">legDefinition (required).</param>
        /// <param name="notional">notional (required).</param>
        /// <param name="overrides">overrides.</param>
        /// <param name="instrumentType">The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashflowLeg, Unknown, TermDeposit (required).</param>
        public FixedLegAllOf(DateTimeOffset?startDate = default(DateTimeOffset?), DateTimeOffset?maturityDate = default(DateTimeOffset?), LegDefinition legDefinition = default(LegDefinition), decimal?notional = default(decimal?), FixedLegAllOfOverrides overrides = default(FixedLegAllOfOverrides), InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum))
        {
            // to ensure "startDate" is required (not null)
            if (startDate == null)
            {
                throw new InvalidDataException("startDate is a required property for FixedLegAllOf and cannot be null");
            }
            else
            {
                this.StartDate = startDate;
            }

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

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

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

            this.Overrides = overrides;
            // to ensure "instrumentType" is required (not null)
            if (instrumentType == null)
            {
                throw new InvalidDataException("instrumentType is a required property for FixedLegAllOf and cannot be null");
            }
            else
            {
                this.InstrumentType = instrumentType;
            }

            this.Overrides = overrides;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LusidInstrument" /> class.
 /// </summary>
 /// <param name="instrumentType">The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashflowLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CashSettled, CdsIndex, Basket (required).</param>
 public LusidInstrument(InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum))
 {
     // to ensure "instrumentType" is required (not null)
     if (instrumentType == null)
     {
         throw new InvalidDataException("instrumentType is a required property for LusidInstrument and cannot be null");
     }
     else
     {
         this.InstrumentType = instrumentType;
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="InterestRateSwaptionAllOf" /> class.
        /// </summary>
        /// <param name="startDate">The start date of the instrument. This is normally synonymous with the trade-date. (required).</param>
        /// <param name="payOrReceiveFixed">The available values are: NotDefined, Pay, Receive (required).</param>
        /// <param name="deliveryMethod">The available values are: Cash, Physical (required).</param>
        /// <param name="swap">swap (required).</param>
        /// <param name="instrumentType">The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashflowLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CashSettled, CdsIndex, Basket (required).</param>
        public InterestRateSwaptionAllOf(DateTimeOffset?startDate = default(DateTimeOffset?), PayOrReceiveFixedEnum payOrReceiveFixed = default(PayOrReceiveFixedEnum), DeliveryMethodEnum deliveryMethod = default(DeliveryMethodEnum), InterestRateSwap swap = default(InterestRateSwap), InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum))
        {
            // to ensure "startDate" is required (not null)
            if (startDate == null)
            {
                throw new InvalidDataException("startDate is a required property for InterestRateSwaptionAllOf and cannot be null");
            }
            else
            {
                this.StartDate = startDate;
            }

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

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

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

            // to ensure "instrumentType" is required (not null)
            if (instrumentType == null)
            {
                throw new InvalidDataException("instrumentType is a required property for InterestRateSwaptionAllOf and cannot be null");
            }
            else
            {
                this.InstrumentType = instrumentType;
            }
        }
Exemplo n.º 5
0
    public void Init()
    {
        //HideUIRoot();
        //Left = transform.Find("Left");
        //Right = transform.Find("Right");
        //Top = transform.Find("Top");
        //Save = transform.Find("Save");
        Left.gameObject.SetActive(true);
        Right.gameObject.SetActive(true);
        Save.gameObject.SetActive(true);
        Creat.gameObject.SetActive(true);
        Top.gameObject.SetActive(true);

        AllPacksack = new Dictionary <int, Packsack>();
        foreach (InstrumentTypeEnum value in InstrumentTypeEnum.GetValues(typeof(InstrumentTypeEnum)))
        {
            Packsack packsack = UITool.Instantiate("Packsack/Packsack", Right.gameObject).GetComponent <Packsack>();
            AllPacksack.Add((int)value, packsack);
            packsack.Init(value.ToString());
        }

        Left.Find("Viewport/Content").gameObject.AddComponent <TypeSelect>().Init(AllPacksack.Count);

        AddFunctionalButton();

        PlayBtn.clickCallBack        = Play;
        BuildBtn.clickCallBack       = Build;
        ExitBtn.clickCallBack        = Exit;
        SaveBtn.clickCallBack        = () => { SaveMgr.Instance.SaveGame(true); };
        LoadBtn.clickCallBack        = SavePanel;
        LoadReturnBtn.clickCallBack  = LoadReturn;
        CreatReturnBtn.clickCallBack = LoadReturn;

        SaveDefaultBtn1.clickCallBack = CilckDefault1;
        SaveDefaultBtn2.clickCallBack = CilckDefault2;

        Vector3 pos = Valve.VR.InteractionSystem.Player.instance.transform.position;

        ShowUIRoot(new Vector3(pos.x, pos.y + 1, pos.z + 0.5f));

        AllSave = Save.Find("Viewport/Content").GetComponentsInChildren <mButton>(true);

        Left.gameObject.SetActive(false);
        Right.gameObject.SetActive(false);
        Save.gameObject.SetActive(false);
        Creat.gameObject.SetActive(false);
    }
 /// <summary>
 /// Initializes a new instance of the <see cref="InterestRateSwapAllOf" /> class.
 /// </summary>
 /// <param name="startDate">The start date of the instrument. This is normally synonymous with the trade-date. (required).</param>
 /// <param name="maturityDate">The final maturity date of the instrument. This means the last date on which the instruments makes a payment of any amount.              For the avoidance of doubt, that is not necessarily prior to its last sensitivity date for the purposes of risk; e.g. instruments such as              Constant Maturity Swaps (CMS) often have sensitivities to rates beyond their last payment date (required).</param>
 /// <param name="legs">The set of instrument legs that define the swap instrument. (required).</param>
 /// <param name="instrumentType">The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashflowLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CashSettled, CdsIndex, Basket (required).</param>
 public InterestRateSwapAllOf(DateTimeOffset? startDate = default(DateTimeOffset?), DateTimeOffset? maturityDate = default(DateTimeOffset?), List<InstrumentLeg> legs = default(List<InstrumentLeg>), InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum))
 {
     // to ensure "startDate" is required (not null)
     if (startDate == null)
     {
         throw new InvalidDataException("startDate is a required property for InterestRateSwapAllOf and cannot be null");
     }
     else
     {
         this.StartDate = startDate;
     }
     
     // to ensure "maturityDate" is required (not null)
     if (maturityDate == null)
     {
         throw new InvalidDataException("maturityDate is a required property for InterestRateSwapAllOf and cannot be null");
     }
     else
     {
         this.MaturityDate = maturityDate;
     }
     
     // to ensure "legs" is required (not null)
     if (legs == null)
     {
         throw new InvalidDataException("legs is a required property for InterestRateSwapAllOf and cannot be null");
     }
     else
     {
         this.Legs = legs;
     }
     
     // to ensure "instrumentType" is required (not null)
     if (instrumentType == null)
     {
         throw new InvalidDataException("instrumentType is a required property for InterestRateSwapAllOf and cannot be null");
     }
     else
     {
         this.InstrumentType = instrumentType;
     }
     
 }
Exemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CashPerpetualAllOf" /> class.
        /// </summary>
        /// <param name="startDate">The start date of the instrument. This is normally synonymous with the trade-date. (required).</param>
        /// <param name="domCcy">The domestic currency of the instrument. (required).</param>
        /// <param name="principal">The face-value or principal for the cash at outset. (required).</param>
        /// <param name="instrumentType">The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashflowLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CashSettled, CdsIndex, Basket (required).</param>
        public CashPerpetualAllOf(DateTimeOffset?startDate = default(DateTimeOffset?), string domCcy = default(string), decimal?principal = default(decimal?), InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum))
        {
            // to ensure "startDate" is required (not null)
            if (startDate == null)
            {
                throw new InvalidDataException("startDate is a required property for CashPerpetualAllOf and cannot be null");
            }
            else
            {
                this.StartDate = startDate;
            }

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

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

            // to ensure "instrumentType" is required (not null)
            if (instrumentType == null)
            {
                throw new InvalidDataException("instrumentType is a required property for CashPerpetualAllOf and cannot be null");
            }
            else
            {
                this.InstrumentType = instrumentType;
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="BasketAllOf" /> class.
        /// </summary>
        /// <param name="basketName">basketName (required).</param>
        /// <param name="basketType">What contents does the basket have. The validation will check that the instrument types contained match those expected.  Supported string (enumeration) values are: [Bonds, Credits, Equities, EquitySwap, Unknown]. (required).</param>
        /// <param name="weightedInstruments">weightedInstruments (required).</param>
        /// <param name="instrumentType">The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashflowLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CashSettled, CdsIndex, Basket (required).</param>
        public BasketAllOf(BasketIdentifier basketName = default(BasketIdentifier), string basketType = default(string), WeightedInstruments weightedInstruments = default(WeightedInstruments), InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum))
        {
            // to ensure "basketName" is required (not null)
            if (basketName == null)
            {
                throw new InvalidDataException("basketName is a required property for BasketAllOf and cannot be null");
            }
            else
            {
                this.BasketName = basketName;
            }

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

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

            // to ensure "instrumentType" is required (not null)
            if (instrumentType == null)
            {
                throw new InvalidDataException("instrumentType is a required property for BasketAllOf and cannot be null");
            }
            else
            {
                this.InstrumentType = instrumentType;
            }
        }
Exemplo n.º 9
0
        public bool TryAddStock(string ticker, string figi, CurrencyEnum currency, string name, InstrumentTypeEnum type, int lot)
        {
            var stock = new Stock
            {
                figi     = figi,
                ticker   = ticker,
                currency = currency,
                type     = type,
                name     = name,
                lot      = lot
            };

            return(TryAddStock(stock));
        }
Exemplo n.º 10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Bond" /> class.
        /// </summary>
        /// <param name="startDate">The start date of the instrument. This is normally synonymous with the trade-date. (required).</param>
        /// <param name="maturityDate">The final maturity date of the instrument. This means the last date on which the instruments makes a payment of any amount.              For the avoidance of doubt, that is not necessarily prior to its last sensitivity date for the purposes of risk; e.g. instruments such as              Constant Maturity Swaps (CMS) often have sensitivities to rates beyond their last payment date (required).</param>
        /// <param name="domCcy">The domestic currency of the instrument. (required).</param>
        /// <param name="flowConventions">flowConventions (required).</param>
        /// <param name="principal">The face-value or principal for the bond at outset.              This might be reduced through its lifetime in the event of amortization or similar. (required).</param>
        /// <param name="couponRate">simple coupon rate. (required).</param>
        /// <param name="identifiers">external market codes and identifiers for the bond, e.g. ISIN..</param>
        public Bond(DateTimeOffset?startDate = default(DateTimeOffset?), DateTimeOffset?maturityDate = default(DateTimeOffset?), string domCcy = default(string), FlowConventions flowConventions = default(FlowConventions), decimal?principal = default(decimal?), decimal?couponRate = default(decimal?), Dictionary <string, string> identifiers = default(Dictionary <string, string>), InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum)) : base(instrumentType)
        {
            // to ensure "startDate" is required (not null)
            if (startDate == null)
            {
                throw new InvalidDataException("startDate is a required property for Bond and cannot be null");
            }
            else
            {
                this.StartDate = startDate;
            }

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

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

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

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

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

            this.Identifiers = identifiers;
            this.Identifiers = identifiers;
        }
Exemplo n.º 11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TermDepositAllOf" /> class.
        /// </summary>
        /// <param name="startDate">The start date of the instrument. This is normally synonymous with the trade-date. (required).</param>
        /// <param name="maturityDate">The final maturity date of the instrument. This means the last date on which the instruments makes a payment of any amount.              For the avoidance of doubt, that is not necessarily prior to its last sensitivity date for the purposes of risk; e.g. instruments such as              Constant Maturity Swaps (CMS) often have sensitivities to rates beyond their last payment date (required).</param>
        /// <param name="contractSize">With an OTC we have the problem of multiple ways of booking a quantity.              e.g.              If buying a swap do you have a holding of size 1 of 100,000,000 notional swap or a holding of 100,000,000 size of 1 notional swap, or any combination that multiplies to 10^8.              When you get for a price for a &#39;unit swap&#39; what do you mean? The definition must be consistent across all quotes. This includes bonds which have a face value and              fx-forwards which often trade in standard contract sizes. When we look up a price, and there are no units, we are assuming it is a price for a contract size of 1.              The logical effect of this is that              instrument clean price &#x3D; contract size * quoted unit price              holding clean price    &#x3D; holding quantity * instrument clean price &#x3D; holding quantity * contract size * quoted unit price              In calculating accrued interest the same should hold.              NB: The real problem is that people store \&quot;prices\&quot; without complete units. Everything should really be \&quot;x ccy for n units\&quot;. Where the n is implicit the above has to hold. (required).</param>
        /// <param name="flowConvention">flowConvention (required).</param>
        /// <param name="rate">The fixed rate for the term deposit. Specified as a decimal, e.g 0.03 is meant to be 3% interest (required).</param>
        /// <param name="instrumentType">The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashflowLeg, Unknown, TermDeposit (required).</param>
        public TermDepositAllOf(DateTimeOffset?startDate = default(DateTimeOffset?), DateTimeOffset?maturityDate = default(DateTimeOffset?), decimal?contractSize = default(decimal?), FlowConventions flowConvention = default(FlowConventions), decimal?rate = default(decimal?), InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum))
        {
            // to ensure "startDate" is required (not null)
            if (startDate == null)
            {
                throw new InvalidDataException("startDate is a required property for TermDepositAllOf and cannot be null");
            }
            else
            {
                this.StartDate = startDate;
            }

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

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

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

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

            // to ensure "instrumentType" is required (not null)
            if (instrumentType == null)
            {
                throw new InvalidDataException("instrumentType is a required property for TermDepositAllOf and cannot be null");
            }
            else
            {
                this.InstrumentType = instrumentType;
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CreditDefaultSwap" /> class.
        /// </summary>
        /// <param name="ticker">A ticker to uniquely specify then entity against which the cds is written (required).</param>
        /// <param name="startDate">The start date of the instrument. This is normally synonymous with the trade-date. (required).</param>
        /// <param name="maturityDate">The final maturity date of the instrument. This means the last date on which the instruments makes a payment of any amount.              For the avoidance of doubt, that is not necessarily prior to its last sensitivity date for the purposes of risk; e.g. instruments such as              Constant Maturity Swaps (CMS) often have sensitivities to rates beyond their last payment date (required).</param>
        /// <param name="flowConventions">flowConventions.</param>
        /// <param name="couponRate">The coupon rate paid on each payment date of the premium leg as a fraction of 100 percent, e.g. \&quot;0.05\&quot; meaning 500 basis points or 5%.              For a standard corporate CDS (North American) this must be either 100bps or 500bps. (required).</param>
        /// <param name="conventionName">conventionName.</param>
        /// <param name="protectionDetailSpecification">protectionDetailSpecification (required).</param>
        public CreditDefaultSwap(string ticker = default(string), DateTimeOffset?startDate = default(DateTimeOffset?), DateTimeOffset?maturityDate = default(DateTimeOffset?), CdsFlowConventions flowConventions = default(CdsFlowConventions), decimal?couponRate = default(decimal?), FlowConventionName conventionName = default(FlowConventionName), CdsProtectionDetailSpecification protectionDetailSpecification = default(CdsProtectionDetailSpecification), InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum)) : base(instrumentType)
        {
            // to ensure "ticker" is required (not null)
            if (ticker == null)
            {
                throw new InvalidDataException("ticker is a required property for CreditDefaultSwap and cannot be null");
            }
            else
            {
                this.Ticker = ticker;
            }

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

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

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

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

            this.FlowConventions = flowConventions;
            this.ConventionName  = conventionName;
        }
Exemplo n.º 13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LusidInstrument" /> class.
 /// </summary>
 /// <param name="instrumentType">The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashFlowsLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CapFloor, CashSettled, CdsIndex, Basket, FundingLeg, FxSwap, ForwardRateAgreement, SimpleInstrument, Repo, Equity, ExchangeTradedOption, ReferenceInstrument, ComplexBond (required).</param>
 public LusidInstrument(InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum))
 {
     this.InstrumentType = instrumentType;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="EquitySwap" /> class.
        /// </summary>
        /// <param name="startDate">The start date of the EquitySwap (required).</param>
        /// <param name="maturityDate">The maturity date of the EquitySwap. (required).</param>
        /// <param name="code">The code of the underlying. (required).</param>
        /// <param name="equityFlowConventions">equityFlowConventions (required).</param>
        /// <param name="fundingLeg">fundingLeg (required).</param>
        /// <param name="includeDividends">Dividend inclusion flag, if true dividends are included in the equity leg (total return). (required).</param>
        /// <param name="initialPrice">The initial equity price of the Equity Swap. (required).</param>
        /// <param name="notionalReset">Notional reset flag, if true the notional of the funding leg is reset at the start of every  coupon to match the value of the equity leg (equity price at start of coupon times quantity) (required).</param>
        /// <param name="quantity">The quantity or number of shares in the Equity Swap. (required).</param>
        /// <param name="underlyingIdentifier">external market codes and identifiers for the EquitySwap, e.g. RIC.  Supported string (enumeration) values are: [LusidInstrumentId, Isin, Sedol, Cusip, ClientInternal, Figi, RIC, QuotePermId]. (required).</param>
        public EquitySwap(DateTimeOffset?startDate = default(DateTimeOffset?), DateTimeOffset?maturityDate = default(DateTimeOffset?), string code = default(string), FlowConventions equityFlowConventions = default(FlowConventions), InstrumentLeg fundingLeg = default(InstrumentLeg), bool?includeDividends = default(bool?), decimal?initialPrice = default(decimal?), bool?notionalReset = default(bool?), decimal?quantity = default(decimal?), string underlyingIdentifier = default(string), InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum)) : base(instrumentType)
        {
            // to ensure "startDate" is required (not null)
            if (startDate == null)
            {
                throw new InvalidDataException("startDate is a required property for EquitySwap and cannot be null");
            }
            else
            {
                this.StartDate = startDate;
            }

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

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

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

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

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

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

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

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

            // to ensure "underlyingIdentifier" is required (not null)
            if (underlyingIdentifier == null)
            {
                throw new InvalidDataException("underlyingIdentifier is a required property for EquitySwap and cannot be null");
            }
            else
            {
                this.UnderlyingIdentifier = underlyingIdentifier;
            }
        }
Exemplo n.º 15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EquityOption" /> class.
        /// </summary>
        /// <param name="startDate">The start date of the instrument. This is normally synonymous with the trade-date. (required).</param>
        /// <param name="optionMaturityDate">The maturity date of the option. (required).</param>
        /// <param name="optionSettlementDate">The settlement date of the option. (required).</param>
        /// <param name="deliveryType">The available values are: Cash, Physical (required).</param>
        /// <param name="optionType">The available values are: None, Call, Put (required).</param>
        /// <param name="strike">The strike of the option. (required).</param>
        /// <param name="domCcy">The domestic currency of the instrument. (required).</param>
        /// <param name="underlyingIdentifier">The available values are: LusidInstrumentId, Isin, Sedol, Cusip, ClientInternal, Figi, RIC, QuotePermId, REDCode, BBGId, ICECode (required).</param>
        /// <param name="code">The reset code of the option. (required).</param>
        public EquityOption(DateTimeOffset?startDate = default(DateTimeOffset?), DateTimeOffset?optionMaturityDate = default(DateTimeOffset?), DateTimeOffset?optionSettlementDate = default(DateTimeOffset?), DeliveryTypeEnum deliveryType = default(DeliveryTypeEnum), OptionTypeEnum optionType = default(OptionTypeEnum), decimal?strike = default(decimal?), string domCcy = default(string), UnderlyingIdentifierEnum underlyingIdentifier = default(UnderlyingIdentifierEnum), string code = default(string), InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum)) : base(instrumentType)
        {
            // to ensure "startDate" is required (not null)
            if (startDate == null)
            {
                throw new InvalidDataException("startDate is a required property for EquityOption and cannot be null");
            }
            else
            {
                this.StartDate = startDate;
            }

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

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

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

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

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

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

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

            // to ensure "code" is required (not null)
            if (code == null)
            {
                throw new InvalidDataException("code is a required property for EquityOption and cannot be null");
            }
            else
            {
                this.Code = code;
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FutureAllOf" /> class.
        /// </summary>
        /// <param name="startDate">The start date of the instrument. This is normally synonymous with the trade-date. (required).</param>
        /// <param name="maturityDate">The final maturity date of the instrument. This means the last date on which the instruments makes a payment of any amount.              For the avoidance of doubt, that is not necessarily prior to its last sensitivity date for the purposes of risk; e.g. instruments such as              Constant Maturity Swaps (CMS) often have sensitivities to rates beyond their last payment date (required).</param>
        /// <param name="identifiers">external market codes and identifiers for the bond, e.g. ISIN. (required).</param>
        /// <param name="contractDetails">contractDetails (required).</param>
        /// <param name="contracts">The number of contracts held.</param>
        /// <param name="refSpotPrice">The reference spot price for the future at which the contract was entered into..</param>
        /// <param name="underlying">underlying (required).</param>
        /// <param name="instrumentType">The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashflowLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CashSettled, CdsIndex, Basket (required).</param>
        public FutureAllOf(DateTimeOffset?startDate = default(DateTimeOffset?), DateTimeOffset?maturityDate = default(DateTimeOffset?), Dictionary <string, string> identifiers = default(Dictionary <string, string>), FuturesContractDetails contractDetails = default(FuturesContractDetails), decimal?contracts = default(decimal?), decimal?refSpotPrice = default(decimal?), LusidInstrument underlying = default(LusidInstrument), InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum))
        {
            // to ensure "startDate" is required (not null)
            if (startDate == null)
            {
                throw new InvalidDataException("startDate is a required property for FutureAllOf and cannot be null");
            }
            else
            {
                this.StartDate = startDate;
            }

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

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

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

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

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

            this.Contracts    = contracts;
            this.RefSpotPrice = refSpotPrice;
        }
Exemplo n.º 17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InstrumentLeg" /> class.
 /// </summary>
 public InstrumentLeg(InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum)) : base(instrumentType)
 {
 }
Exemplo n.º 18
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FxOption" /> class.
        /// </summary>
        /// <param name="startDate">The start date of the instrument. This is normally synonymous with the trade-date. (required).</param>
        /// <param name="optionMaturityDate">The maturity date of the option. (required).</param>
        /// <param name="optionSettlementDate">The settlement date of the option. (required).</param>
        /// <param name="isDeliveryNotCash">True of the option is settled in cash false if delivery. (required).</param>
        /// <param name="isCallNotPut">True if the option is a call, false if the option is a put. (required).</param>
        /// <param name="strike">The strike of the option. (required).</param>
        /// <param name="domCcy">The domestic currency of the instrument. (required).</param>
        /// <param name="fgnCcy">The foreign currency of the FX. (required).</param>
        public FxOption(DateTimeOffset?startDate = default(DateTimeOffset?), DateTimeOffset?optionMaturityDate = default(DateTimeOffset?), DateTimeOffset?optionSettlementDate = default(DateTimeOffset?), bool?isDeliveryNotCash = default(bool?), bool?isCallNotPut = default(bool?), decimal?strike = default(decimal?), string domCcy = default(string), string fgnCcy = default(string), InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum)) : base(instrumentType)
        {
            // to ensure "startDate" is required (not null)
            if (startDate == null)
            {
                throw new InvalidDataException("startDate is a required property for FxOption and cannot be null");
            }
            else
            {
                this.StartDate = startDate;
            }

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

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

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

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

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

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

            // to ensure "fgnCcy" is required (not null)
            if (fgnCcy == null)
            {
                throw new InvalidDataException("fgnCcy is a required property for FxOption and cannot be null");
            }
            else
            {
                this.FgnCcy = fgnCcy;
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CdsIndexAllOf" /> class.
        /// </summary>
        /// <param name="startDate">The start date of the instrument. This is normally synonymous with the trade-date. (required).</param>
        /// <param name="maturityDate">The final maturity date of the instrument. This means the last date on which the instruments makes a payment of any amount.  For the avoidance of doubt, that is not necessarily prior to its last sensitivity date for the purposes of risk; e.g. instruments such as  Constant Maturity Swaps (CMS) often have sensitivities to rates beyond their last payment date (required).</param>
        /// <param name="flowConventions">flowConventions.</param>
        /// <param name="couponRate">The coupon rate paid on each payment date of the premium leg as a fraction of 100 percent, e.g. \&quot;0.05\&quot; meaning 500 basis points or 5%.  For a standard corporate CDS (North American) this must be either 100bps or 500bps. (required).</param>
        /// <param name="identifiers">external market codes and identifiers for the cds index, e.g. a RED code, BBG ID or ICE code. (required).</param>
        /// <param name="basket">basket (required).</param>
        /// <param name="conventionName">conventionName.</param>
        /// <param name="notional">The notional quantity that applies to both the premium and protection legs (required).</param>
        /// <param name="instrumentType">The available values are: QuotedSecurity, InterestRateSwap, FxForward, Future, ExoticInstrument, FxOption, CreditDefaultSwap, InterestRateSwaption, Bond, EquityOption, FixedLeg, FloatingLeg, BespokeCashflowLeg, Unknown, TermDeposit, ContractForDifference, EquitySwap, CashPerpetual, CashSettled, CdsIndex, Basket (required).</param>
        public CdsIndexAllOf(DateTimeOffset?startDate = default(DateTimeOffset?), DateTimeOffset?maturityDate = default(DateTimeOffset?), CdsFlowConventions flowConventions = default(CdsFlowConventions), decimal?couponRate = default(decimal?), Dictionary <string, string> identifiers = default(Dictionary <string, string>), Basket basket = default(Basket), FlowConventionName conventionName = default(FlowConventionName), decimal?notional = default(decimal?), InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum))
        {
            // to ensure "startDate" is required (not null)
            if (startDate == null)
            {
                throw new InvalidDataException("startDate is a required property for CdsIndexAllOf and cannot be null");
            }
            else
            {
                this.StartDate = startDate;
            }

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

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

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

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

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

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

            this.FlowConventions = flowConventions;
            this.ConventionName  = conventionName;
        }
Exemplo n.º 20
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FxForward" /> class.
        /// </summary>
        /// <param name="startDate">The start date of the instrument. This is normally synonymous with the trade-date. (required).</param>
        /// <param name="maturityDate">The final maturity date of the instrument. This means the last date on which the instruments makes a payment of any amount.              For the avoidance of doubt, that is not necessarily prior to its last sensitivity date for the purposes of risk; e.g. instruments such as              Constant Maturity Swaps (CMS) often have sensitivities to rates beyond their last payment date (required).</param>
        /// <param name="domAmount">The amount that is to be paid in the domestic currency on the maturity date. (required).</param>
        /// <param name="domCcy">The domestic currency of the instrument. (required).</param>
        /// <param name="fgnAmount">The amount that is to be paid in the foreign currency on the maturity date (required).</param>
        /// <param name="fgnCcy">The foreign (other) currency of the instrument. In the NDF case, only payments are made in the domestic currency.              For the outright forward, currencies are exchanged. By domestic is then that of the portfolio. (required).</param>
        /// <param name="refSpotRate">The reference Fx Spot rate for currency pair Foreign-Domestic that was seen on the trade start date (time)..</param>
        /// <param name="isNdf">Is the contract an Fx-Forward of \&quot;Non-Deliverable\&quot; type, meaning a single payment in the domestic currency based on the change in fx-rate vs              a reference rate is used..</param>
        /// <param name="fixingDate">The fixing date ..</param>
        public FxForward(DateTimeOffset?startDate = default(DateTimeOffset?), DateTimeOffset?maturityDate = default(DateTimeOffset?), decimal?domAmount = default(decimal?), string domCcy = default(string), decimal?fgnAmount = default(decimal?), string fgnCcy = default(string), decimal?refSpotRate = default(decimal?), bool?isNdf = default(bool?), DateTimeOffset?fixingDate = default(DateTimeOffset?), InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum)) : base(instrumentType)
        {
            // to ensure "startDate" is required (not null)
            if (startDate == null)
            {
                throw new InvalidDataException("startDate is a required property for FxForward and cannot be null");
            }
            else
            {
                this.StartDate = startDate;
            }

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

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

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

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

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

            this.RefSpotRate = refSpotRate;
            this.IsNdf       = isNdf;
            this.FixingDate  = fixingDate;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ContractForDifference" /> class.
        /// </summary>
        /// <param name="startDate">The start date of the CFD. (required).</param>
        /// <param name="maturityDate">The maturity date for the CFD. If CFDType is Futures, this should be set to be the maturity date of the underlying  future. If CFDType is Cash, this should not be set..</param>
        /// <param name="code">The code of the underlying. (required).</param>
        /// <param name="contractSize">The size of the CFD contract, this should represent the total number of stocks that the CFD represents. (required).</param>
        /// <param name="payCcy">The currency that this CFD pays out, this can be different to the UnderlyingCcy. (required).</param>
        /// <param name="referenceRate">The reference rate of the CFD, this can be set to 0 but not negative values.  This field is optional, if not set it will default to 0..</param>
        /// <param name="type">The type of CFD.  Supported string (enumeration) values are: [Cash, Futures]. (required).</param>
        /// <param name="underlyingCcy">The currency of the underlying (required).</param>
        /// <param name="underlyingIdentifier">external market codes and identifiers for the CFD, e.g. RIC.  Supported string (enumeration) values are: [LusidInstrumentId, Isin, Sedol, Cusip, ClientInternal, Figi, RIC, QuotePermId]. (required).</param>
        public ContractForDifference(DateTimeOffset? startDate = default(DateTimeOffset?), DateTimeOffset? maturityDate = default(DateTimeOffset?), string code = default(string), decimal? contractSize = default(decimal?), string payCcy = default(string), decimal? referenceRate = default(decimal?), string type = default(string), string underlyingCcy = default(string), string underlyingIdentifier = default(string), InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum))
            : base(instrumentType)
        {
            // to ensure "startDate" is required (not null)
            if (startDate == null)
            {
                throw new InvalidDataException("startDate is a required property for ContractForDifference and cannot be null");
            }
            else
            {
                this.StartDate = startDate;
            }

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

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

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

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

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

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

            this.MaturityDate = maturityDate;
            this.ReferenceRate = referenceRate;
        }