Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Breakeven Stop

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

    Breakeven Stop

    This method is not working in 6.5.
    Trying to use with Forex.


    SetStopLoss(CalculationMode.Ticks, stoplossticks);

    #2
    This is an acknowledged bug. It will be resolved with next update. Thanks for reporting though.

    Comment


      #3
      Breakeven Stop

      Just want to confirm, not working in Futures strategy either.

      Comment


        #4
        Right, this is true for any instrument types

        Comment


          #5
          Breakeven Stop

          This feature is still not working in Version 6.5.3.
          Jm

          Comment


            #6
            Please be specific.

            Comment


              #7
              Breakeven Stop

              Upon entering a Forex position, not showing original stop loss, and not adjusting to breakeven once 15 pips have been obtained.


              Original stoplossticks set at 50.
              // Resets the stop loss to the original value when all positions are closed
              if (Position.MarketPosition == MarketPosition.Flat)
              {
              SetStopLoss(CalculationMode.Ticks, stoplossticks);
              }

              // If a long position is open, allow for stop loss modification to breakeven
              elseif (Position.MarketPosition == MarketPosition.Long)
              {
              // Once the price is greater than entry price+15 ticks, set stop loss to breakeven
              if (Close[0] > Position.AvgPrice + 15 * TickSize)
              {
              SetStopLoss(CalculationMode.Price, Position.AvgPrice);
              }
              }
              elseif (Position.MarketPosition == MarketPosition.Short)
              {
              // Once the price is greater than entry price+15 ticks, set stop loss to breakeven
              if (Close[0] < Position.AvgPrice + -15 * TickSize)
              {
              SetStopLoss(CalculationMode.Price, Position.AvgPrice);
              }

              Comment


                #8
                [email protected],

                The code you posted works fine on my end. Please test the attached sample and see if it still doesn't work for you on the Simulated Data Feed. Pull the feed to an uptrend and then watch the orders on the Control Center. After you enter long you will see that a stop loss order is also submitted for 50 ticks below entry price. After your 15 ticks over entry price is obtained you will notice the original stop loss is no longer 50 ticks below but actually breakeven.

                To import go to File->Utilities->Import NinjaScript
                Attached Files
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  I have similar quastion

                  How can I tell Ninjatrader when it moves up by 12 ticks that it should breakeven with/ +2 ticks so that I can at least pay off commission's.

                  Comment


                    #10
                    You would use the Position.AvgPrice here + 2 * TickSize as new stop price then in your SetStopLoss call.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    630 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    364 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    105 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    566 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    568 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X