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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        52 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        142 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        160 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        96 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X