CustomIndicatorThoroughTest() public static method

Performs thorough indicator test.
public static CustomIndicatorThoroughTest ( string sIndicatorName, string &sErrorList ) : bool
sIndicatorName string The indicator name.
sErrorList string
return bool
示例#1
0
        /// <summary>
        /// Does the job
        /// </summary>
        static void DoWorkTestCustomIndicators(object sender, DoWorkEventArgs e)
        {
            bool isErrors = false;

            StringBuilder errorReport = new StringBuilder();

            errorReport.AppendLine("<h1>" + Language.T("Custom Indicators") + "</h1>");

            StringBuilder okReport = new StringBuilder();

            okReport.AppendLine("<h1>" + Language.T("Custom Indicators") + "</h1>");
            okReport.AppendLine("<p>");

            foreach (string indicatorName in Indicator_Store.CustomIndicatorNames)
            {
                string errorList;
                if (!Indicator_Tester.CustomIndicatorThoroughTest(indicatorName, out errorList))
                {
                    isErrors = true;
                    errorReport.AppendLine("<h2>" + indicatorName + "</h2>");
                    string error = errorList.Replace(Environment.NewLine, "</br>");
                    error = error.Replace("\t", "&nbsp; &nbsp; &nbsp;");
                    errorReport.AppendLine("<p>" + error + "</p>");
                }
                else
                {
                    okReport.AppendLine(indicatorName + " - OK" + "<br />");
                }
            }

            okReport.AppendLine("</p>");

            CustomIndicatorsTestResult result = new CustomIndicatorsTestResult();

            result.IsErrors    = isErrors;
            result.ErrorReport = errorReport.ToString();
            result.OKReport    = okReport.ToString();

            e.Result = (object)result;

            return;
        }