A quick thank you to NinjaTrader_Paul for the NT8 reference indicator: NT8 - Spread Oscillator. I am grateful the indicator has been posted for reference.
The indicator uses a try/catch block for a critical section of the logic in OnBarUpdate(). While this approach works, how could the indicator be re-written without the try/catch block?
It is my understanding exceptions should only be used when an application encounters an exceptional circumstance (MSDN). The basic rule of thumb for catching exceptions is to catch exceptions if and only if you have a meaningful way of handling them (StackOverflow). Using exceptions gratuitously is where you lose performance. For example, you should stay away from things like using exceptions for control flow (StackOverflow).
Could IsValidDataPoint() be used?
As always, any suggestions are welcome
Regards
Shannon

Comment