/// <summary>
        /// The save fixed income high volume judgement.
        /// </summary>
        /// <param name="highVolume">
        /// The high volume.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task SaveAsync(IFixedIncomeHighVolumeJudgement highVolume)
        {
            this.logger?.LogInformation($"Fixed Income High Volume judgement saving for rule run {highVolume.RuleRunId}");

            if (highVolume == null)
            {
                this.logger?.LogError("Fixed Income High Volume judgement was null");

                return;
            }

            var dto = new HighVolumeJudgementDto(highVolume);

            try
            {
                using (var databaseConnection = this.databaseConnectionFactory.BuildConn())
                {
                    var result = await databaseConnection.ExecuteAsync(SaveHighVolume, dto);
                }
            }
            catch (Exception e)
            {
                this.logger?.LogError(e, $"Error in save insert for high volume");
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FixedIncomeHighVolumeJudgementContext"/> class.
 /// </summary>
 /// <param name="judgement">
 /// The judgement.
 /// </param>
 /// <param name="raiseRuleViolation">
 /// The project to alert.
 /// </param>
 /// <param name="tradePosition">
 /// The trade position.
 /// </param>
 /// <param name="venue">
 /// The venue.
 /// </param>
 public FixedIncomeHighVolumeJudgementContext(
     IFixedIncomeHighVolumeJudgement judgement,
     bool raiseRuleViolation,
     ITradePosition tradePosition,
     Market venue)
 {
     this.Judgement          = judgement ?? throw new ArgumentNullException(nameof(judgement));
     this.RaiseRuleViolation = raiseRuleViolation;
     this.TradePosition      = tradePosition ?? throw new ArgumentNullException(nameof(tradePosition));
     this.Venue = venue;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="HighVolumeJudgementDto"/> class.
 /// </summary>
 /// <param name="judgement">
 /// The judgement.
 /// </param>
 public HighVolumeJudgementDto(IFixedIncomeHighVolumeJudgement judgement)
     : base(
         !judgement?.NoAnalysis ?? false,
         judgement?.ClientOrderId,
         judgement?.OrderId,
         judgement?.Parameters,
         judgement?.RuleRunCorrelationId,
         judgement?.RuleRunId)
 {
     this.WindowVolumeThresholdAmount     = judgement.WindowAnalysisAnalysis?.VolumeThresholdAmount;
     this.WindowVolumeThresholdPercentage = judgement.WindowAnalysisAnalysis?.VolumeThresholdPercentage;
     this.WindowVolumeTradedAmount        = judgement.WindowAnalysisAnalysis?.VolumeTradedAmount;
     this.WindowVolumeTradedPercentage    = judgement.WindowAnalysisAnalysis?.VolumeTradedPercentage;
     this.WindowVolumeBreach             = judgement?.WindowAnalysisAnalysis?.VolumeBreach ?? false;
     this.DailyVolumeThresholdAmount     = judgement.DailyAnalysisAnalysis?.VolumeThresholdAmount;
     this.DailyVolumeThresholdPercentage = judgement.DailyAnalysisAnalysis?.VolumeThresholdPercentage;
     this.DailyVolumeTradedAmount        = judgement.DailyAnalysisAnalysis?.VolumeTradedAmount;
     this.DailyVolumeTradedPercentage    = judgement.DailyAnalysisAnalysis?.VolumeTradedPercentage;
     this.DailyVolumeBreach = judgement?.DailyAnalysisAnalysis?.VolumeBreach ?? false;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FixedIncomeHighVolumeJudgementContext"/> class.
 /// </summary>
 /// <param name="judgement">
 /// The judgement.
 /// </param>
 /// <param name="raiseRuleViolation">
 /// The raise rule violation.
 /// </param>
 /// <param name="ruleBreachContext">
 /// The rule breach context.
 /// </param>
 /// <param name="fixedIncomeParameters">
 /// The fixed income parameters.
 /// </param>
 /// <param name="totalOrdersTradedInWindow">
 /// The total orders traded in window.
 /// </param>
 /// <param name="security">
 /// The security.
 /// </param>
 /// <param name="isIssuanceBreach">
 /// The is issuance breach.
 /// </param>
 /// <param name="tradePosition">
 /// The trade Position.
 /// </param>
 /// <param name="venue">
 /// The venue.
 /// </param>
 public FixedIncomeHighVolumeJudgementContext(
     IFixedIncomeHighVolumeJudgement judgement,
     bool raiseRuleViolation,
     IRuleBreachContext ruleBreachContext,
     IHighVolumeIssuanceRuleFixedIncomeParameters fixedIncomeParameters,
     decimal totalOrdersTradedInWindow,
     FinancialInstrument security,
     bool isIssuanceBreach,
     TradePosition tradePosition,
     Market venue)
 {
     this.Judgement                 = judgement;
     this.RaiseRuleViolation        = raiseRuleViolation;
     this.RuleBreachContext         = ruleBreachContext;
     this.FixedIncomeParameters     = fixedIncomeParameters;
     this.TotalOrdersTradedInWindow = totalOrdersTradedInWindow;
     this.Security         = security;
     this.IsIssuanceBreach = isIssuanceBreach;
     this.TradePosition    = tradePosition;
     this.Venue            = venue;
 }
 public void Setup()
 {
     this.tradePosition = A.Fake <ITradePosition>();
     this.judgement     = A.Fake <IFixedIncomeHighVolumeJudgement>();
     this.market        = new Market("id-1", "XLON", "London Stock Exchange", MarketTypes.STOCKEXCHANGE);
 }