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 MGHORBEL, Today, 06:25 AM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by 1001111, Today, 01:35 AM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by tradingnasdaqprueba, Yesterday, 03:42 AM
    11 responses
    40 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by haas88, 03-21-2024, 02:22 AM
    14 responses
    178 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by Skifree, Yesterday, 11:41 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Working...
    X