• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Moving StopLoss Order & ExitLongStopMarket()

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

    Moving StopLoss Order & ExitLongStopMarket()

    Hello all!

    I'm creating a breakout strategy and have used various pieces of the strategy examples found in the "Education" section. Basically, I'm doing this:

    OnBarUpdate()
    If (entry signal is met) EnterLong(...);

    OnExecutionUpdate()
    Set stop loss order with ExitLongStopMarket(...)


    My question is this...
    When certain price signals occur, I want to move my stop loss order (to breakeven, etc.)

    Should I subsequently use SetStopLoss() or is there a better approach to changing a stoploss price submitted through ExitLongStopMarket()?
    Last edited by MarkWise; 02-24-2017, 01:16 PM.

    #2
    Hello MarkWise,

    When trying to update an order's price, you would just need to call the same syntax once again with a new price. Using SetStopLoss would be ignored in this situation due to the internal order handling rules of the Managed approach.
    Set() methods that generate orders to exit a position will be ignored if: A position is open and an order submitted by an exit method (ExitLongLimit() for example) is active
    http://ninjatrader.com/support/helpG...d_approach.htm

    When you are ready to change the price, you would instead use ExitLongStopMarket once again with the same signal and from signal name, and the existing order would be modified.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      NT7 Answer?

      In NT7, if one uses SetStopLoss to initiate the Stop Loss order, how does one subsequently update the Stop Loss price? (EnterLongStopMarket mentioned below is not available in NT7.)

      Thanks.

      Comment


        #4
        Hello jeronymite,

        This would be the same process in NT7, you would need to call the same syntax once again to update the orders price from OnBarUpdate. If you are using the wizard this is not possible to do using the Set methods.

        please let me know if I may be of further asssitance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Thanks, Jesse.

          I have several thousand lines of code, so no wizard.

          As for calling it again, it does nothing. From your comments below: "Using SetStopLoss would be ignored in this situation due to the internal order handling rules of the Managed approach".

          That is indeed what I see -- no effect after the initial call.

          Your further advice most welcome.

          Thanks.

          Comment


            #6
            Hello Hello jeronymite,

            Calling the order again would be to update the Stop Loss price if you are hitting managed order rules that is a different situation.

            As your question pertains to NT7 I would suggest creating a new thread for this question in the NT7 forums: http://ninjatrader.com/support/forum...splay.php?f=16.

            Our support would be unable to review a large file like the one you mentioned, if you are having difficulties with the managed order handling rules in your logic, I could instead suggest to either reduce the logic or create a new script that only contains the questionable logic to further test.

            Please let me know if I may be of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Thanks, Jesse.

              The situation is fairly straightforward. I enter a trade and call SetStopLoss. I later call SetStopLoss again with a different price. The second and any subsequent calls do not change the Stop Loss. No errors reported. It's as if it is simply ignored. Why?

              Thanks.

              Comment


                #8
                Discussion moved to NT7 Strategy Development group

                New thread as suggested by Jesse: http://ninjatrader.com/support/forum...d.php?p=498427

                Thanks.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by ct, Today, 08:13 PM
                0 responses
                3 views
                0 likes
                Last Post ct
                by ct
                 
                Started by Lumbeezl, Today, 05:17 PM
                0 responses
                6 views
                0 likes
                Last Post Lumbeezl  
                Started by wishing, Today, 03:33 PM
                0 responses
                10 views
                0 likes
                Last Post wishing
                by wishing
                 
                Started by ATMtrader0001, Today, 01:48 PM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_PaulH  
                Started by RandanAL, Yesterday, 05:13 PM
                1 response
                12 views
                0 likes
                Last Post NinjaTrader_Kate  
                Working...
                X