View Full Version : Using Arrays
03-12-2010, 09:17 AM
I want to use a multidimensional arrays in a Ninja script strategy, i'm having problems with getting my code to run, is it that NT does not support??
What is the answer for storing data in arrays??
03-12-2010, 10:16 AM
LloydH, welcome to the forums - unfortunately this more a general C# concept which can't really support, however you can look into the Arraylist for example on MSDN for this, or search the forum, there have been some discussions on how to use those in scripts for NinjaTrader.
03-14-2010, 04:00 AM
Thanks for your kind welcome, I must say I am finding this forum an invaluable resource to help with my coding in NT. Your reply has helped me solve my issue, many thanks.
Now I have run into another issue:). I want to attach 3x1 Profit targets to a 3 quantity order. Looking through the forum is seems that NT6.x only supports attaching a single 3 quantity Profit Target (ExitShortLimit) to a 3 quantity order, is this a correct assumption?
At the minute, I am having to manually track the price and use a EnterLong(1, ...) position to take the targets of individually, but I'm afraid this is volatile and producing unpredictable results.
Is there anything you can recommend to help please? I have registered for the NT 7 beta so I can try the new SubmitOrder features but I am waiting for the next build to become available.
kind regards and thanks once more for your assistance.
03-14-2010, 11:40 AM
Are you considering using ATM's? Although they work great, I recommend not using them if you need to alter/modify the strategy as price moves after you submit the ATM. ATM's dont' allow for modification after the fact.
If not, please explain your strategy more so I can help.
03-17-2010, 06:05 AM
Thanks for your reply. I have managed to achieve what I wanted to do by using a struct and List to store my IORDER objects. I then manage them using the Advanced Order Handling methods ExitShortStop and ExitShortLimit.
thanks and kind regards