Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

enter only between 700 - 1615

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

    enter only between 700 - 1615

    Using the wizard , how can I make my strategy enter only after 7 am and exit all at 4:15 pm ?

    I want to have the strategy running before and after these times but need it to only enter on signals that trigger between 7 and 415 .

    I tried having the strategy enter if the volume is high enough but I use tick charts and this made using volume in this way difficult .

    #2
    Hi starrynight,

    Please see this reference sample for creating time filters: http://www.ninjatrader-support2.com/...ead.php?t=3226
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      So if I copy and paste this into my strategies code I've got what I need right ? .......

      /* Checks to see if the time is during the busier hours (format is HHMMSS or HMMSS). Only allow trading if current time is during a busy period.
      The timezone used here is (GMT-05:00) EST. */
      if ((ToTime(Time[0]) >= 70000 && ToTime(Time[0]) < 160000) ||

      Then just run my strategy " exit on close" = true to close open positions .

      Comment


        #4
        No, ExitOnClose does not work with the time filter. It works with your session times. If your filter coincided with the session end time then it would work, otherwise you need to explicitly place exit orders to close your positions at the end of your time range.

        Code:
        if (ToTime(Time[0] >= 160000)
             ExitLong();
        Bear in mind that this code snippet will not work in closing you out of your position if 4PM is market close. You would be submitting your order too late.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Close open orders at a specific time

          I want to leave the session time 12 am - 12 am ( default) but want to close any open position at 3:55 pm so as not to leave an open position during low volume times .

          Can I do this with the wizard ?

          Comment


            #6
            Hello,

            Yes, you can. Just use Time Value > User Definded Inputs. Time value can be found under Time>Time value.

            Then in your actions section put in ExitLong() and/or ExitShort().
            DenNinjaTrader Customer Service

            Comment


              #7
              OK , I tried that . I selected "time value "on the left ( the value shown is present time ), greater than (>) and then "user defined input" on the right . For "user defined input" I selected 1545 ( 3:45 PM ) under default .

              I get back - Return type of left expression 'Date Time' and right expression 'Int32' do not match. You need to select a different item .

              What did I miss here ?

              Comment


                #8
                Hello,

                The data type has to be the same. I am thinking it is not possible now. Sorry about that. I will have someone double check that there is no other way.

                You can program it, but it may not be possible in the Wizard.
                DenNinjaTrader Customer Service

                Comment


                  #9
                  No problem , what I did try is this ....

                  When the following conditions are true:

                  Time value- > Time value-

                  (Value = present time) (Value= 3:55 pm)


                  Do the following:

                  Exit short / Exit long

                  Problem is when I tried it that didnt seem to work . Let me know if I'm on the right path or if anyone has other ideas .

                  Exactly what I'm trying to achieve is to leave my strategies session time 12 AM - 12 AM , run my strategy 24 hrs , but submit exit orders 5 minutes before the NYSE bell .

                  Comment


                    #10
                    Try selecting Time series on the left side, the leave barsAgo at 0, as this sbould give you the current time - then select Time value on the right side and enter your time setting.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    630 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    364 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    105 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    566 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    568 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X