Ejemplo n.º 1
0
        /// <summary>
        /// The data constraints.
        /// </summary>
        /// <returns>
        /// The <see cref="IRuleDataConstraint"/>.
        /// </returns>
        public override IRuleDataConstraint DataConstraints()
        {
            if (this.EquitiesParameters == null)
            {
                return(RuleDataConstraint.Empty().Case);
            }

            var constraints = new List <RuleDataSubConstraint>();

            if (this.EquitiesParameters.HighVolumePercentageDaily != null)
            {
                var constraint = new RuleDataSubConstraint(
                    this.ForwardWindowSize,
                    this.TradeBackwardWindowSize,
                    DataSource.AnyInterday,
                    _ => true);

                constraints.Add(constraint);
            }

            if (this.EquitiesParameters.HighVolumePercentageMarketCap != null)
            {
                var constraint = new RuleDataSubConstraint(
                    this.ForwardWindowSize,
                    this.TradeBackwardWindowSize,
                    DataSource.AnyInterday,
                    _ => !this.OrderFilter.Filter(_));

                constraints.Add(constraint);
            }

            if (this.EquitiesParameters.HighVolumePercentageWindow != null)
            {
                var constraint = new RuleDataSubConstraint(
                    this.ForwardWindowSize,
                    this.TradeBackwardWindowSize,
                    DataSource.AnyIntraday,
                    _ => !this.OrderFilter.Filter(_));

                constraints.Add(constraint);
            }

            return(new RuleDataConstraint(
                       this.Rule,
                       this.EquitiesParameters.Id,
                       constraints));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// The data constraints.
        /// </summary>
        /// <returns>
        /// The <see cref="IRuleDataConstraint"/>.
        /// </returns>
        public override IRuleDataConstraint DataConstraints()
        {
            if (this.rampingParameters == null)
            {
                return(RuleDataConstraint.Empty().Case);
            }

            var constraint = new RuleDataSubConstraint(
                this.ForwardWindowSize,
                this.TradeBackwardWindowSize,
                DataSource.AnyIntraday,
                _ => !this.orderFilter.Filter(_));

            return(new RuleDataConstraint(
                       this.Rule,
                       this.rampingParameters.Id,
                       new[] { constraint }));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// The data constraints.
        /// </summary>
        /// <returns>
        /// The <see cref="IRuleDataConstraint"/>.
        /// </returns>
        public override IRuleDataConstraint DataConstraints()
        {
            if (this.equitiesParameters == null)
            {
                return(RuleDataConstraint.Empty().Case);
            }

            var constraints = new List <RuleDataSubConstraint>();

            if (this.equitiesParameters.PercentageThresholdDailyVolume != null)
            {
                var constraint = new RuleDataSubConstraint(
                    this.ForwardWindowSize,
                    this.TradeBackwardWindowSize,
                    DataSource.AnyInterday,
                    _ => !this.orderFilter.Filter(_));

                constraints.Add(constraint);
            }

            if (this.equitiesParameters.PercentageThresholdWindowVolume != null)
            {
                var constraint = new RuleDataSubConstraint(
                    this.ForwardWindowSize,
                    this.TradeBackwardWindowSize,
                    DataSource.AnyInterday,
                    _ => !this.orderFilter.Filter(_));

                constraints.Add(constraint);
            }

            return(new RuleDataConstraint(
                       this.Rule,
                       this.equitiesParameters.Id,
                       constraints));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// The data constraints.
        /// </summary>
        /// <returns>
        /// The <see cref="IRuleDataConstraint"/>.
        /// </returns>
        public override IRuleDataConstraint DataConstraints()
        {
            if (this.FixedIncomeParameters == null)
            {
                return(RuleDataConstraint.Empty().Case);
            }

            var constraints = new List <RuleDataSubConstraint>();

            if (this.FixedIncomeParameters.PerformHighProfitDailyAnalysis)
            {
                var constraint = new RuleDataSubConstraint(
                    this.ForwardWindowSize,
                    this.TradeBackwardWindowSize,
                    DataSource.RefinitivInterday,
                    _ => !this.orderFilter.Filter(_));

                constraints.Add(constraint);
            }

            if (this.FixedIncomeParameters.PerformHighProfitWindowAnalysis)
            {
                var constraint = new RuleDataSubConstraint(
                    this.ForwardWindowSize,
                    this.TradeBackwardWindowSize,
                    DataSource.RefinitivIntraday,
                    _ => !this.orderFilter.Filter(_));

                constraints.Add(constraint);
            }

            return(new RuleDataConstraint(
                       this.Rule,
                       this.FixedIncomeParameters.Id,
                       constraints));
        }