Sunday, February 7, 2010

Stomache Problems Pins And Needles

UserDefinedMethods.cs - Variables

Since we're on the subject, I would gladly enter the class UserDefinedMethods.cs get a little closer.

These NT-standard class is upper class of all strategies that can review the user or use. Ausgdrückt the inheritance code in a separate class by the following construct:






The user can in this class global method for all classes and thus implement strategies. But beware, as shown in the last post is here because of C # specific (for example, inheritance rules), but also from general object-oriented principles, an increased risk of errors in programming. In my last post, I mentioned trades that were not sold. This was fortunately an error that had no major consequences, but surely you should watch what you do here.


What methods or testing are in my opinion, in this upper class, and where it makes sense to manage variables or methods might be more likely in subclasses? Since I am not a C # expert, but I really know anything about object-oriented methodologies, I would first schonmal point out that I was not always maintained the principle of data encapsulation . Important to me personally at this point that the code is stable and easy to change and fast. Programmatically Viewed from the perspective or even architecturally aspects, there are certainly more elegant methods, but that should not continue to be relevant here.

Ok, back to the tests that I have stored in the class UserDefinesMethod.cs . Gladly I am open to other suggestions or ideas.

Restrict Trading Hours:








Depending on your taste, you can additionally required parameter declaration in the superclass installed or in the strategy itself I chose the latter, to not always have the option of restrict the trading hours, as it sometimes is just disturbing simply zuzumüllen the parameter range.


Global Order Entry and Exit objects:





has almost every strategy in my entry, stop and target orders. Therefore I have decided to include them in with a superclass.

restrictions on the visibility of the variables (here: protected ) indicates that the variables are inherited as well, as per sub-class are present and may be overridden.

instance variables, to store the connection status to the order server and server price:




So that should be enough for now. The central methods of the class UserDefinedMethods.cs be discussed in part two.

Best regards
darth trader

0 comments:

Post a Comment