Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Strategy: Move stop to break even + n pips

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

    Strategy: Move stop to break even + n pips

    Hi,

    I followed instructions in this thread to modify a stop loss to break even when n pips unrealized profit:


    This works perfectly fine. I can't though figure out how to move the stop to break even + n pips (example break even + 2 pips). Could anyone help me in the right direction?

    Thanks in advance!

    br,
    Chris

    EDIT: Excuse my stupidity, as simple as this:

    SetStopLoss(CalculationMode.Price, Position.AveragePrice +1 * TickSize);
    Last edited by suroot; 08-02-2017, 07:03 AM.

    #2
    Hello,

    Thank you for the post.

    I am reviewing your inquiry and will be back with a reply shortly.

    I look forward to assisting further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi,

      Thanks - but there is no need, since I figured it out and marked thread as solved with the answer to my question below.

      br,
      Chris

      Comment


        #4
        Can you please post how you did this Suroot?

        I am trying to figure out how to do this as well.

        Comment


          #5
          Hello Rogue_Two,

          suroot updated his original post with the answer to his question.

          SetStopLoss(CalculationMode.Price, Position.AveragePrice +1 * TickSize);
          Please let me know if I can clear anything up for you.
          Chris L.NinjaTrader Customer Service

          Comment


            #6
            Thanks Chris.

            In this case is Position.AveragePrice the entry price of a position?

            Comment


              #7
              Hello Rogue_Two,

              That is correct. Documentation on this property can be found here:

              Chris L.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by algospoke, Yesterday, 06:40 PM
              2 responses
              23 views
              0 likes
              Last Post algospoke  
              Started by ghoul, Today, 06:02 PM
              3 responses
              14 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by jeronymite, 04-12-2024, 04:26 PM
              3 responses
              45 views
              0 likes
              Last Post jeronymite  
              Started by Barry Milan, Yesterday, 10:35 PM
              7 responses
              21 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by AttiM, 02-14-2024, 05:20 PM
              10 responses
              181 views
              0 likes
              Last Post jeronymite  
              Working...
              X