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

Clarification wrt SetStopLoss cancellation

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

    Clarification wrt SetStopLoss cancellation

    Hello,

    I want to make sure that I am understanding the documentation correctly with respect to SetStopLoss and its life cycle.

    https://ninjatrader.com/support/help...d_approach.htm

    On the above page it states the following:
    • By default, orders submitted via Entry() and Exit() methods automatically cancel at the end of a bar if not re-submitted
    Is this also applicable to SetStopLoss()?
    Is SetStopLoss() automatically cancel at the end of a bar is not re-submitted?

    In other words, there is no isLiveUntilCancelled parameter for SetStopLoss().

    Therefore, if I used something similar to the following code, is it necessary to resubmit the SetStopLoss() for every OnBarUpdate() that is called on the primary series for a multi-time frame strategy?

    Code:
     protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time)
    {
    
         if (execution.Order.OrderState == OrderState.Filled)
         {
                stopOrder = SetStopLoss(CalculationMode.Price, someValue);
    
         }
    
    
    }

    #2
    Hello Epistemophilic,

    Thanks for your first post on the forums!

    The set methods will continue to provide the orders until the entry position is closed, there is no need for additional coding.

    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by lorem, Yesterday, 09:18 AM
    4 responses
    14 views
    0 likes
    Last Post lorem
    by lorem
     
    Started by Spiderbird, Today, 12:15 PM
    0 responses
    5 views
    0 likes
    Last Post Spiderbird  
    Started by cmtjoancolmenero, Yesterday, 03:58 PM
    12 responses
    42 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by FrazMann, Today, 11:21 AM
    0 responses
    6 views
    0 likes
    Last Post FrazMann  
    Started by geddyisodin, Yesterday, 05:20 AM
    8 responses
    52 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X