Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple orders created by a loop?

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

    Multiple orders created by a loop?

    Excuse my ignorance. I don't use NT very often and I'm trying to refresh my memory with what is and isn't possible. Can (either managed or unmanaged) you do something like this?

    Buy 10 contracts of something.

    priceToSell = 1000.25;

    for (int i = 0; i <= 9; i++)
    {
    Sell 1 contract at priceToSell
    priceToSell = priceToSell + TickSize;
    }


    It doesn't appear I can do this at first glance since IOrder names have to be defined ahead of time. However, I was looking at ExitLong() and wondering if it was possible.

    Thanks!

    #2
    Originally posted by exitOrder View Post
    Excuse my ignorance. I don't use NT very often and I'm trying to refresh my memory with what is and isn't possible. Can (either managed or unmanaged) you do something like this?

    Buy 10 contracts of something.

    priceToSell = 1000.25;

    for (int i = 0; i <= 9; i++)
    {
    Sell 1 contract at priceToSell
    priceToSell = priceToSell + TickSize;
    }


    It doesn't appear I can do this at first glance since IOrder names have to be defined ahead of time. However, I was looking at ExitLong() and wondering if it was possible.

    Thanks!
    Yes it is. Just make your order directive an order, without assigning it to an IOrder.

    Comment


      #3
      Originally posted by koganam View Post
      Yes it is. Just make your order directive an order, without assigning it to an IOrder.
      Thanks for your reply. Could you elaborate? I don't understand what you mean. I've tried a few different things and I cannot accomplish this no matter what I try,

      Thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      633 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      364 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      567 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      568 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X