Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trailing Stop

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

    Trailing Stop

    Hello, I am using Strategy Builder. I have already created a strategy, and I need to add a trailing stop to it using Strategy Builder.

    I need to be able to trail my stop right away to breakeven entry after few tick for example 20 ticks (but I still need to have the ability to change this number to my liking) also I need to have an offset added to the breakeven, so for example, if the price reached 20 ticks in profit, I would like to have the stop loss moves directly to breakeven price plus an offset of 1 tick (also I would like to have the ability to change that number as well)

    Moreover, if possible I would like to start trailing my stop loss along with the price. for example: if my stop loses after 20 ticks moved to breakeven, I want the stop loss to move 1 tick with each tick the price moves into profit (I would like to have the ability to change that number also)

    Can you please create a "cs" file for me on the steps I need to make this work?

    Thank you so much,
    Best Regards.

    #2
    Hello Mahmad1323,

    Thank you for your post.

    While the support team cannot build this strategy for you, we do have existing example scripts built in the Strategy Builder that demonstrate breakeven and trailing behavior.

    They can be found at the link below:



    Please let us know if you have any further questions.

    Comment


      #3
      Thank you so much, that is what I wanted. i wanted an example for it to do it. i have a quick question, should I implement both breakeven and trailing into my strategy in order to get what I want right?
      the breakeven file will just break the price even after a certain tick but it won't trail. so in order for me to trail the price after the breakeven I have to implement the trailing file into the strategy as well right?

      Comment


        #4
        Also, when I implemented the breakeven example, it had only options for longs; it did not have the shorts settings. I tried to reverse the settings for the long to make them for shorts, but every time it takes a short, the strategy will give me an error, and it cancels itself. So, can you please have an updated one showing me the settings for the short? PLEASE.

        Also, I have a quick request if possible please, I would like to have the option to add an offset after the breakeven, for example, if I have the strategy to breakeven after 20 ticks I would like to have the option to add few tick to the breakeven. for more explanation, I would like to price to breakeven after 20 ticks +1 tick or 2 ticks (I would like to have the option to put how many ticks I want).

        Thank you so much for your help and waiting eagerly for your response.

        Comment


          #5
          Hello,

          "the breakeven file will just break the price even after a certain tick but it won't trail. so in order for me to trail the price after the breakeven I have to implement the trailing file into the strategy as well right?"

          Yes, you would need to combine the logic if that's what you're looking to do.

          Also, I have a quick request if possible please, I would like to have the option to add an offset after the breakeven, for example, if I have the strategy to breakeven after 20 ticks I would like to have the option to add few tick to the breakeven. for more explanation, I would like to price to breakeven after 20 ticks +1 tick or 2 ticks (I would like to have the option to put how many ticks I want).
          Unfortunately, in the support department at NinjaTrader it is against our policy to create, debug, or modify, code or logic for our clients. Further, we do not provide C# programming education services or one on one educational support in our NinjaScript Support department. This is so that we can maintain a high level of service for all of our clients as well as our associates.

          A detailed and specific script such as the one you're requesting would be outside the scope of our support.

          That said, through email or on the forum we are happy to answer any questions you may have about NinjaScript if you decide to code this yourself. We are also happy to assist with finding resources in our help guide as well as simple examples, and we are happy to assist with guiding you through the debugging process to assist you with understanding unexpected behavior.

          You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services.

          Please let me know if you would like a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.​

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          62 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          134 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          75 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          45 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          50 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X