Пример #1
0
 public void CalculateIndicatorWithRandomParameters(IIndicator indicator, IDataSet dataSet, int testPerSlot)
 {
     Random random = new Random(DateTime.Now.Second);
     var types = (SlotTypes[])Enum.GetValues(typeof(SlotTypes));
     foreach (var type in types)
         if (indicator.TestPossibleSlot(type))
             for (int i = 0; i < testPerSlot; i++)
             {
                 TestIndicator(indicator, type, dataSet, random);
                 ShowResult(indicator);
             }
 }
Пример #2
0
        private string GetPossibleSlotsString(IIndicator indicator)
        {
            var sb = new StringBuilder();

            if (indicator.TestPossibleSlot(SlotTypes.Open))
            {
                sb.AppendLine("        \"Open\",");
            }
            if (indicator.TestPossibleSlot(SlotTypes.OpenFilter))
            {
                sb.AppendLine("        \"OpenFilter\",");
            }
            if (indicator.TestPossibleSlot(SlotTypes.Close))
            {
                sb.AppendLine("        \"Close\",");
            }
            if (indicator.TestPossibleSlot(SlotTypes.CloseFilter))
            {
                sb.AppendLine("        \"CloseFilter\",");
            }
            var output = sb.ToString();

            return(output.Remove(output.Length - 2));
        }
Пример #3
0
        public void CalculateIndicatorWithRandomParameters(IIndicator indicator, IDataSet dataSet, int testPerSlot)
        {
            Random random = new Random(DateTime.Now.Second);
            var    types  = (SlotTypes[])Enum.GetValues(typeof(SlotTypes));

            foreach (var type in types)
            {
                if (indicator.TestPossibleSlot(type))
                {
                    for (int i = 0; i < testPerSlot; i++)
                    {
                        TestIndicator(indicator, type, dataSet, random);
                        ShowResult(indicator);
                    }
                }
            }
        }