Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetTrailStop wih SetStopLoss

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

    SetTrailStop wih SetStopLoss

    Hello

    According to your documentation:
    "The SetTrailStop() method can NOT be used concurrently with the SetStopLoss() method for the same position".

    Suppose I used the SetStopLoss for my first position. Then, after my first position is closed, I want to use a trailing stop, can I call the SetTrailStop before entering the second position?

    Thanks

    #2
    Hello kiss987,

    Thank you for your post.

    If each position in your example used a different Entry Signal Name and you called those specific Entry Signal Names in your Set methods, then yes.

    For example:
    Code:
            protected override void Initialize()
            {
    			SetStopLoss([B]"Entry1"[/B], CalculationMode.Ticks, 10, false);
    			SetTrailStop([B]"Entry2"[/B], CalculationMode.Ticks, 5, false);
            }
            protected override void OnBarUpdate()
            {
    			if (Close[0] > Open[0])
    				EnterLong([B]"Entry1"[/B]);
    			if (Close[0] < Open[0])
    				EnterShort([B]"Entry2"[/B]);
            }
    Please let me know if you have any questions.

    Comment


      #3
      Thank you for your reply.

      What if both entries are using the same signal name but the first entry is already flat? Can I now use SetTrailStop for the second entry?

      Comment


        #4
        Hello kiss987,

        Thank you for your response.

        It would not work in that manner. You could just implement logic to adjust the SetStopLoss() as a trailing stop. We have an example on adjusting the Stop Loss to breakeven that will help get you started: http://ninjatrader.com/support/forum...ead.php?t=3222

        Please let me know if you have any questions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        52 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        142 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        160 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        96 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X