barsRequest.Request(new Action<BarsRequest, ErrorCode, string>((bars, errorCode, errorMessage) =>
{
if (errorCode != ErrorCode.NoError)
{
// Handle any errors in requesting bars here
NinjaTrader.Code.Output.Process(string.Format("Err or on requesting bars: {0}, {1}",
errorCode, errorMessage), PrintTo.OutputTab1);
return;
}
etc.
I've discovered that this approach to handling errors produced by the Request method doesn't work. It doesn't work, because when the Request method encounters an error the "if (errorCode != ErrorCode.NoError)" code snippet doesn't execute. Instead, NT immediately issues an error that reads like "Error on requesting bars series: 'The instrument for which you requested data is invalid.'" and NT exits the procedure. So, might you recommend another approach for trapping and handling errors produced by the Request method?
Comment