Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IOrder Query

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

    IOrder Query

    Hi NT Support,

    It might be a stupid question, I'm running a strategy that makes use of IOrders, I declaire the following variables in the script:

    Code:
    	
    private IOrder entryOrderLong 	= null;
    private IOrder stopOrderLong 	= null
    private IOrder takeProfitOrderLong = null;
    that I then correctly manage in the OnExecution() and OnOrderUpdate() sections.

    However now I have the need to use also an Exit Strategy at Market, usually I would use
    Code:
    ExitLong(0,stopOrderLong.Quantity,"ExitLong","Long");
    My question is:
    Do I need to declare a variable such as exitOrderLong = null; and then use:
    ExitLong(0,stopOrderLong.Quantity,"ExitLong","Long ");

    or isn't this necessary because it doesn't make sense?

    #2
    Hi,

    No, you do not need to assign an IOrder object. Unless you wish to check various order properties as you're doing on OnExecution, etc. If you just want to exit the long position, you can just call the ExitLong() method as you're doing without having to declare the object.
    MatthewNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    648 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    572 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X