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

Strategy Disable & Enable Removes Exit Orders

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

    Strategy Disable & Enable Removes Exit Orders

    I have a strategy that enters a position with a stop loss and target order. If I disable and re-enable the strategy both exit orders get cancelled but the position remains opened. When I look at the log the New State is set to Cancelled. Prior to disabling the strategy the orders where in New state = Working. Can anyone shed some light as to what is happening here? Is that by design? Obviously I'd prefer both exit orders to remain in place. My settings below:

    Calculate = Calculate.OnBarClose;
    EntriesPerDirection = 1;
    EntryHandling = EntryHandling.AllEntries;
    IsExitOnSessionCloseStrategy = false;
    ExitOnSessionCloseSeconds = 30;
    IsFillLimitOnTouch = false;
    MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
    OrderFillResolution = OrderFillResolution.Standard;
    Slippage = 0;
    StartBehavior = StartBehavior.WaitUntilFlat;
    TimeInForce = TimeInForce.Gtc;
    TraceOrders = false;
    RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
    StopTargetHandling = StopTargetHandling.PerEntryExecution;
    BarsRequiredToTrade = 3;
    // Disable this property for performance gains in Strategy Analyzer optimizations
    // See the Help Guide for additional information
    IsInstantiatedOnEachOptimizationIteration = true;


    Last edited by bc24fl; 02-04-2021, 12:32 AM.

    #2
    Hello bc24fl,

    Thank you for your post.

    You could determine if exit orders cancel when a strategy is disabled by navigating to Control Center > Tools > Options > Strategies tab. Within the NinjaScript section of the Strategies tab, you may enable or disable automatic cancellation of exit orders. A checkmark displayed means the setting is enabled and orders will be canceled when disabling a strategy.

    See this help guide link for more information - https://ninjatrader.com/support/helpGuides/nt8/index.html?options_strategies.htm#Understandingnin jascriptProperties

    Please let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      I have both unchecked. See image for options.
      Attached Files

      Comment


        #4
        Hello bc24fl,

        Thank you for that information.

        Please write into PlatformSupport[AT]ninjatrader.com with your Log and Trace files as well as an export of your strategy so we may further investigate. In the subject of the email, please use ATTN: Brandon, and in the body of the email provide a link to this forum post.

        Follow the steps below to manually attach your log and trace files to your response.
        • Open your NinjaTrader folder under, "Documents" (sometimes called, "My Documents")
        • Right click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
        • Send the 2 compressed folders as attachments to this email.
        • Once complete, you can delete these compressed folders.
        Exporting - https://ninjatrader.com/support/help...tAsSourceFiles

        Thanks in advance, I look forward to further assisting.
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,403 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by Shai Samuel, 07-02-2022, 02:46 PM
        4 responses
        94 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by DJ888, Yesterday, 10:57 PM
        0 responses
        6 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by MacDad, 02-25-2024, 11:48 PM
        7 responses
        158 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Yesterday, 09:29 PM
        0 responses
        8 views
        0 likes
        Last Post Belfortbucks  
        Working...
        X