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

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.

    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

        Comment


          #5
          imported post

          Thanks, everything is working now.

          Matt

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by andrewtrades, Today, 04:57 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by chbruno, Today, 04:10 PM
          0 responses
          6 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Started by josh18955, 03-25-2023, 11:16 AM
          6 responses
          436 views
          0 likes
          Last Post Delerium  
          Started by FAQtrader, Today, 03:35 PM
          0 responses
          7 views
          0 likes
          Last Post FAQtrader  
          Started by rocketman7, Today, 09:41 AM
          5 responses
          19 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X