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 Trailing Stop

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

    Strategy Trailing Stop

    I am new to coding. I painfully built a strategy in the strategy builder, but now the remaining part of the strategy is beyond the capabilities of the strategy builder. I am wanting to code a break even and a trailing stop, but I haven't a clue how to do it. Can someone please share the code needed and also where to add the code in the existing strategy? Please find below my idea:

    Move "stop loss" +3 ticks for every +1 tick the market moves in the right direction. Stop "stop loss" advancement once breakeven (entry level) is reached.
    Then, once the market moves to +25 ticks, move to +5 ticks.
    Then, once the market moves to +40 ticks, move to +25 ticks.
    Then, once the market moves to +75 ticks, move to +50 ticks and then trail the market by 25 ticks thereafter.

    I would also like to be able to adjust these settings in the parameters screen of the strategy.

    Thank you tremendously for your help!!!

    #2
    Hello gregorious13,

    Thanks for your post.

    You could use Exit order methods and add coding logic in the Strategy Builder to accomplish creating a breakeven or trailing stop.

    Please note that you would not be able to use the Exit methods and the Set methods in the Stop and Targets window as that creates a violation of the Managed Approach Internal Order Handling Rules, linked here: https://ninjatrader.com/support/help...d_approach.htm

    See the educational reference sample scripts in the forum thread below that my colleague Chelsea has created regarding Strategy Builder breakeven and trailing stop in the Strategy Builder.
    https://ninjatrader.com/support/foru...der#post806596

    Please let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Sounds complicated...lol. I will give it a try.

      Comment


        #4
        Ok, this is above my pay grade. Can someone walk me through how I would set this up in the strategy tester? I looked at the two examples given, but I can't make sense of the logic, and the strategy builder guide doesn't help at all. Thank you.

        Comment


          #5
          Hello gregorious13,

          Thanks for your note.

          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 in our support. This is so that we can maintain a high level of service for all of our clients as well as our partners.

          Something you could consider is contacting 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. If you would like our NinjaTrader Ecosystem team follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request, please reach out to vendorsupport[AT]ninjatrader.com.

          Let us know if we may assist further.
          Brandon H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by cre8able, Yesterday, 01:16 PM
          3 responses
          11 views
          0 likes
          Last Post cre8able  
          Started by ChartTourist, Today, 08:22 AM
          0 responses
          6 views
          0 likes
          Last Post ChartTourist  
          Started by LiamTwine, Today, 08:10 AM
          0 responses
          2 views
          0 likes
          Last Post LiamTwine  
          Started by Balage0922, Today, 07:38 AM
          0 responses
          5 views
          0 likes
          Last Post Balage0922  
          Started by JoMoon2024, Today, 06:56 AM
          0 responses
          6 views
          0 likes
          Last Post JoMoon2024  
          Working...
          X