Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 lightsun47, Today, 03:51 PM
        0 responses
        5 views
        0 likes
        Last Post lightsun47  
        Started by 00nevest, Today, 02:27 PM
        1 response
        10 views
        0 likes
        Last Post 00nevest  
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        46 views
        0 likes
        Last Post futtrader  
        Started by Option Whisperer, Today, 09:55 AM
        1 response
        14 views
        0 likes
        Last Post bltdavid  
        Started by port119, Today, 02:43 PM
        0 responses
        10 views
        0 likes
        Last Post port119
        by port119
         
        Working...
        X