They have different prices. They must be tracked whether executed or not. I need to keep all this information for each group, signal name, IOrder reference, trail stop amount, stop loss amount, etc.
When I cancel or change the order, I need to use all of those again.
This is a PERFECT opportunity to make a class to contain all of this for good object oriented design. I call this the "OrderGroup" class.
However, in my "OrderGroup" subclass, it lacks access to the functions like EnterLongLimit() or data object. So I tried the following:
1. I tried making my OrderGroup class extend Strategy. That gave it access to all the functions. But when I try to load this strategy onto a chart, NT crashes and dies completely.
2. So I tried passing in a reference to the Strategy object on the constructor of my OrderGroup class. But then it complains that EnterLongLimit() and other information are all protected methods. Why did you make them protect? That means they can ONLY be called from within the strategy class.
3. Now, I am trying to to continue with number 2 above make making a public LongLimit() method in my strategy that simply calls the protected EnterLongLimit(). That compiles find but NT still horribly crashes when it tries to load the strategy onto a chart.
I have commented out the code related to my OrderGroup class and then it loads onto the chart fine.
Is there any way to do this other than in the Strategy object itself? I was excited about your support of C# as NinjaScript due to the object oriented nature making it possible to use encapsulation and other good design to simplify maintenance of my strategies.
Please advise if you know of another good way to handle multiple order groups withing a strategy.
Wayne
Comment