As I develop some strategies, I'm accumulating a growing collection of methods that I would like to share with all of my strategies. I wonder if someone can help with ways of doing this without cut-and-paste...
Can I use polymorphism, so something like:
public class MySubStrategy : MyParentStrategy
where I provide default implementations of OnBarUpdate or OnPositionUpdate? Is there some way of templating so that the OnPositionUpdate comes from one source and OnBarUpdate comes from another? I can create helper methods of course, as long as I pass all necessary properties but it's messy.
And is there some good location to stuff all of the other helper methods and utilities I create? Right now I have a sort of dummy Indicator. It doesn't do anything indicator-esqe, but it's the only way I've found to create a new class which can be instantiated and referenced in Strategies. Feels like a hack. Is there any better way?
Comment