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

How does SetTrailStop operate?

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

    How does SetTrailStop operate?


    I'm unclear exactly how SetTrailStop works. Say I do:

    SetTrailStop(6 ticks);
    SetProtiftTarget(10 ticks)
    EnterLong()

    Say the market goes up 8 ticks, then down 7 ticks, and then up 12 ticks. It's unclear to me if my profit target or the trailing stop would get hit first?

    Thanks,



    #2
    Hello timmbbo,

    That would depend if a price is met for the stop before the profit target. If the current price allows for the trailing stop to be filled when it moves back down that would happen otherwise your profit target would fill if the price reaches that point.

    Trying to visualize this in text is not generally as helpful as visualizing what is happening in the platform. I would suggest using one of the simulation tools to view this happen in realtime so you can see specifically how the order reacts in that use case.

    The Simulated data feed can be used to test these situations and so can the playback connection. The simulated data feed allows you to physically trend the market how you want so that is good to use for triggering specific conditions like moving one direction and then back in the other direction.

    The trail stop is also affected by the Calculate setting, depending on the scripts configuration will affect how the trail moves which could affect the outcome. Here is the note from the help guide about this: Trail stop orders are modified based on the strategies 'Calculate' settings. In the case of 'Calculate' on bar close, when the bar closes the trail stop order modification will occur using the closing price of the bar as the reference price to apply the trail offset.
    Depending on how the script is set up your scenario could play out in a few different ways. In one situation with OnBarClose calculation, if a bar does not close during that price movement we may not see the stop amended to a new price so you may end up hitting the profit target. In another case if the stop trails to a new price we may see that fill instead if the market allows for it.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by BarzTrading, Today, 07:25 AM
    2 responses
    15 views
    1 like
    Last Post BarzTrading  
    Started by devatechnologies, 04-14-2024, 02:58 PM
    3 responses
    19 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by tkaboris, Today, 08:01 AM
    0 responses
    3 views
    0 likes
    Last Post tkaboris  
    Started by EB Worx, 04-04-2023, 02:34 AM
    7 responses
    162 views
    0 likes
    Last Post VFI26
    by VFI26
     
    Started by Mizzouman1, Today, 07:35 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X