Пример #1
0
        /// <summary>
        /// Add a new trade rule and join condition.
        /// </summary>
        /// <param name="tradeRule">The trade rule to add.</param>
        /// <param name="ruleJoinType">The join condition to add.</param>
        public void Add(TradeRule tradeRule, RuleJoinType ruleJoinType)
        {
            if (this.RuleJoinTypes.Count > 0 && this.RuleJoinTypes.Last() == RuleJoinType.none)
            {
                throw new TradeRuleException("Can not add another trade rule. The previous join type was none.");
            }

            this.TradeRules.Add(tradeRule);
            this.RuleJoinTypes.Add(ruleJoinType);
        }
Пример #2
0
        /// <summary>
        /// Add a new trade rule and join condition.
        /// </summary>
        /// <param name="tradeRule">The trade rule to add.</param>
        /// <param name="ruleJoinType">The join condition to add.</param>
        public void Add(TradeRule tradeRule, RuleJoinType ruleJoinType)
        {
            if (this.RuleJoinTypes.Count > 0 && this.RuleJoinTypes.Last() == RuleJoinType.none)
            {
                throw new TradeRuleException("Can not add another trade rule. The previous join type was none.");
            }

            this.TradeRules.Add(tradeRule);
            this.RuleJoinTypes.Add(ruleJoinType);
        }
Пример #3
0
 private bool getBoolValue(double value1, double value2, RuleJoinType ruleJoinType)
 {
     return ruleJoinType == RuleJoinType.and ? value1 == 1D && value2 == 1D
                                             : value1 == 1D || value2 == 1D;
 }