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 gentlebenthebear, Today, 01:30 AM
        2 responses
        13 views
        0 likes
        Last Post gentlebenthebear  
        Started by Kaledus, Today, 01:29 PM
        2 responses
        7 views
        0 likes
        Last Post Kaledus
        by Kaledus
         
        Started by frankthearm, Yesterday, 09:08 AM
        13 responses
        45 views
        0 likes
        Last Post frankthearm  
        Started by PaulMohn, Today, 12:36 PM
        2 responses
        16 views
        0 likes
        Last Post PaulMohn  
        Started by Conceptzx, 10-11-2022, 06:38 AM
        2 responses
        56 views
        0 likes
        Last Post PhillT
        by PhillT
         
        Working...
        X