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