Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trailing Stop & Hard Stop

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

    Trailing Stop & Hard Stop

    Hello,

    I would like to have both a trailing stop and a hard stop. It seems as though I can only do one or the other using the Strategy Wizard. If I already have a hard stop from the entry price, how can I also add a trailing stop? What would the code (combination of both trailing and regular stop) look like?

    Thanks!

    #2
    Hello agnetzley,
    Unfortunately you cannot use both the SetStopLoss and the SetTrialStop in the same code. However if you give unique names to the entry/stops then you can do it. Please see the attached screenshot to do it.

    The SetTrailStop() method can NOT be used concurrently with the SetStopLoss() method for the same position, if both methods are called for the same position (fromEntrySignal) the SetStopLoss() will always take precedence. You can however, use both methods in the same strategy if they reference different signal names.
    Attached Files
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      So if I have two orders with different names in the same Set #, which one will be activated? Will both be activated or only 1 (i.e. Long 1 or Long 2 as you have it in your screenshot)? How will it decide?


      Or... If I have the code set with only a stop loss, can I manually enter a trailing stop into TWS once a position is opened without it having any effect on the NT stop and strategy?

      Thanks!

      Comment


        #4
        Hello agnetzley,
        Both the orders will be activated depending on what Entries per direction and Entry handling you have set from the strategy parameter box.




        We would not recommend manually changing the orders in TWS for any order generated via a NinjaScript strategy.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Shouldn't this work?

          Hey Guys,
          I have been trying to work through this problem for several days now and need some help.
          I'm trying to add figure out how to put together a 2 contract entry with a trailing stop.
          I seem to get short trades to work properly but long trades enter and exit immediately
          and are shown on the trade summery as one contract exit name "Long2".
          I named the strategy trailstop, it uses sma10 and 25 cross on both short and long.
          I have tried this with 1 min charts and tick charts using the NT range bars.
          Any help would be appreciated
          Attached Files

          Comment


            #6
            Hello Riverend,

            Thank you for your post.

            Please provide screenshots of the Conditions and Actions tab that shows the Sets for the Long1 and Long2 entries.

            I look forward to your response.

            Comment


              #7
              Originally posted by Riverend View Post
              Hey Guys,
              I have been trying to work through this problem for several days now and need some help.
              I'm trying to add figure out how to put together a 2 contract entry with a trailing stop.
              I seem to get short trades to work properly but long trades enter and exit immediately
              and are shown on the trade summery as one contract exit name "Long2".
              I named the strategy trailstop, it uses sma10 and 25 cross on both short and long.
              I have tried this with 1 min charts and tick charts using the NT range bars.
              Any help would be appreciated
              Where are you setting your Stop?
              If in OBU, did you reset your Stop when you go flat?
              Last edited by koganam; 04-29-2013, 09:41 AM. Reason: Corrected spelling.

              Comment


                #8
                Originally posted by NinjaTrader_PatrickH View Post
                Hello Riverend,

                Thank you for your post.

                Please provide screenshots of the Conditions and Actions tab that shows the Sets for the Long1 and Long2 entries.

                I look forward to your response.
                PatrickH,
                Thanks for your quick response. I see the problem now. I selected Enter short and named it Long1 and Long2. Should have been Enter short. Work like it should now. Dumb mistake on my part.. Thanks for your time

                Comment


                  #9
                  Originally posted by koganam View Post
                  Where are you setting your Stop?
                  Id in OBU, did you reset your Stop when you go flat?
                  Thanks for your help I will look into how to do this. Just learning how to do this stuff

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by algospoke, Yesterday, 06:40 PM
                  2 responses
                  23 views
                  0 likes
                  Last Post algospoke  
                  Started by ghoul, Today, 06:02 PM
                  3 responses
                  14 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by jeronymite, 04-12-2024, 04:26 PM
                  3 responses
                  45 views
                  0 likes
                  Last Post jeronymite  
                  Started by Barry Milan, Yesterday, 10:35 PM
                  7 responses
                  22 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by AttiM, 02-14-2024, 05:20 PM
                  10 responses
                  181 views
                  0 likes
                  Last Post jeronymite  
                  Working...
                  X