Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit on Close w/ Multiple Conditions

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

    Exit on Close w/ Multiple Conditions

    Hi,

    I have a trading Strategy with 4 set Conditions. I only want to utilize the following script ExitOnClose = true for 2 of those conditions, which is Condition 3 and 4 below. Is this possible?


    // Condition set 1
    if (CrossAbove(...))
    {
    EnterLong(DefaultQuantity,"EnterLong");
    }
    // Condition set 2
    if (CrossBelow(...))
    {
    EnterShort(DefaultQuantity,"");
    }
    // Condition set 3
    if (CrossBelow(...))
    {
    EnterShort(DefaultQuantity,"");
    }
    // Condition set 4
    if (CrossAbove(...))
    {
    EnterLong(DefaultQuantity,"");

    }




    Thank you,


    #2
    Scarlett09, ExitOnClose would work on a per script basis and include all conditions. You could though disable it and custom handle the exits via checking against Time[0] (the bar timestamp). If you keep track which entry lead to the current trade, then you would know when to raise your custom exit on close and when to hold as you desired.

    Comment


      #3
      Thanks, now is there a way to add scipt which will Sync my account position when the new trading session starts. In particular I am looking to Sync my position to Condition 1 (meaning enter a Long position) if Condition 3 or Condition 4 were closed using the ExitonClose script from the prior session?

      Comment


        #4
        Scarlett09, the strategy scripts would not cross communicate but there's a sync function for every script inbuild in NT -



        When you enable your script, it would go through the historical calculation part and come up with a strategy position it would hold and then offer (if needed) to send a market order to your account to establish sync.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        65 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