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 SalmaTrader, 07-07-2026, 10:26 PM
          0 responses
          47 views
          0 likes
          Last Post SalmaTrader  
          Started by CarlTrading, 07-05-2026, 01:16 PM
          0 responses
          22 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 06-17-2026, 10:32 AM
          0 responses
          15 views
          0 likes
          Last Post CaptainJack  
          Started by kinfxhk, 06-17-2026, 04:15 AM
          0 responses
          21 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Started by kinfxhk, 06-17-2026, 04:06 AM
          0 responses
          23 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Working...
          X