bool CalculateIndicator(SlotTypes slotType, Indicator indicator)
{
bool okStatus;
try
{
indicator.Calculate(slotType);
okStatus = true;
}
catch (Exception excaption)
{
string request = "Please report this error in the support forum!";
if (indicator.CustomIndicator)
request = "Please report this error to the author of the indicator!<br />" +
"You may remove this indicator from the Custom Indicators folder.";
string text =
"<h1>Error: " + excaption.Message + "</h1>" +
"<p>Slot type: <strong>" + slotType.ToString() + "</strong><br />" +
"Indicator: <strong>" + indicator.ToString() + "</strong></p>" +
"<p>" + request + "</p>";
string caption = "Indicator Calculation Error";
Fancy_Message_Box msgBox = new Fancy_Message_Box(text, caption);
msgBox.BoxWidth = 450;
msgBox.BoxHeight = 250;
msgBox.Show();
okStatus = false;
}
return okStatus;
}