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 CarlTrading, 03-31-2026, 09:41 PM
                    1 response
                    153 views
                    1 like
                    Last Post NinjaTrader_ChelseaB  
                    Started by CarlTrading, 04-01-2026, 02:41 AM
                    0 responses
                    89 views
                    1 like
                    Last Post CarlTrading  
                    Started by CaptainJack, 03-31-2026, 11:44 PM
                    0 responses
                    133 views
                    2 likes
                    Last Post CaptainJack  
                    Started by CarlTrading, 03-30-2026, 11:51 AM
                    0 responses
                    128 views
                    1 like
                    Last Post CarlTrading  
                    Started by CarlTrading, 03-30-2026, 11:48 AM
                    0 responses
                    107 views
                    0 likes
                    Last Post CarlTrading  
                    Working...
                    X