Exception Class Messages
Exception and System Exception error messages are generated by EasyLanguage code contained in analysis techniques and strategies. They are associated with exception classes and may require making changes to the originating EasyLanguage code from the TradeStation Development Environment.
Namespace: (any)
General Troubleshooting Tips
• Use Print statements.
• Comment out code to isolate the error, then comment code back in.
• Consider logging to a file for difficult-to-replicate run-time errors (see FileAppend).
• Consider using the debugger (see About Debugger).
• Examine the "stack trace" from the exception window's event details section. After the event description, the "call stack" shows the order in which functions were called, and the line number on which the error was triggered (when possible).
For example, in the call stack below, ThrowExceptions is the TradingApp name, the exception is triggered at line 17 in func2, which is called by func1, which is called by the analysistechnique_initialized method, which is called by the "EasyLanguage run-time," abbreviated ELRte. The function listed at the top of the stack was the last function called, and is often the place in the code where the error was triggered. The function listed at the bottom of the stack was the first function called.
Call Stack:
ThrowExceptions.func2() line 17
ThrowExceptions.func1()
ThrowExceptions.analysistechnique_initialized( elsystem.Object sender, elsystem.InitializedEventArgs args )
ELRte
Exception Class Messages
The following Exception messages are used to identify the condition described and the matching class will throw an exception if the condition is true. The Exception base class provide a common set of methods and properties that may be accessed for these exceptions.
Some of the Exception types in the tables below are wrappers for .NET exceptions of the same name. A standard browser search for a type such as “ArgumentException” will yield results from the .NET System.ArgumentException, which may provide additional useful information. Exceptions that are wrappers for corresponding .NET exceptions are indicated with “(.NET)” in the Additional Troubleshooting Notes column.
These classes may be used with Try / Catch / Finally statements to set up handling for user exceptions.
Exceptions may also be used with Throw to cause the exception to occur and/or display the exception error message.
Name | Error Description | Additional Troubleshooting Notes | |
![]() |
ActivityBarException | An empty cell/row or out of range item is referenced in an ActivityBar. |
Within an ActivityBar, for example, the following code where no cells have been added yet would cause this exception: AB_RemoveCell(C, 1, LeftSide). |
![]() |
ArgumentException | One of the arguments provided to a method is not valid. | (.NET) |
![]() |
ArrayBoundsException | An analysis technique attempts to reference the data past the bounds of the array. | Array indices are 0-based, so accessing myArray[10] on an array with size 10 could trigger this exception (the 10th element is myArray[9]). |
![]() |
DataDeletedException | A reference to an non-existing datastream is made. |
For example, the following code works when a 2nd symbol has been inserted into the chart (Data2), but if the 2nd symbol is removed, the DataDeletedException occurs. Value1 = 2; Value2 = Close Data( Value1 ); |
![]() |
DirectoryNotFoundException | The specified file location was not found. |
(.NET) Attempting to access an invalid directory name. Example: Directory.GetLastAccessTime(“c:\badname”); |
![]() |
FileNotFoundException | The specified file was not found. |
(.NET) Attempting to access an invalid file name. Example: File.GetAttributes(“c:\badfilename.txt); |
![]() |
InvalidCastException | Invalid casting or explicit conversion. |
(.NET) For example: Dict = new Dictionary Dict.Add("First", 1); ord = Dict["First"] astype tsdata.trading.order; Attempting to cast the integer object to order results in an InvalidCastException. |
![]() |
InvalidOperationException | A method call is invalid for the object's current state. | (.NET) |
![]() |
IOException | An I/O (Input/Output) operation is unsuccessful. | (.NET) Could be triggered by anything that can prevent a file i/o operation from completing, except the cases of derived classes like DirectoryNotFoundException and FileNotFoundException. It could be an attempt to access a locked file, attempting to write when only read access has been requested, going past the end of a stream, etc. |
![]() |
HistFundamentalDataDoesNotExistException | Historical fundamental data does not exist for this reference. | |
![]() |
LogException | Attempt to call the mathematical Log function on a non-positive number. | |
![]() |
MaxBarsException | The number of bars referenced in a study are greater than the allowed number. | Check, and possibly increase, the MaxBarsBack setting in the Properties\General tab for the study in the development environment. Use general troubleshooting techniques (see above) to determine the maximum lookback made by the study. |
![]() |
TooManyTrendlinesException | There are too many trendlines on the screen | Consider reducing the amount of history shown on the chart. |
![]() |
TooManyTextObjectsException | There are too many text drawing objects on the screen. | Consider reducing the amount of history shown on the chart. |
![]() |
NoFundamentalDataAvailableException | The fundamental data cannot be found for a Symbol. | |
![]() |
NullObjectException | A method call is made using a null object. |
(.NET) For example, if Dictionary Dict has been declared but not created then the following line of code will cause this exception: Dict.Add("First", "123"); |
![]() |
ObjectNotInitializedException | An object instance failed to initialize. | |
![]() |
OpenFileException | A file cannot be opened. |
This exception is only thrown when attempting to use the EL Print statement to print to a file, and the file cannot be created or written. For example, if the file passed below is locked by another application then this exception will occur: Print(File("c:\data\mydata.txt"), "Hello"); |
![]() |
OpenPositionsException | There are too many open positions in a strategy. The maximum number of open positions allowed in a strategy is 50. | |
![]() |
PlotRangeException | An analysis technique attempts to change plot information for an non-existing plot. | |
![]() |
PowerErrorException | An analysis technique attempts to raise a negative number to a fractional power. | |
![]() |
PrintErrorException | Connection to the printer cannot be made to print the output. | |
![]() |
ProbabilityMapException | Related to Probability Map. | |
![]() |
ProbBottomReInitException | The bottom price for the Probability Map cannot be changed. | |
![]() |
RecalculateException |
Throw this exception to force a chart to recalculate and re-plot. throw elsystem.RecalculateException.Create(""); |
|
![]() |
SqrtErrorException | An analysis technique attempts to evaluate a square-root of a negative number. | |
![]() |
StopCalculationException |
Throw this exception to turn off an analysis technique. Example: throw elsystem.StopCalculationException.Create(""); |
|
![]() |
SynchronousDataAccessException | Error accessing data synchronously from a provider. | |
![]() |
ToolMemoryException | There is no memory space for storing strings. | |
![]() |
UnauthorizedAccessException | The operating system has denied access due to an I/O error or security error. | (.NET) In addition to security imposed by the operating system, this exception may be thrown based on TradeStation user entitlements, such as unauthorized file read access. |
![]() |
WriteFileException | The output cannot be written to a file. |
This exception is only thrown when attempting to use the EL Print statement to print to a file, and the file cannot be created or written. For example, if Q: is not a valid drive on your system, then this line of code will cause the exception: Print(File("q:\data\mydata.txt"), "Hello"); |
![]() |
XmlException | There is a load or parse error in XML. | (.NET) Print the contents to the EasyLanguagePrintLog or write to file. Use free online XML validation tools to help find XML syntax errors. |
System Exception Class Messages
The following SystemException classes are used to identify the condition described and the matching class will throw an exception if the condition is true. The SystemException base class provide a common set of methods and properties that may be accessed for these exceptions
Name | Error Description | Additional Troubleshooting Notes | |
![]() |
DebuggingException | Code debugging execution is interrupted. | (.NET) |
![]() |
DivideByZeroException | An attempt to divide by zero(0). | (.NET) |
![]() |
FltDivideByZeroException | Floating-point divide by zero exception. | |
![]() |
FltInvalidOperationException | Floating-point invalid operation exception. | |
![]() |
FltOverflowException | Floating-point overflow exception. | |
![]() |
FltUnderflowException | Floating-point underflow exception. | |
![]() |
FPInvalidException | Floating-point invalid exception. | |
![]() |
InfiniteLoopException | An Infinite loop is detected in an analysis technique. Check all 'FOR' and/or 'WHILE' loops for correct syntax. | |
![]() |
IntDivideByZeroException | Integer divide by zero exception. | |
![]() |
IntOverflowException | Integer overflow exception. | |
![]() |
InvalidCallBackMessageException | An invalid call back message. | |
![]() |
InvalidDllOperationException | An invalid operation occurs in a user dll. | |
![]() |
InvalidHandleException | An invalid HANDLE is specified. | |
![]() |
InvalidOperationException | A method call is invalid for the object's current state. | (.NET) |
![]() |
NonContinuableException | The event isn't continuable in the hardware, or if continuation makes no sense. | |
![]() |
OutOfMemoryException | There is no more memory space available. | (.NET) This could reflect a huge memory allocation or very low system resources, but more often it involves the same looping or recursive call errors that could cause an InfiniteLoopException or StackOverflowException, but the memory condition is reached first. |
![]() |
SessionException | An invalid session reference occurred. | |
![]() |
StackOverflowException | The execution stack overflows because it contains too many nested method calls. | (.NET) This could happen when a function calls itself recursively, or when two functions call each other. One example is if there is user function called Log, which calls a user function called WriteStr to write a string to file. WriteStr catches any exception and calls Log to write the exception information to a specific file. But if there is a problem writing to the log file (perhaps entitlements), the two functions repeatedly call each other. |
![]() |
UnknownException | An unknown error generated an exception. | (.NET) |
Inheritance Hierarchy
Exceptions
(namespace).(exceptioname)
System Exceptions
elsystem.(exceptionname)