Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitOnClose and Overnight Margin for ES

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

    ExitOnClose and Overnight Margin for ES

    Hi,

    I'm trading ES futures and developing an automated strategies.
    1. I'm setting my time to EST(NY time) and wanted to know when is the ExitOnClose triggered?

    2. If I don't want to hold the contract for overnight margin till what time(EST) I need to sell it? Is it until the lock time 5:30pm EST?

    Thanks in advance!

    #2
    freewind, the ExitOnClose time is tied to the applied session template you use when starting up the strategy via the chart or strategies tab - you should contact your broker directly to clarify margin requirements, normally the overnights are used at the end of the US regular trading day (16 EST).

    Comment


      #3
      i want to close all position when it is 16:14:15. are the following codes correct ?



      if ( ToTime(Time[0]) == 161445)
      {
      ExitLong("", "");
      ExitShort("", "");
      return;
      }

      Comment


        #4
        Hello asteriskstar,

        That is close, although it will only work if there is a bar stamp exactly at 161445. This condition will then never be true for minute charts which always end on the minute.

        A couple alternatives here is using a time range for the bar's time stamps or working off your computer clock.

        if ( ToTime(Time[0]) >= 161400 && ToTime(Time[0]) <= 161500 )

        if ( ToTime(DateTime.Now) == 161445 )
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        115 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        161 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        83 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        127 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        87 views
        0 likes
        Last Post PaulMohn  
        Working...
        X