Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Putting a Trailing stop into place

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

    Putting a Trailing stop into place

    I've completed coding most of my strategy but I am having trouble putting a stop into place. With the basic strategy I am using right now I run a series of checks on the return values of indicators for Close[0] to Close[2]. I only want to be in one position at a time and would like to set a general trailing stop for every position that I enter to the tune of 1-2%.

    I've already tried putting SetTrailStop(CalculationMode.Percent, 2.0); in my initialize method but it doesn't seem to behave like it should. Any tips here would be most welcome

    #2
    Hello milemke08,

    You may want to enable TraceOrders inside your strategy so that you can trace your orders inside the Output Window. See the following thread that goes over TraceOrders.
    http://www.ninjatrader.com/support/f...ead.php?t=3627

    Using a Stop Loss based upon 1-2% may give you a number to small to be able to use. You may try to use "Ticks".
    http://www.ninjatrader.com/support/h...ttrailstop.htm

    If you are still having issues, could you clarify what results you are getting and what results that you are expecting?

    Let us know if we can be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      I tried what you suggested but it isn't getting me to where I need to be :/ I only want a basic trailing stop to kick in when once the price drops 1-2%

      Comment


        #4
        Hello milemke08,
        To place a 2% stop please try the below code.

        Code:
        SetTrailStop(CalculationMode.Percent, [B]0.02[/B]);
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        368 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        571 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X