Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to resert a TrailingStop price

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

    How to resert a TrailingStop price

    Hi all,

    I am trying to set a trailing stop based on a user Variable0, but I don't know how to resert it whe the estrategy is flat

    This is what I have done:

    if (...Several Conditions...)

    {
    EnterLong(DefaultQuantity, "");
    Variable0 = Low[1];

    SetTrailStop("", CalculationMode.Price, Variable0, false);
    }


    Is it possible?

    Thank you,
    Carlos

    #2
    Hello CarlosTTW,

    Thank you for writing in.

    I would highly suggest taking a look at this reference sample on our support forum for details on how to reset your stop: http://ninjatrader.com/support/forum...ead.php?t=3222

    You can see on lines 52 - 55 how the stop loss is reset.

    Code:
    if (Position.MarketPosition == MarketPosition.Flat)
    {
    	SetStopLoss(CalculationMode.Ticks, stoplossticks);
    }
    While this is in regards to SetStopLoss(), you can easily reset SetTrailStop() to whatever default value you wish.

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    579 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    554 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X