to overcome:
Compile-Time errors:
Compiling your code finds language syntax errors, these errors must all be corrected before
you can even run your code. These errors are reported at the bottom of the NinjaTrader
editor window.
Run-Time errors:
These errors typically show a poor understanding of the language, they indicate things like
incorrect usage of concepts, improper organization of code, and non-sensical logic violating
language constraints. These errors are bad enough that the run-time environment (such as
NinjaTrader's Strategy Analyzer) will usually stop the program (aka, your indicator or strategy)
and print an error message. In our case all run-time error messages are sent to the log file,
which are viewable via the Log tab in the Control Center window.
The point is:
Just because your code compiles correctly, does not mean that other errors don't exist. Like
many terms in computer science, the word 'error' is very overloaded.
Although it deals with Java, this link has good general information about 'errors' in programming:
https://www.cis.upenn.edu/~matuszek/...ax/errors.html
Btw, yes, there is a third major category of errors, known as 'bugs'. When a program is able
to run to completion yet still produces incorrect results, the logic errors in the program causing
the incorrect results are called 'bugs'. A software bug can be exceptionally difficult to find
and become very notorious in its effects.
You code is a classic example of the "run-time error" category.
The philosophy section at the bottom of that link is very well said.
No one starts out writing perfect error-free programs.
Hang in there.
Leave a comment: