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

SetTrailStop() - Percentage?

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

    SetTrailStop() - Percentage?

    Can someone please explain exactly how the percentage offset is calculated in this case?

    Will the stop trail the market price by % specified? If so, as market price increases then will the difference between stop and market increase? (e.g. a 1% stop from $5 is 5c, price eventually increases to $5.50 so stop trails behind by 5.5c)

    Or is the inital stop created % away from entry price then tracks market price by that fixed amount? (e.g. 1% stop on $5 is 5c, price eventually increases to $5.50 but stop trails by 5c)


    Also, if I want to dynamically adjust the trail do I have to give the order a unique name so NT knows which one I am referring to? Is this even possible?

    Thanks!

    #2
    Hello BillyRayValentine,

    Yes, this is how it works. It trails the last traded price by the specified percentage. As the market increases in your favor, the stop will also adjust.

    You can dynamicaly adjust stops and targets. This reference sample helps with this:
    Modifying the price of stop loss and profit target orders
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks Ryan

      With the Price option for setting stop price, can I pass in a variable or does a number (double) have to be implicitly specified? E.g can I pass into the SetTrailStop() command a variable which stores a stop value I am calculating elsewhere in my code?

      Thanks

      Comment


        #4
        Yes, you can use a variable for your stop price.

        However, CalculationMode.Price doesn't make sense in terms of a trail stop, so you would want to use SetStopLoss() and specify your price with this method.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        238 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        383 views
        1 like
        Last Post Gavini
        by Gavini
         
        Started by oviejo, Today, 12:28 AM
        0 responses
        1 view
        0 likes
        Last Post oviejo
        by oviejo
         
        Started by pechtri, 06-22-2023, 02:31 AM
        10 responses
        125 views
        0 likes
        Last Post Leeroy_Jenkins  
        Started by judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        59 views
        0 likes
        Last Post DynamicTest  
        Working...
        X