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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        68 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        38 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        62 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X