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 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