Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get highest of the day when running on 5 min bars

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

    How to get highest of the day when running on 5 min bars

    Hi,

    I run a strategy on 5 min bars.
    How can I can get the highest of the current day ?
    If add period type day and use Highs[1][0], then it takes the yesterday high.

    Is there any way to get number of bars since the begging of the day ?
    If yes, then I can write a method for it...

    10x,

    #2
    Hello,

    There are a number of ways to get the current day high - the easiest would be using the CurrentDayOHL().High[0] method.



    You could also use MAX(High, Period);




    BarsSinceSession will return the number of bars that have completed since the beginning of the session template:

    MatthewNinjaTrader Product Management

    Comment


      #3
      Originally posted by shayhz View Post
      Hi,

      I run a strategy on 5 min bars.
      How can I can get the highest of the current day ?
      If add period type day and use Highs[1][0], then it takes the yesterday high.

      Is there any way to get number of bars since the begging of the day ?
      If yes, then I can write a method for it...

      10x,
      "begging of the day" (sic) is imprecise. What exactly do you mean?
      • Session begin? Remember that many futures sessions start in the afternoon, not morning?
      • When the date changes over at midnight?
      • Start of the trading day?

      Comment


        #4
        I meant the beginning of the trading day for stocks, so I understand that this is "BarsSinceSession".
        Thanks for the replies.
        I made the code changes and now I'm waiting for Monday to check it

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        43 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        124 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        65 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