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 Tin34, Today, 03:30 AM
        2 responses
        15 views
        0 likes
        Last Post Tin34
        by Tin34
         
        Started by sastrades, Yesterday, 09:59 AM
        2 responses
        29 views
        0 likes
        Last Post brucerobinson  
        Started by ETFVoyageur, Today, 12:52 AM
        1 response
        15 views
        0 likes
        Last Post Leeroy_Jenkins  
        Started by lollers, Today, 03:26 AM
        0 responses
        10 views
        0 likes
        Last Post lollers
        by lollers
         
        Started by aliyahany, Today, 03:16 AM
        0 responses
        2 views
        0 likes
        Last Post aliyahany  
        Working...
        X