Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 Aviram Y, Today, 05:29 AM
    0 responses
    2 views
    0 likes
    Last Post Aviram Y  
    Started by quantismo, 04-17-2024, 05:13 PM
    3 responses
    25 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by ScottWalsh, 04-16-2024, 04:29 PM
    7 responses
    34 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by cls71, Today, 04:45 AM
    0 responses
    6 views
    0 likes
    Last Post cls71
    by cls71
     
    Started by mjairg, 07-20-2023, 11:57 PM
    3 responses
    217 views
    1 like
    Last Post PaulMohn  
    Working...
    X