Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit handling

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

    Exit handling

    When Backtesting for a multi-instrument strategy, with all entries for every instrument being based on the same entry conditions, can one single ExitLong() be used for all open positions or is a seperate ExitLong() needed for each instrument with the signal name specified?

    I have..

    entryOrder1, entry Order2 etc. for each instrument.

    Can I just have one ExitLong() for all entryOrders?

    Or do I need to have ExitLong("", entryOrder1, ""), ExitLong("",entryOrder2, "") etc.?
    Last edited by zachj; 11-10-2013, 03:41 PM.

    #2
    Hello zachj,

    Thank you for your post.

    ExitLong() will close all long positions, there is no need to tie it to all entries orders. If you specify the quantity for the Exit() method it will close that quantity.

    For information on the Managed Order Approach including the Exit() methods please visit the following link: http://www.ninjatrader.com/support/h...d_approach.htm

    Please let me know if I may be of further assistance.

    Comment


      #3
      Just a quick follow up to this, what about with CancelOrder(), I have to have a seperate one for each entryOrder correct? Or can there be a single one as with ExitLong()

      if (entryOrder1 != null){CancelOrder(entryOrder1);}
      if (entryOrder2 != null){CancelOrder(entryOrder2);}

      Comment


        #4
        Hello zachj,

        Thank you for your response.

        CancelOrder() requires the input of an IOrder object, so you will only be able to cancel one order with each CancelOrder() call. For information on IOrder objects please visit the following link: http://www.ninjatrader.com/support/h...nt7/iorder.htm

        Please let me know if I may be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        64 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        149 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        99 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        286 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X