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 ETFVoyageur, Today, 07:05 PM
              0 responses
              7 views
              0 likes
              Last Post ETFVoyageur  
              Started by Orion815, 05-02-2024, 08:39 AM
              2 responses
              18 views
              0 likes
              Last Post Orion815  
              Started by suroot, 02-25-2017, 04:43 AM
              11 responses
              2,551 views
              0 likes
              Last Post Zilvercat  
              Started by Rogers101, 05-05-2024, 11:30 AM
              16 responses
              50 views
              0 likes
              Last Post Rogers101  
              Started by ninza33, Today, 12:31 PM
              2 responses
              12 views
              0 likes
              Last Post ninza33
              by ninza33
               
              Working...
              X