Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Price data on specific time frame.

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

    Price data on specific time frame.

    Hi,

    Is it possible to take the data from 9:30AM - 10:30AMtime frame and get the high, low, median, and close of that time frame so I can plot this on a chart without using a 60 minute chart?

    I would like to be able to get that information from the first 5 and 60 minutes of market data after 9:30 AM. This would be based off a 1 minute or 5 minute chart.

    On a 5 minute chart this would be easy as I just need the first 5 minute bar but I do not want to have a seperate 60 minute chart in order to calculate the first 60 minutes.

    Thanks,

    Matt

    #2
    imported post

    Yes, you have to write code which after 10:30 goes X bars back until you cross the 9:30 and manually calculate the values you are looking for.
    DierkNinjaTrader Customer Service

    Comment


      #3
      imported post

      Currently I am using this code to get to a certain time on the chart. Is there a better method for this as it seems this will not work for scrolling to past days on the chart. It only works on the current day.


      CurrentBar - Bars.GetBar(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 9, 35, 0);


      Thanks,

      Matt

      Comment


        #4
        imported post

        - you should refer to "current" time by Time[0] and not DateTime.Now
        - you should use the Open[barsAgo] (or High[barsAgo] etc.) to access the OHLC values and make sure barsAgo >= CurrentBar >= 0
        DierkNinjaTrader Customer Service

        Comment


          #5
          imported post

          Thanks, everything is working now.

          Matt

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by PanicTrades, 05-10-2020, 08:45 AM
          6 responses
          67 views
          0 likes
          Last Post damon_achey  
          Started by soon123, Yesterday, 11:44 PM
          0 responses
          9 views
          0 likes
          Last Post soon123
          by soon123
           
          Started by Hyper, Yesterday, 11:10 PM
          0 responses
          5 views
          0 likes
          Last Post Hyper
          by Hyper
           
          Started by soon123, Yesterday, 10:20 PM
          0 responses
          5 views
          0 likes
          Last Post soon123
          by soon123
           
          Started by cjcj2323, Yesterday, 09:37 PM
          0 responses
          9 views
          0 likes
          Last Post cjcj2323  
          Working...
          X