Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using Arrays

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Using Arrays

    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??
    thanks

    #2
    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.

    Comment


      #3
      Using Arrays

      Hi Bertrand,

      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.
      Lloyd

      Comment


        #4
        Hello,

        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.
        DenNinjaTrader Customer Service

        Comment


          #5
          HI Ben
          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
          Lloyd

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          79 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          45 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          29 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          32 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          65 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X