Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

'Break at EOD' & 'Exit on session close' parameter to avoid open trades overnight

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

    'Break at EOD' & 'Exit on session close' parameter to avoid open trades overnight

    Hi,

    Is my understanding of the following correct?

    If 'Break at EOD' is checked FALSE and if a candle does not complete before the end of the day then the candle will continue through to the next day until it closes. If 'Break at EOD' is checked TRUE then the candle will close at the end of the day and a new candle will open at the start of the next day. If a strategy has an open trade at the EOD the 'Break at EOD' parameter has no means to close this open trade at EOD.

    If 'Exit on session close' is checked FALSE and if a strategy has an open trade at the end of the session then the strategy will not execute an order to close the open trade at the end of the session and the strategy will remain in a position through to the next session. If 'Exit on session close' is checked TRUE and if the strategy has an open trade at the end of the session then the strategy will execute an order to close the trade at the end of the session and the strategy would therefore be flat going into the next session.

    The time periods for the session will be determined by the template selected in the 'Trading hours' drop down menu for the strategy.

    The reason I'm seeking clarification is that I want to ensure that my strategies do not hold open trades overnight as I do not want to incur maintenance margin on my account. If I use the 'Exit on session close' parameter checked TRUE then will the strategy send an order to close the trade at the open of the last bar of the session or the close of the last bar of the session?

    Thanks,

    Neil

    #2
    Hello Neil,

    Thanks for your post.

    Yes, it seems that your understanding of these properties is correct.

    If you prefer the bar to satisfy to completion before creating a new bar, regardless of the time of day, you could have the Break At EOD property disabled.

    When the Break At EOD property is enabled, NinjaTrader will break its bars on each new end of day session. From the help guide: "With Break at EOD enabled, your bars are ensured to have a known starting point of which to give you a consistent, repeatable chart. This is especially important for bar types that are not based on time such as Volume and Tick based charts. However, for other bar types such as Range, Point and Figure, or others which are built around price action, enabling this property may cause bars to complete before their criteria has been satisfied."

    See this help guide for more information about Break At EOD and examples: https://ninjatrader.com/support/help...eak_at_eod.htm

    The Exit On Session Close property sets if the strategy will cancel all strategy-generated orders on all strategy instruments and close all open strategy positions at the close of ANY session for multi-time frame/multi-instrument strategies. The number of seconds before the actual session end time is determined by the number of seconds set for Exit On Session Close Seconds. Exit On Session Close Seconds is calculated based on the Trading Hours End of Day property set in the strategy's Trading Hours template. Trading Hour Templates are set up to contain the session start and end times of a specific market or instrument.

    When the Exit On Session Close property is disabled (unchecked) then NinjaTrader will not cancel all strategy-generated orders at the end of the trading session.

    If the Exit On Session Close property is enabled (checked) then NinjaTrader will cancel all strategy-generated orders at the end of the trading session.

    Exit On Session Close: https://ninjatrader.com/support/help...sestrategy.htm

    Please see this forum thread also for more information about Exit On Session Close and a strategy example demonstrating preventing entry after Exit On Session Close: https://forum.ninjatrader.com/forum/...ose#post100666
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Can you please clarify is the EOD exit logic also expected to close all current open positions based on orders generated by the strategy? Is there a special event handler function that one can override to check for additional processing?

      Comment


        #4
        Hello uchauhan,

        The Exit on session close does close all positions opened by the strategy.

        Note, the strategy is able to re-open positions after this, unless explicitly coded not to.

        Below is a link to a forum post that discusses and provides an example.


        There is not an event handler the Exit on session close actions.

        The Exit on session close orders will update OnOrderUpdate() and the TraceOrders information will update OnOrderTrace.
        Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

        Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        61 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        134 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X