string GenerateCalculationErrorMessage(string exceptionMessage)
{
string text = "<h1>Error: " + exceptionMessage + "</h1>";
string customIndicators = "";
int customIndCount = 0;
for (int slot = 0; slot < Data.Strategy.Slots; slot++)
{
string indName = Data.Strategy.Slot[slot].IndicatorName;
Indicator indicator = Indicator_Store.ConstructIndicator(indName, Data.Strategy.Slot[slot].SlotType);
if (indicator.CustomIndicator)
{
customIndCount++;
indicatorBlackList.Add(indName);
customIndicators += "<li>" + Data.Strategy.Slot[slot].IndicatorName + "</li>" + Environment.NewLine;
}
}
if (customIndCount > 0)
{
string plural = (customIndCount > 1 ? "s" : "");
text +=
"<p>" +
"An error occurred when calculating the strategy." + " " +
"The error can be a result of the following custom indicator" + plural + ":" +
"</p>" +
"<ul>" +
customIndicators +
"</ul>" +
"<p>" +
"Please report this error to the author of the indicator" + plural + "!<br />" +
"You may remove this indicator" + plural + " from the Custom Indicators folder." +
"</p>";
}
else
{
text +=
"<p>" +
"Please report this error in the support forum!" +
"</p>";
}
return text;
}