Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple time frame ADX calls

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

    Multiple time frame ADX calls

    Hi all, I have a strategy that uses day (primary bars, index 0) and minute (secondary bars, index 1) timeframes. I'd like to compare yesterday's ADX with today's. ADX with index 0 will give yesterday's value. My question is how to access ADX for the current day before the current day's bar is complete? Similar to obtaining CurrentDayOHL() but for ADX? I hope I have explained this well enough!
    Thanks & regards
    Helen

    #2
    Hello Helen,
    Thanks for writing in and I am happy to assist you.

    To assist you further may I know have you set CalculateOnBarClose to true or false.


    I look forward to assisting you further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Hello Joydeep,
      CalculateOnBarClose is true and and the code which is using ADX calls is executed each minute.
      Thank you for your help. Helen

      Comment


        #4
        Hello Henlen,
        Thanks for the confirmation.

        If you set CalculateOnBarClose (COBC) to true then unfortunately the calculations will be a bar late. To get the calculations based on the latest bar you have to set COBC to false. If you want to calculate the strategy logic only once then you can use the FirstTickOfBar to separate your strategy logic, while still calculating the realtime values of the BarsArray
        .
        Please refer to this sample code which demonstrates this


        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Joydeep, Thank you for your reply. I will have a look at the link you have sent and ask questions as needed. Rgds Helen

          Comment


            #6
            Hello Helen,
            Thanks for your note.

            Please let me know if I can assist you any further.
            JoydeepNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, Yesterday, 10:06 AM
            0 responses
            20 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            18 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            14 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            9 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            40 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X