Quote from TSGannGalt:
The exceptions you put in is very dangerous. This is coming from a guy who's traded "for" LEH (siginificantly before their fall out). You want the Exceptions as an Exception to do what's appropriate when deep shit happens, which happens quite frequently... This happens frequently than what the retail environment notices providing that there's major screening the brokers do, ALL THE TIME.
There's a reason to a lot of the late fills you get.... Not something to be discussed on a public forum anyways....
Your partially but not entirely correct.
Each exception is a different situation.
Many exceptions in coding are expected and a communication technique between methods.
I think you're refering to unexpected exceptions and I agree.
On further thought, it was a mistaken idea to generically handle any unexpected exception. It's better just to cleanly close all positions and stop processing than just fail and leave positions on, however.
I do catch and handle all exceptions around the method calls to custom strategies and custom indicators to protect myself and others from forgetting to handle them. Plus it's better not to have that code repeated and cluttering up strategies and indicators.
What I will do is switch the algorithm from what's above to a "close all positions--a.k.a. go flat and stop trading" for any unexpected exception.
Hey, I'm entitled to one bad idea.
NOTE: AT first I won't release the code for download, I'll just make it availabe for web browsing for a code review. This code has never benefited from a peer review.
The web browser is cool because it's color coded and has links to jump to class defintions, etc.
So it makes it easy to browse.
Plus based on questions. I'll probably need to draw up some Visio diagrams for the site as to the design of how it works.
All feedback will be appreciated and I'll endeavor to clean up most of that stuff before releasing it to SVN for you to checkout and start using.
We're getting close. I might have everything ready this weekend or soon thereafter.
Good night!
Sincerely,
Wayne