Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Last bar in other time frame

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

    Last bar in other time frame

    Is there a way to check the last bar of 5 minute time frame while the indicator run in 1 minute time frame?

    #2
    Hello edward_bell,

    Thanks for your post.

    Can you provide more context to your question as there is not enough info to assist with? Can you further describe what you are trying to do?

    Is the question pertaining to an indicator or strategy script? If so have you added the 5 minute data series to it?
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      It is an indicator running on 1 minute chart and I already added the 5 minute time frame in the Initialize section. I just want to know if the bar is the last close historical bar in 5 minute chart.

      Comment


        #4
        Hello edward_bell,

        Thanks for your reply.

        Assuming that the 5 minute data series is the only added data series. If you are running with CalculateOnbarClose = true then you can refer to the close of the last historical bar with Closes[1][0] where 1 refers to the 5 minute added data series and [0] refers to the last completed 5 minute bar.

        If you are using CalculateOnBarClose = false, and connected to live or replay data, then use Closes[1][1] where the first 1 refers to the 5 minute data series and the second 1 will refer to the last completed bar of the 5 minute data series. Note that in this case Closes[1][0] would refers to the currently forming 5 minute bar.

        For a complete understanding please review: http://ninjatrader.com/support/helpG...nstruments.htm in particular the section " How Bar Data is Referenced " for a good illustration of the differences.
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        18 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        1 view
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        6 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Started by alifarahani, Today, 09:40 AM
        6 responses
        41 views
        0 likes
        Last Post alifarahani  
        Working...
        X