Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop and Reverse

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

    Stop and Reverse

    How is stop and reverse done using advanced order handling with targets and stops. The Internal Order Handling rules tell me that I cannot use ExitLongLimit() for a target and EnterShortStop() as a stop at the same time. If my stop is hit, I want to:

    exit the position at market on a stop
    cancel the original target order (which might be done automatically)
    enter a reverse position at market (at the same time as the exit)
    enter a new stop order
    enter a new target order

    This is such a common trading strategy that I hope an example is posted somewhere.

    Thanks,

    David
    dbw451

    #2
    Originally posted by dbw451 View Post
    How is stop and reverse done using advanced order handling with targets and stops. The Internal Order Handling rules tell me that I cannot use ExitLongLimit() for a target and EnterShortStop() as a stop at the same time. If my stop is hit, I want to:

    exit the position at market on a stop
    cancel the original target order (which might be done automatically)
    enter a reverse position at market (at the same time as the exit)
    enter a new stop order
    enter a new target order

    This is such a common trading strategy that I hope an example is posted somewhere.

    Thanks,

    David
    dbw451
    Hello David,

    Thank you for your post.

    You can just use "Enter long Position" and "Enter short position" for your strategy. NT will automatically exit your long at market and enter your short so that you don't need to enter exit long and exit short.
    Ray S.NinjaTrader Customer Service

    Comment


      #3
      Thanks RJStein. I understand that EnterShortStop() will exit an open long position and enter a new short position. The ExitLongLimit() is for a target order. I would like to have both an open target order and a open stop/reverse order (which EnterShortStop() possibly handles). In other words, if price moves in my trade direction, I want to exit on a target order. If price moves against my trade direction, I want to exit and reverse at the stop. If I understand the Internal Order Handling rules correctly, I cannot have both ExitLongLimit() and EnterShortStop() active at the same time:

      "Methods that generate orders (excluding market orders) to enter a position will be ignored if:

      A position is open and an order submitted by an exit method (ExitLongLimit() for example) is active and the order is used to open a position in the opposite direction"

      If I cannot have ExitLongLimit() and EnterShortStop active at the same time, how do I program target and stop orders where the stop closes the open position and reverses? Also if the stop order is hit, the target order would need to be canceled and visa-versa before a new target and stop orders would be submitted. I'm pretty sure the functionality is available using ATM, so surely it can be done in a strategy.

      Comment


        #4
        dbw451,

        What you need to do is place in your ExitLongLimit() order. Instead of placing your EnterShortStop() you want to place logic to wait for the price of the stop. When that price hits you want to call CancelOrder() on ExitLongLimit(), wait for cancel confirmation, and then you can fire off your EnterShortStop(). You might as well send it in as a market order at this point in time because your stop price has been hit already and if it were a stop order it would convert to market order anyways.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Ok thanks Josh. That's almost exactly what I was doing. That approach probably works in real-time, but it does not work well in the back-tester. I get 1,2,3,4+ ticks slippage in the back-tester because the back-tester does not allow me to process orders when the stop price is hit within a bar. Order logic can only be processed on the close of each bar. Using the Enter long/short routines avoids the back-tester entry price slippage problem but introduces the Internal Order Handling Rules conflict with the target order.

          One thing I was not doing is waiting for a cancel confirmation. I'll ask about that in a new thread.

          Regards,

          David
          dbw451

          Comment


            #6
            Unfortunately David that is the only way to proceed.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Quanto, Today, 02:17 PM
            1 response
            3 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by cmtjoancolmenero, 04-25-2024, 03:58 PM
            24 responses
            124 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Skifree, Today, 11:21 AM
            3 responses
            10 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by manueldecastro, Today, 01:16 PM
            3 responses
            11 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by tradingnasdaqprueba, Today, 03:42 AM
            9 responses
            35 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X