Beispiel #1
0
 protected Option(IUnderlying underlying, DateTime expirationDate, OptionType callOrPut, decimal strike,
                  decimal premium)
 {
     Underlying     = underlying;
     ExpirationDate = expirationDate;
     CallOrPut      = callOrPut;
     Strike         = strike;
     Premium        = premium;
 }
Beispiel #2
0
 protected Option(IUnderlying underlying, DateTime expirationDate, OptionType callOrPut, decimal strike,
     decimal premium)
 {
     Underlying = underlying;
     ExpirationDate = expirationDate;
     CallOrPut = callOrPut;
     Strike = strike;
     Premium = premium;
 }
        /// <summary>
        /// Parses the json message sent and converts it into a UnderlyierImpl object using a json serializer.
        /// </summary>
        /// <param name="json"> the json message to be parsed.</param>
        /// <exception cref="ArgumentException"> thrown if the json message is null or empty.</exception>
        private void ProcessNewUnderlyierUpdate(string json)
        {
            if (String.IsNullOrEmpty(json))
            {
                throw new ArgumentException("json");
            }

            try
            {
                IUnderlying newUnderlying = JsonConvert.DeserializeObject <UnderlyingImpl>(json);
                underlyingManager.AddUnderlying(newUnderlying.RIC, newUnderlying.Description, newUnderlying.IsValid);
            }
            catch (Exception exc)
            {
                log.Error(String.Format("Failed to deserialize json [{0}] into new underlyier update. Exception raised [{1}]", json, exc.Message));
            }
        }
Beispiel #4
0
        public async Task <IActionResult> Underlying([FromServices] IUnderlying underlying, [FromBody] PostData data)
        {
            try
            {
                var runDate = data.ForDate ?? DateTime.Today.Date;

                Logger.LogInformation(default(EventId), message: $"Retrieving Underlying Instrument data for {runDate}; currencies: {data.Currencies}.");

                var result = await underlying
                             .GetUnderlyingRecords(runDate, data.Currencies)
                             .ConfigureAwait(false);

                Logger.LogInformation(default(EventId), message: $"Exit Underlying: retrieved {result.Count} records.");
                return(new OkObjectResult(result));
            }
            catch (Exception ex)
            {
                Logger.LogError(default(EventId), message: "Unexpected Exception:", exception: ex);
                return(this.StatusCode(500, $"Unexpected Exception: {ex}"));
            }
        }
 public RefreshBindingSourceEventArgs(IUnderlying underlying, bool groupByPrice)
     : this(underlying, null)
 {
     this.groupByPrice = groupByPrice;
 }
 public RefreshBindingSourceEventArgs(IUnderlying underlying, IOption option)
     : base()
 {
     this.underlying = underlying;
     this.option     = option;
 }