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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    131 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    74 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    117 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    111 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    89 views
    0 likes
    Last Post CarlTrading  
    Working...
    X