Announcement

Collapse
No announcement yet.

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    41 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    124 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    64 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X