I was wondering if there are any best practices to use during the creation of strategies. For example
1. I want to use multiple entries with multiple stoploss and profit targets. Is it best to use lists or create an individual instance of each order type
eg Order stoploss1, Order stoploss2 OR List<Order> stopLossOrders;
I understand if there is more than 2 SL's then LISTs would be better but for just 2 SLs / PTs is it easier to control as a list or instance?
I ask because I see examples both ways.
2. With reference to the above, in samples I have seen just OnOrderUpdate used and in others both OnOrderUpdate and OnExecutionUpdate
Is it best to use one or the other or both or does it depend on the complexity of the code. Again I ask for clarity sake so that I go down the correct route, your help seems to favour using both.
3. Can you code new classes and access them from within ninjascript if the file is stored in the correct directory. For example if I created a generic manage order class that could be used by many scripts, could I then place this in a directory and reference it by creating an instance of that class.
If anyone can provide any pointers it would be appreciated, thanks
Comment