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

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 Marklhc1988, 04-19-2023, 11:11 AM
    12 responses
    569 views
    1 like
    Last Post victor68133  
    Started by nicthe, Yesterday, 02:58 PM
    1 response
    9 views
    0 likes
    Last Post nicthe
    by nicthe
     
    Started by percy3687, 05-17-2024, 12:28 AM
    3 responses
    30 views
    0 likes
    Last Post percy3687  
    Started by SilverSurfer1, Yesterday, 01:33 PM
    0 responses
    12 views
    0 likes
    Last Post SilverSurfer1  
    Started by ETFVoyageur, Yesterday, 10:27 AM
    2 responses
    19 views
    0 likes
    Last Post ETFVoyageur  
    Working...
    X