Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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


    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.
      Multi-Dimensional Managed Trading
      jeronymite
      NinjaTrader Ecosystem Vendor - Mizpah Software

      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.
          Multi-Dimensional Managed Trading
          jeronymite
          NinjaTrader Ecosystem Vendor - Mizpah Software

          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.
              Multi-Dimensional Managed Trading
              jeronymite
              NinjaTrader Ecosystem Vendor - Mizpah Software

              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.
                Multi-Dimensional Managed Trading
                jeronymite
                NinjaTrader Ecosystem Vendor - Mizpah Software

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by selu72, Today, 02:01 PM
                1 response
                4 views
                0 likes
                Last Post NinjaTrader_Zachary  
                Started by WHICKED, Today, 02:02 PM
                2 responses
                10 views
                0 likes
                Last Post WHICKED
                by WHICKED
                 
                Started by f.saeidi, Today, 12:14 PM
                8 responses
                21 views
                0 likes
                Last Post f.saeidi  
                Started by Mikey_, 03-23-2024, 05:59 PM
                3 responses
                51 views
                0 likes
                Last Post Sam2515
                by Sam2515
                 
                Started by Russ Moreland, Today, 12:54 PM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_Erick  
                Working...
                X