Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trade outside of initial and maintenance margin hours.

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

    Trade outside of initial and maintenance margin hours.

    Is there a way to tell a strategy using strategy builder.

    1. close before initial margin kicks in 3:45-5:00PM CT.
    2. Not trade during 3:45-5:00PM CT
    3. open positions after 5 CT only.
    Last edited by rocketstock; 02-04-2022, 05:59 PM.

    #2
    Hello rocketstock,

    You can use time conditions as a filter to trigger or prevent actions during specific times.

    Below are two examples. One demonstrates preventing trades after the exit on session close event, the other to the time filter reference sample.
    NinjaTrader Community, A common inquiry is that the Exit on close didn't work in a NinjaScript Strategy because there is a position after the exit on close should have occurred. When viewing the log we often find that the Exit on close does indeed exit the position shortly before the end of the session (based on the Exit on

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chelsea. I tried this but seems to be be working. Dont know if the order tab is showing MT or CT.

      I want to avoid holding a position so that initial and maintenance margin don't kick in.

      For long and short - only enter if time is before 2:29 MT or after 4:03 PM MT

      Times[Default input][0].TimeOfDay < new TimeSpan(14, 29, 0)
      Times[Default input][0].TimeOfDay > new TimeSpan(16, 3, 0)


      For close - close everything before 2:30 MT if any position are open account. Close all long and short between 2:29 and 2:30 MT

      Times[Default input][0].TimeOfDay >= new TimeSpan(14, 29, 0)
      Times[Default input][0].TimeOfDay <= new TimeSpan(14, 30, 0)
      Position.MarketPosition != MarketPosition.Flat

      Would these be correct to avoid any initial and maintenance margin?

      Comment


        #4
        Hello rocketstock,

        If you are referring to time zones this will be the time of your local PC clock.

        The conditions appear correct for what you are suggesting.

        If you are unsure, print the time of the bar from the condition action block and see if the times appearing in the output window are in the time range.

        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Great idea. I will do that. Also just to confirm NT margin requirements, I assume are not different from CME. Would the above hours avoid initial and maintenance margins 24/7?

          Comment


            #6
            Hello rocketstock,

            You will need to ask your broker about margin or any other account related items.

            If you were intending to ask the NinjaTrader Brokerage, they can be contacted at [email protected] or 1.800.496.1683.
            If you have any questions, concerns or feedback, or want to open an account, we're here to help. Click here to find the appropriate contact for your needs!
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Thank you! Appreciate your help very much on a weekend.

              Comment

              Latest Posts

              Collapse

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