Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Last Bar of Session

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

    Last Bar of Session

    Hello Ninja Team,

    I am looking for a way to check within a strategy if we are at the last Bar of the session.

    This should avoid the execution of an entry signal during the first bar of next days session (e.g. 7:00) which was created on the last bar of a session (19:00) - but not executed because of onBarClose.

    The session parameters(chart) are set to session from 7:00 to 19:00.

    I searched the forum for answers without success.
    Any Ideas ?

    TY

    #2
    I tried Bars.BarsSinceSession !=0 .

    This does not work, because the execution in the morning (e.g. 7:00) has Bars.BarsSinceSession = X , e.g. 31 from the previous session/ day.

    To make it really complicated: my executions are set to OnBarClose, market orders and I use range bars(Alt).


    The problem seems to be that the execution on BarClose of the last bar of session is in reality executed on the next day.

    If I use Range Bars instead of RangeAlt the problem is solved. But is there a way to have RangeAlt nonetheless ?
    Last edited by makra081; 03-09-2009, 06:21 AM.

    Comment


      #3
      Hi makra081, thanks for your posts - have you tried to limit your trading strategy with time filters? Please see this reference sample for details - http://www.ninjatrader-support2.com/...ead.php?t=3226

      Comment


        #4
        Hello,

        TY for replying.

        Sadly that does not solve my problem.

        I set the Chart Session Parameter to 7:00-19:00.

        If there is a entry sig on the last bar - e.g 18:45 - the execution should be done on that day - not the next day !!

        Ninjatrader waits for the new Bar which is not printed before the next day.
        Last edited by makra081; 03-09-2009, 08:01 AM.

        Comment


          #5
          This is expected since I guess you run your strategy on CalculateOnBarClose = true, right?

          So this means the strategy waits for your 15 min bar to close to place orders on the next bar, which is then the first of the new day with your session times setup.

          Comment


            #6
            Yes I use CalculateOnBarClose = true. That is correct.

            Is there any way around this ?

            Comment


              #7
              You could try running your strategy on CalculateOnBarClose = false and then moving your trading signal logic to execute on the first tick of a new bar with if (FirstTickOfBar) ... http://www.ninjatrader-support.com/H...TickOfBar.html

              Of course you want to reference then one bar further back to adjust for this ([0] calls become [1]).

              Comment


                #8
                TY NinjaTrader_Bertrand

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                582 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                338 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                103 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                554 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                552 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X