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 PaulMohn, Today, 03:49 AM
        0 responses
        7 views
        0 likes
        Last Post PaulMohn  
        Started by inanazsocial, Today, 01:15 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by rocketman7, Today, 02:12 AM
        0 responses
        10 views
        0 likes
        Last Post rocketman7  
        Started by dustydbayer, Today, 01:59 AM
        0 responses
        4 views
        0 likes
        Last Post dustydbayer  
        Started by trilliantrader, 04-18-2024, 08:16 AM
        5 responses
        23 views
        0 likes
        Last Post trilliantrader  
        Working...
        X