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.
    Kate W.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Chuso, 01-14-2025, 03:41 AM
    4 responses
    21 views
    0 likes
    Last Post Chuso
    by Chuso
     
    Started by steinberg123, 01-09-2025, 05:48 AM
    3 responses
    38 views
    0 likes
    Last Post steinberg123  
    Started by Mindset, 01-14-2025, 05:33 AM
    2 responses
    12 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by steinberg123, Today, 02:43 AM
    0 responses
    6 views
    0 likes
    Last Post steinberg123  
    Started by r68cervera, Today, 02:22 AM
    0 responses
    7 views
    0 likes
    Last Post r68cervera  
    Working...
    X