Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Close position on session end + STAY CLOSED

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

    Close position on session end + STAY CLOSED

    Hi-

    How can I programmatically access session times for an instrument?

    Close position at end of session is great but unfortunately is not programmed to *keep the instrument closed*. So if any new signals come up, you're back in a position w/o a mechanism to keep it closed. Need a filter here -

    #2
    Hello cgeorgan,

    Can you please verify if you refer to NinjaScript strategies or the Automated Trading Interface.

    If you refer to NinjaScript strategies you can define the session begin and end times in the Strategy Parameter window, so it will not run on data outside these times.

    The session begin and end times are replaced by session templates in NinjaTrader 7.
    JasonNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jason View Post
      Hello cgeorgan,

      Can you please verify if you refer to NinjaScript strategies or the Automated Trading Interface.

      If you refer to NinjaScript strategies you can define the session begin and end times in the Strategy Parameter window, so it will not run on data outside these times.

      The session begin and end times are replaced by session templates in NinjaTrader 7.
      Ninja Script strategies (unmanaged).

      What's important is not only closing before session end - which can be several minutes (not seconds) before the official close. It's also *staying* closed. Thus, I need to know how to access an instrument's session times within my entry signal algorithm -

      Comment


        #4
        This is possible. Please see the sample at the link below for a time filter.


        Orders will only be placed within the hours you define as acceptable trading hours. There will not be orders submitted outside these hours.
        JasonNinjaTrader Customer Service

        Comment


          #5
          Similiar issue: Not Closing on defined session end time.

          I did a walk forward test today of a strategy on live data. I use Zen-fire, I also use NT 6.5 and a Range bar chart. My strategy is set so that it only trades between 9:00 AM EST and 4:00 PM EST. Therefore I assume that it should close any open positions at 4:00 PM, today it did not do this.

          Maybe I am missing something, the strategy was created in the strategy wizard, I set the entry orders for both short and long positions to trade between 9:30 AM and 4:00 PM.

          This is how it appears in the strategy wizard:
          ToTime(Time[0]) >= ToTime (9.30.0)
          ToTime(Time[0]) <= ToTime (16.0.0)

          Exit on Close is set to True on the chart running the strategy. I assume it should exit any open positions at 4:00 PM.

          Thank you for your help.
          Last edited by NTWolfe; 07-13-2010, 03:25 PM.

          Comment


            #6
            NTWolfe,

            Exit on Close does not follow custom logic you place in like ToTime() checks. ExitOnClose works off of the session end time of the chart. This is determined in the chart properties. In NT6.5 you can bring it up by right clicking in the chart and then selecting Properties.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Is there a way to ensure all open positions are closed at a specified time within the strategy wizard.

              If I set my session begin and end times other than on a 24 hour chart my indicators are off. I need to be able to see 24 hours worth of data but only have my trades take place within a certain time frame.

              Exit on close won't work for me.

              Thank you.

              Comment


                #8
                Yes, you could setup Time conditions in your wizard conditions and then issue ExitLong / ExitShort not tied to a specific signal name to exit open positions managed by the strategy.

                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by proptrade13, Today, 11:06 AM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Started by quantismo, 04-17-2024, 05:13 PM
                4 responses
                31 views
                0 likes
                Last Post quantismo  
                Started by love2code2trade, 04-17-2024, 01:45 PM
                4 responses
                32 views
                0 likes
                Last Post love2code2trade  
                Started by cls71, Today, 04:45 AM
                2 responses
                10 views
                0 likes
                Last Post eDanny
                by eDanny
                 
                Started by kulwinder73, Today, 10:31 AM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_Erick  
                Working...
                X