Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Understanding SetTrailStop();

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

    Understanding SetTrailStop();

    What I want: as soon as the stop order is generated (supposing 0,01 - 1% lower or higher), at each bar closing, the stop orders is cancel and another new one (0,0099) is set up. after 10 bars, the stop will be 0,009.

    Fisrt, I d like to know if SetTarilStop can be used for this purpose:

    second, how?

    SetTrailStop("",CalculationMode.Percent, StopLevelMovel). Supposing StopLevelMovel = 0,01, does it replicate what I want? how can I know the "velocity" of the trail?

    #2
    Hello dafonseca,

    Is it necessary to cancel the order and resubmit a new order? Would it not be acceptable to move the price of the existing order to the new price?

    If you are using SetStopLoss, this order cannot be cancelled. It can be moved to a new price by calling this again at a new price, but it cannot be cancelled after it is set.

    Instead, use an Exit order like ExitLongStopLimit or ExitShortStopLimit and set this to an IOrder variable, then call CancelOrder() and supply the IOrder variable.

    Below is a link to the help guide on CancelOrder().


    Also, below I am providing a link to an example I have posted in a different forum thread that demonstrates how to have a custom breakeven or trailing stop action.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

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