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 ZenCortexCLICK, Today, 04:58 AM
            0 responses
            2 views
            0 likes
            Last Post ZenCortexCLICK  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            172 responses
            2,280 views
            0 likes
            Last Post sidlercom80  
            Started by Irukandji, Yesterday, 02:53 AM
            2 responses
            17 views
            0 likes
            Last Post Irukandji  
            Started by adeelshahzad, Today, 03:54 AM
            0 responses
            5 views
            0 likes
            Last Post adeelshahzad  
            Started by Barry Milan, Yesterday, 10:35 PM
            3 responses
            13 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X