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 FrazMann, Today, 11:21 AM
            0 responses
            1 view
            0 likes
            Last Post FrazMann  
            Started by geddyisodin, Yesterday, 05:20 AM
            8 responses
            51 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by cmtjoancolmenero, Yesterday, 03:58 PM
            10 responses
            36 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by DayTradingDEMON, Today, 09:28 AM
            4 responses
            24 views
            0 likes
            Last Post DayTradingDEMON  
            Started by George21, Today, 10:07 AM
            1 response
            18 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Working...
            X