There are some formulas that use 3rd party plugin functions.
And some of you might wonder if it is possible to display a meaningful error message when plugin is missing. Here is an example code that shows how to detect if plugin-provided function is available and display meaningful error message when it isn't.
// Check the function identifier. If plugin is not installed it will be "undefined"
// If it is installed the identifier will be "function"
if( typeof( NorgateIndexConstituentTimeSeries ) == "function" )
{
printf("Norgate plugin installed");
}
else
{
Error("Norgate plugin is missing");
_exit();
}
As it turns out, actual plugin function has different name zzzNorgateDataIndexConstituentTimeSeries and NorgateIndexConstituentTimeSeries is just AFL wrapper.
So to detect actual plugin being loaded, the code would need to use real plugin-exported function: