Ejemplo n.º 1
0
        private static Rule CreateRandomCrossRule() // Generate a random Cross Rule.
        {
            int rndNum = RandomHolder.Instance.Next(3);

            if (rndNum == 0) // Create a Cross( Overlay, Overlay) rule.
            {
                return(RuleFactory.createCrossRule(IndicatorFactory.getRandomPriceOverlayIndicator(), IndicatorFactory.getRandomPriceOverlayIndicator()));
            }
            else if (rndNum == 1) // Create a Cross( Overlay, PriceArray) rule.
            {
                return(RuleFactory.createCrossRule(IndicatorFactory.getRandomPriceOverlayIndicator(), IndicatorFactory.createRandomABPriceArray()));
            }
            else // Create a Cross( PriceArray, Overlay) rule.
            {
                return(RuleFactory.createCrossRule(IndicatorFactory.createRandomABPriceArray(), IndicatorFactory.getRandomPriceOverlayIndicator()));
            }
        }