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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        561 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        325 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        547 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X