Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetStopLoss() for Shorts?

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

    SetStopLoss() for Shorts?

    I am using the Managed Approach. My strategy does long and short transactions. What I am seeing is that for long positions, this works great:

    SetStopLoss(CalculationMode.Price, Position.AveragePrice - Convert.ToDouble(stopPoints));

    but for a short position, when I do:

    SetStopLoss(CalculationMode.Price, Position.AveragePrice + Convert.ToDouble(stopPoints));

    the StopLoss triggers immediately. How do I o a StopLoss on shorts using the Managed Approach? I do not see a "Buy Stop" function.

    #2
    Hello jamesmjones00123,

    Thank you for your post.

    This is due to the fact you must reset the Stop Loss when the position is flat. This is demonstrated in our reference sample at the following link: https://ninjatrader.com/support/help...of_stop_lo.htm

    Please let me know if you have any questions.

    Comment


      #3
      I do not understand. When the position is flat, SetStopLoss is meaningless. The example is doing this:

      SetStopLoss(CalculationMode.Ticks, 0);

      Am I do call that, and then when I go short, call it again with my

      SetStopLoss(CalculationMode.Price, Position.AveragePrice + Convert.ToDouble(stopPoints));

      ?

      Comment


        #4
        Hello jamesmjones00123,

        Thank you for your response.

        When setting the SetStopLoss() when flat you are setting the function to a specific value for the next position. Then when you enter into the desired direction you set the SetStopLoss to the needed value.

        Please let me know if you have any questions.

        Comment


          #5
          I did what you asked but for Short positions only its stopping out immediately upon entering the position. Is this function really supposed to work with short positions?

          Comment


            #6
            Hello jamesmjones00123,

            Thank you for your response.

            Set it to 4 ticks away instead of 0 ticks away.

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

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            105 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            53 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            35 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            38 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            74 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X