Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

exitling()?

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

    exitling()?

    what is the difference between the two statements below as far as the ""are concerned? Why does on e have one and the other 2 of them?

    enterlong("")

    exitlong("" "")

    is the exitlong reversing?

    #2
    ExitLong() exits the long position. It does not do reversing. There are two "" because one of them is for the signal name of the entry you are trying to exit and the other is for the signal name you want to give the ExitLong() order.

    Please review the Help Guide article regarding ExitLong(): http://www.ninjatrader-support.com/H.../ExitLong.html
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      ExitLong() exits the long position. It does not do reversing. There are two "" because one of them is for the signal name of the entry you are trying to exit and the other is for the signal name you want to give the ExitLong() order.

      Please review the Help Guide article regarding ExitLong(): http://www.ninjatrader-support.com/H.../ExitLong.html
      thanks for the quick response.
      OK, as in
      ExitLong(string signalName, string fromEntrySignal)
      but why the following code produces 1 long and 2 shorts on the exit?

      Code:
      {
                  // Condition set 1
                  if (CrossAbove(A(), a, 1))
                  {
                      EnterLong(DefaultQuantity, "");
                  }
      
                  // Condition set 2
                  if (A()[0] < b)
                  {
                      ExitLong("", "");
                  }
      
                  // Condition set 3
                  if (A()[0] < b)
                  {
                      EnterShort(DefaultQuantity, "");
                  }
      
                  // Condition set 4
                  if (A()[0] > a)
                  {
                      ExitShort("", "");
                  }
              }
      Last edited by mktrend; 01-08-2009, 05:12 PM.

      Comment


        #4
        If you are trying to enter short you do not need to call ExitLong(). EnterShort() will automatically close your long position first and reverse you into a short position.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Josh View Post
          If you are trying to enter short you do not need to call ExitLong(). EnterShort() will automatically close your long position first and reverse you into a short position.
          thanks, that solves the problem.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          558 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          324 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          545 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          547 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X