Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom Bar Type - Break after the OPEN of the Day?

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

    Custom Bar Type - Break after the OPEN of the Day?

    Hi,
    We all know the nice functionality to use break at End of Day (EoD), which if activated, avoids bars spanning across day breaks.

    Any idea how I could create a custom bar type doing something similar after the start of the trading session?
    I'd like to align time based bars (e.g. hour) to the TURN OF THE FULL hour truncating the length of the FIRST bar, if the trading session doesn't start at the turn of the hour.

    EoD does this (bar type 1 Hour):
    Alt. 1: 09.30, 10.30, 11.30, 12.30, 13,30, 14.30, 15.30, 16.00 (truncated at end).
    Alt. 2: 09.00, ... 17.00, 17.30 (truncated at end, if end of trading session comes "early" compared to time, ticks, bricks).

    Custom bar type / Break after Open of Day functionality I have in mind should do this (bar type 1 Hour):
    09.30, 10.00 (truncate first bar), 11.00, 12.00, 13.00, 14.00, 15.00, 16.00

    Thank you.
    NT-Roland
    Last edited by NT-Roland; 11-28-2020, 05:37 AM.

    #2
    Hello NT-Roland,

    I want to clarify your goal. You want to mark the end of day from within BarsType script is this correct?

    This would typically be marked by the Trading Hours template. Are you wanting to write a template file and set the Trading Hours template from a BarsType script?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea,
      Thanks for the question. No, that is not what I'm trying to accomplish. I want to align hourly or/and 30 min bars to the clock, if the trading session starts odd.
      If the trading session starts at e.g. 01.15, and I pick hourly bars, I want to create one "short" bar of 45 mins to align the "hourly" bar to the turn of the hour, followed by "regular" bars of 1 hour each until the end of the trading session.
      Same with 30 mins. If the start of the trading session is not a multiple of 30, align to such multiple on the first occasion, i.e. at 01.30 after 15 mins, then continue with "regular" 30 min bars until the end of the trading session.
      Hope this clarifies.
      NT-Roland

      Comment


        #4
        Hello NT-Roland,

        I think I'm getting a better understanding.

        So I do think this would be done in a custom bars type.

        You can check the time with some custom logic to decide when to make a bar, (such as the time.Minute being 30), and then call AddBar() instead of UpdateBar() to break a new bar early.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        50 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        126 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        69 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X