Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Stops, Multiple Timeframes

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

    Multiple Stops, Multiple Timeframes

    Good morning.


    I have two custom methods (SetFastTrail() and SetSlowTrail()) that use the SetStopLoss() method to set and update stops OnBarUpdate(). OnBarUpdate() is split into two periods using BarsInProgess.

    My primary period is 1-Day, and my secondary period is 5-Minute. Can I set two different stops that run in two different timeframes against one entry using the SetStopLoss() method? Or, do I need to code my own SetStop function to achieve this?

    Cheers,

    Kyle






    #2
    Hello kylegee,

    Thank you for your post.

    No. You'd run afoul of order handling rules that the Managed Approach uses, and the second SetStopLoss call would be ignored. Specifically:

    Methods that generate orders to exit a position will be ignored if:

    •A position is open and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction

    •A position is open and an order submitted by a set method (SetStopLoss() for example) is active


    This would be because if both stops are hit and both are for the full size of the position this would put you in an overfill situation.

    You could get around this by using the Unmanaged approach which does not use these order handling rules. However, you must ensure to handle overfill situations, rejections and errors on your own, which requires advanced programming skill.



    Please let us know if we may be of further assistance to you.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    62 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    134 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X