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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          63 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          35 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          54 views
          1 like
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          61 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          48 views
          0 likes
          Last Post CarlTrading  
          Working...
          X