Quote from nonlinear5:
I hope so, too. The JSystemTrader design is very similar to yours (although JSystemTrader is more narrow in scope), so we are pretty much on the same page. However, there may be some confusion because of the class naming, so it would be good to define each class responsibilities explicitly.
As I cover each class and perhaps document with UML, responsibilities should become clearer.
It looks to me that your SignalGenerator is acting as a) a signal generator, b) a trading strategy, c) a trader, and d) a money manager. Given your apparent emphasis on pure OO design, it seems that SignalGenerator is too heavy with its responsibilities.
As per earlier post, signal generation could be encapsulated elsewhere outside of the class if needed.
I haven't covered the money management/position sizing component yet or indeed other possible order filters so that is yet to come.
I have found that breaking things up into too many components can lead to practical difficulties for strategy development. The main issue is sharing common data between components.
It's interesting to note the SmartQuant documentation referred to me shows that the componentized model with separate components for entry,exit,money,risk,exposure etc. has effectively been superceded by an architecture that uses only a single component for all of those functions. I can only guess the reasons why. I think there is a middle ground though.
I don't have any particularly strong emphasis on pure OO design. I'm just going about things in a way that seems logical to me and is conducive to a certain level of flexibility.
So, what I suggested in my previous post is that that functionality would fall quite naturally to that class scope, but anything beyond should be defined elsewhere.
Let's just say it was mis-named. SignalGenerator has been renamed to Trader.
I am also a little confused by the PositionManager...That's fine, too, but what class performs money management then?
I'll be covering the PositionManager and money management at some point in the future.
In your design, perhaps it's a function of OrderManager?
Yes, OrderManager simply keeps a list of orders and tracks their status, fill amounts etc. and executes orders submitted to it. It's a fairly dumb component with the only intelligence perhaps being to simulate complex order types that are not supported by the broker.
I'm aware that different people attach different semantics and concepts to common names so there is a lot of room for confusion. I'm totally flexible on naming so any suggestions are welcome.
Actually, if required, it is possible to do a full ahead-of-time compilation to native code using one of the commercial or GNU tools out there. I have never done this myself and don't plan to.